Verify whether shipping rules can be applied
If the shipping workflow that you are using requires that consignment creation and allocation are separate actions, you can check whether a consignment can be sent using the desired shipping rules. Shipping rules enable you to search for an optimal carrier service by using acceptable and unacceptable collection and delivery days and date and time slots, carrier services, delivery location, and other filtering options.
Note
The optimal carrier service will be selected only from the carrier services linked to your Metapack shipper account, not from the entire library of carrier services integrated with the Metapack Platform.
Verify shipping rules application request
You need the following to make a verify shipping rules application request.
Parameter | Value | Description |
---|---|---|
status |
UNALLOCATED |
The consignment lifecycle status. |
Using the Verify whether shipping rules can be applied operation, enter the following information:
- Order details
- Consignment dimensions and weight
- Details about each parcel in the consignment
-
Either the
code
of a previously defined shipping rule or allocation parameters to define a new shipping rule for this consignment
Example request
POST /shipping/v1/consignment-validation HTTP/1.1
Host: api.metapack.com
API-Key: Basic Base64-encoded <username>:<password>
Content-Type: application/json
{
"consignment": {
"measurementUnits": {
"weight": "kg",
"measurement": "cm",
"volume" : "ml"
},
"orders": [
{
"orderRef": "ref",
"value": {
"amount": 10,
"currencyCode": "GBP"
}
}
],
"shipmentRef": null,
"sender": {
"code": "default",
"addressLine1": "200 GRAY'S INN RD",
"addressLine2": "METAPACK LIMITED 4TH FLOOR",
"postCode": "WC1X 8XZ",
"countryCode": "GBR",
"companyName": "retailer",
"city": "London",
"stateProvince": null,
"timeZone": "Europe/London",
"contact": {
"name" : "help test",
"email": "help@metapack.com",
"phone": "0612345678"
}
},
"recipient": {
"addressLine1": "200 Grays Inn",
"addressLine2": "London",
"postCode": "WC1X 8XZ",
"countryCode": "GBR",
"companyName": "METAPACK LIMITED",
"city": "London",
"stateProvince": "",
"timeZone": "Europe/London",
"type": "business",
"contact": {
"name" : "help test",
"email": "help@metapack.com",
"phone": "0612345678"
}
},
"parcels": [
{
"shipperRef": "1213",
"packagingType": "BAG",
"weight": {
"value": 1
},
"dimensions": {
"height": 10,
"width": 12,
"depth": 10
},
"value": {
"amount": 12,
"currencyCode": "GBP"
},
"items": [
{
"itemRef": "prod1",
"harmonisedCode": "1",
"countryOfOrigin": "GBR",
"fabricContent": "1",
"description": "prod1",
"itemType": "1",
"quantity": 1,
"value": {
"amount": 10
},
"exportReferenceNumber": null,
"exportLicenseNumber": null,
"batteryChemCode": null,
"weight": {
"value": 1
},
"dangerousGoods": {
"unId": "11",
"shippingName": "ship",
"productClass": "dangerous",
"packagingGroup": "12",
"measurementUnit": "12",
"packagingInstructions": "instruction",
"packagingInstructionSection": "22222",
"quantity": 1,
"packagingType": "bag",
"amount": 1,
"regulationAuthority": "ra",
"regulationLevelCode": "1",
"transportationMeans": "12",
"reportableQuantity": true,
"radioActive": false,
"subRiskClass": "22",
"technicalName": "222",
"additionalInfo": "22222",
"overPack": "1111"
}
}
]
}
],
"type": "delivery",
"tags": [
"cust1",
"cust2",
"cust3",
"cust4",
"cust5",
"cust6",
"cust7",
"cust8",
"cust9",
"cust10"
],
"supportingAgents": {
"return": {
"addressLine1": "200 Grays Inn",
"addressLine2": "METAPACK LIMITED 4TH FLOOR",
"city": "London",
"postCode": "WC1X 8XC",
"countryCode": "GBR",
"companyName": "return wh",
"stateProvince": "",
"type": "business",
"contact": {
"name": "test",
"email": "help@metapack.com",
"phone": "+31612345678"
}
}
}
},
"shippingRules": {
"collectionDays": {
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"sunday": true
},
"deliveryDays": {
"monday": true,
"tuesday": true,
"wednesday": true,
"thursday": true,
"friday": true,
"saturday": true,
"sunday": true
},
"carrierServices": [
"RMFIRSTSTL"
]
}
}
Verify shipping rules application response
200
(OK) or 204
(No Content)
The status code of the response will determine what you must do next to progress the allocation of the consignment.
Status code | Description | Next action |
---|---|---|
200 |
A subscribed carrier service is available at the selected time for the consignment and its shipping rules. | You can proceed with using the specified shipping rules to allocate the consignment. |
204 |
A subscribed carrier service is not available at the selected time for the consignment and its shipping rules. | You will need to change the desired day and/or time and retry the API operation. |