Error 99999 with Mondial Relay
Bruno83200_6929 Posted messages 707 Registration date Status Membre Last intervention -
Hello,
after creating my Mondial Relay account, I received the API credentials for version 1 and version 2. For each account, I have production parameters and test parameters. For now, I am focusing on version 2.
I can create labels with version 2, but only with the test parameters. It's amazing, it works! I successfully created a shipping label.
However, I have been trying for days and days to create a label with Mondial Relay using my production parameters. Of course, I am not changing anything in the fields under the credentials; I am simply changing my credentials. I have tried every possible and imaginable solution. I have searched meticulously on the web and, unfortunately, I find nothing, absolutely nothing, capable of generating my labels with my production parameters.
Of course, I have tried to contact Mondial Relay via Facebook, by phone, and by email, but they do not respond. So, if someone generous could help me…
Here is the message I receive with each of my attempts. I will give you my code with a commented section: my test account that generates demo labels, and the parameters of my production account. Of course, for confidentiality reasons, I have slightly modified my credentials. Thank you in advance for your help.
Here is the error message with the production credentials.
RegisteredShipmentData Object ( [BrandCode] => [Success] => [Messages] => Array ( [0] => RegisteredParcelStatusData Object ( [Message] => A validation error has occurred.
this code is provided with the Mondial Relay toolbox
<?php require_once('includes/MondialRelay.API.Class.php'); //We declare the client $MRService = new MondialRelayWebAPI(); /* //test $MRService->_Api_CustomerCode = "BDTEST"; //$MRService->_Api_BrandId = "11"; //$MRService->_Api_SecretKey = ""; $MRService->_Api_User = "BDTEST@business-api.mondialrelay.com"; $MRService->_Api_Password = "'2crtPDo0ZL7Q"; $MRService->_Api_Version = "2.0"; */ //production $MRService->_Api_CustomerCode = "CC23FV88"; //$MRService->_Api_BrandId = "CC23FV88"; //$MRService->_Api_SecretKey = ""; $MRService->_Api_User = "CC23FV88@business-api.mondialrelay.com"; $MRService->_Api_Password = ":vpCH'WGi7H"; $MRService->_Api_Version = "2.0"; $MRService->_Debug = false; //set the merchant adress //sender adress $merchantAdress = new Adress(); $merchantAdress->Adress1 = "My book shop"; //$merchantAdress->Adress2 = ""; $merchantAdress->Adress3 = "10 rue des écoles"; //$merchantAdress->Adress4 = ""; $merchantAdress->PostCode = "6000"; $merchantAdress->City = "charleroi"; $merchantAdress->CountryCode = "BE"; $merchantAdress->PhoneNumber = "+32300000000" ; //$merchantAdress->PhoneNumber2 =""; $merchantAdress->Email = "hello@mybookshop.com"; $merchantAdress->Language = "BE"; //------------------------------------------------- //Shipment Creation Sample //------------------------------------------------- //Create a new shipment object $myShipment = new ShipmentData(); //set the delivery options $myShipment->DeliveryMode = new ShipmentInfo() ; $myShipment->DeliveryMode->Mode = "HOM"; //parcel Shop ID when required //$myShipment->DeliveryMode->ParcelShopId = "41068"; //$myShipment->DeliveryMode->ParcelShopContryCode = "BE"; //$myShipment->DeliveryMode->ParcelShopCountryCode = "BE"; //set the pickup options $myShipment->CollectMode = new ShipmentInfo() ; $myShipment->CollectMode->Mode = "CCC"; //parcel Shop ID when required //$myShipment->CollectMode->ParcelShopId = "066974"; //$myShipment->CollectMode->ParcelShopContryCode = "FR"; $myShipment->InternalOrderReference = "592268872383"; $myShipment->InternalCustomerReference ="LBG"; //sender adress with the previsously declarated adress $myShipment->Sender = $merchantAdress; //recipient adress $myShipment->Recipient = new Adress() ; $myShipment->Recipient->Adress1 = "Robin Mince"; //$myShipment->Recipient->Adress2 = "Résidence des champs"; $myShipment->Recipient->Adress3 = "18 rue basse"; //$myShipment->Recipient->Adress4 = ""; $myShipment->Recipient->PostCode = "6000"; $myShipment->Recipient->City = "Charleroi"; $myShipment->Recipient->CountryCode = "BE"; $myShipment->Recipient->PhoneNumber = "+32300000000" ; $myShipment->Recipient->PhoneNumber2 = "+32600000000"; $myShipment->Recipient->Email = "client@yopmail.com"; $myShipment->Recipient->Language = "FR"; //shipment datas $myShipment->DeliveryInstruction= "" ; $myShipment->CommentOnLabel= "" ; //parcel declaration (one item per parcel) $myShipment->Parcels[0] = new Parcel(); $myShipment->Parcels[0]->WeightInGr = 1000; $myShipment->Parcels[0]->Content = "books "; // $myShipment->Parcels[1] = new Parcel(); // $myShipment->Parcels[1]->WeightInGr = 2000; // $myShipment->Parcels[1]->Content = "pencils and paints "; $myShipment->InsuranceLevel=""; $myShipment->CostOnDelivery= 0 ; $myShipment->CostOnDeliveryCurrency= "EUR" ; $myShipment->Value= 0 ; $myShipment->ValueCurrency= "EUR"; //Create the shipment //this will return the stickers URL and Shipment number to track the parcel //creation with Internationnal API $ShipmentDatas = $MRService->CreateShipment($myShipment); print_r($ShipmentDatas); echo '<a href="'.$ShipmentDatas->LabelLink.'" >Download Stickers</a>'; ?>
2 réponses
Hello,
The problem is most likely due to one or more required parameters in production, namely BrandCode / BrandId and mandatory address / language / phone fields.
Add a BrandCode (often required in production):
$MRService->_Api_BrandId = "XX"; // Replace XX with the exact value provided by MR in production
Replace "BE" with "FR" in the Language field of the sender and recipient, Mondial Relay often expects an ISO 639-1 language code:
$merchantAdress->Language = "FR"; $myShipment->Recipient->Language = "FR";
Check the address format, for example, do not include Address3 if it is not necessary, but prioritize Address1 and Address2:
$merchantAdress->Adress1 = "10 rue des écoles"; $merchantAdress->Adress2 = "My book shop"; // rather than in Address3
Send a phone number without spaces and properly formatted:
$merchantAdress->PhoneNumber = "+32300000000";
Ensure that you are not using Address4 or any other empty fields, as it can sometimes cause issues.
Further Debugging
Set $MRService->_Debug = true; to retrieve more detailed logs.
Try to capture and display all errors returned in the $ShipmentDatas->Messages array, not just the first message:
if (isset($ShipmentDatas->Messages)) { foreach ($ShipmentDatas->Messages as $msg) { echo $msg->Message . "<br>"; } } I know you have already tried, but generally the best way to contact their API technical support is through their dedicated portal or your sales contact. Sometimes they respond better through an official ticket.
Hello
Thank you for the help and the response but also the solution
But in any case, it's always the same error code
Whether it's Claude or Chat GPT, neither finds a solution either
To contact Mondial Relay, they say they respond but never do
Good evening,
According to the research I have conducted, error 99999 may be related to a temporary issue with the Mondial Relay server, such as unavailability or service overload.
If you are using a pickup point or a delivery method (such as a Locker) that is not authorized in your contract with Mondial Relay, this may trigger a validation error like 99999.
Some users have reported that error 99999 only appears with certain pickup points, while others work correctly. This may be related to specific data about the pickup point (postal code, address, etc.) or restrictions in the Mondial Relay database.
Bruno