๐Ÿ‘ Validate

Learn how to validate shipment data before creating a shipping order:

The validateShipment call provides the advantage of validating shipment data _before _a createShipment call will persist a shipment in the database.

๐Ÿ“˜

  • There is no general answer, what the validateShipment call will check beforehand.
  • It is also good to know that the validateShipment will not be successful for all carriers. When the validateShipment call does not check anything or is not implemented yet, the response will be "The carrier does not support carrier-specific route validations."

Pre-validation

Pre-validation checks, if the shipment with the given carrier, service, and consignee (postal code and country validation) will succeed when it comes to label printing.

๐Ÿšง

What's not included in the pre-validation

In most cases, package data influences checks as well e.g. package weight, dimensions, or quantity reglementation. The same applies to shipment items which are required for hazardous goods or shipping to third country. This will not be checked in the pre-validation. However, successful routing for the selected addresses and services will provide a useful indication to the carrier.

Request parameters

The important parameter in the request is the validation mode. The different modes must be separated by | if more than one mode wants to be used, at the same time. Valid values are:

ValueDescription
ROUTE_SERVEDChecks if a shipment can be sent to the consignee address with the specified carrier and service.
SERVICE_COMPLIANTChecks if the shipment data are in compliance with the carriers requirements.
{
  "validationParms": {
    "validationMode": "ROUTE_SERVED|SERVICE_COMPLIANT"
  }
}
<validationParms>
   <validationMode>ROUTE_SERVED|SERVICE_COMPLIANT</validationMode>
</validationParms>

Potential validation results and their reasons

For the response, there are several possible scenarios.

ResultReason
VALIDATION_NO_CHECK_SELECTEDNo or invalid validation mode in the request.
VALIDATION_FAILEDMaster data problem of the carrier configuration or route is not valid.
VALIDATION_MISSING_DATARequired data is missing in the request.
VALIDATION_REQUEST_NOT_SUPPORTEDCarrier does not support validateShipment or it is not implemented yet.
VALIDATION_OKValidation was successful.