Validate an order
Check a complete order and get its final price, breakdown and warnings. Nothing is booked. Fix any issues and call again. Show the user the total and warnings, then pass confirmationToken to create_order. Several shipments can go on one order (moreItems): one total, one payment link.
Request
| Field | Type | Notes |
|---|---|---|
serviceSlug required | string | slug from get_quotes |
to required | object | |
to.name required | string | Contact name |
to.organisation | string | |
to.property required | string | House number or name |
to.street required | string | |
to.locality | string | |
to.town required | string | |
to.county | string | State or province code where required (e.g. NY) |
to.postcode required | string | |
to.country required | string | Country code get_quotes returned (may be a territory such as GB-NIR) |
to.email | string | |
to.phone | string | |
to.shopId | string | Drop shop id from search_drop_shops |
to.companyStatus | "individual" | "business-registered" | "business-not-registered" | |
to.companyTaxNumber | string | VAT or company tax number |
to.eori | string | |
to.taxId | string | Personal tax id |
to.residential | boolean | false for a business address (cheaper on some sites) |
parcels required | object[] | |
parcels[].weightKg required | number | Max 1000. |
parcels[].lengthCm required | number | Max 1000. |
parcels[].widthCm required | number | Max 1000. |
parcels[].heightCm required | number | Max 1000. |
parcels[].valueMinor required | integer | Declared value in minor units of the sender's currency |
parcels[].description required | string | Short summary of the contents |
parcels[].quantity | integer | Default: 1. Min 1. Max 100. |
parcels[].contents | object[] | Customs lines: international only |
parcels[].contents[].quantity required | integer | Min 1. Max 1000. |
parcels[].contents[].description required | string | Be specific, e.g. 'Paperback book' |
parcels[].contents[].valueMinor required | integer | Line total in minor units |
parcels[].contents[].weightKg | number | Line total |
parcels[].contents[].countryOfManufacture | string | ISO2 |
parcels[].contents[].tariffCode | string | Digits only |
parcels[].contents[].merchantProductId | string | Seller's SKU |
parcels[].contents[].manufacturerProductId | string | Model or part number |
parcels[].contents[].standardProductId | string | Barcode (GTIN/EAN/UPC/ISBN) |
collectionDate | string (date) | |
extras | string[] | Extra keys from get_quotes |
customs | object | |
customs.exportReason | string | |
customs.dutyTerms | "ddu" | "ddp" | "ioss" | |
customs.ioss | string | IM + 10 digits |
from required | object | |
from.name required | string | Contact name |
from.organisation | string | |
from.property required | string | House number or name |
from.street required | string | |
from.locality | string | |
from.town required | string | |
from.county | string | State or province code where required (e.g. NY) |
from.postcode required | string | |
from.country required | string | Country code get_quotes returned (may be a territory such as GB-NIR) |
from.email | string | |
from.phone | string | |
from.shopId | string | Drop shop id from search_drop_shops |
from.companyStatus | "individual" | "business-registered" | "business-not-registered" | |
from.companyTaxNumber | string | VAT or company tax number |
from.eori | string | |
from.taxId | string | Personal tax id |
from.residential | boolean | false for a business address (cheaper on some sites) |
moreItems | object[] | More shipments on this order, paid together with one link. Each needs its own quote and requirements |
moreItems[].serviceSlug required | string | slug from get_quotes |
moreItems[].to required | object | |
moreItems[].to.name required | string | Contact name |
moreItems[].to.organisation | string | |
moreItems[].to.property required | string | House number or name |
moreItems[].to.street required | string | |
moreItems[].to.locality | string | |
moreItems[].to.town required | string | |
moreItems[].to.county | string | State or province code where required (e.g. NY) |
moreItems[].to.postcode required | string | |
moreItems[].to.country required | string | Country code get_quotes returned (may be a territory such as GB-NIR) |
moreItems[].to.email | string | |
moreItems[].to.phone | string | |
moreItems[].to.shopId | string | Drop shop id from search_drop_shops |
moreItems[].to.companyStatus | "individual" | "business-registered" | "business-not-registered" | |
moreItems[].to.companyTaxNumber | string | VAT or company tax number |
moreItems[].to.eori | string | |
moreItems[].to.taxId | string | Personal tax id |
moreItems[].to.residential | boolean | false for a business address (cheaper on some sites) |
moreItems[].parcels required | object[] | |
moreItems[].parcels[].weightKg required | number | Max 1000. |
moreItems[].parcels[].lengthCm required | number | Max 1000. |
moreItems[].parcels[].widthCm required | number | Max 1000. |
moreItems[].parcels[].heightCm required | number | Max 1000. |
moreItems[].parcels[].valueMinor required | integer | Declared value in minor units of the sender's currency |
moreItems[].parcels[].description required | string | Short summary of the contents |
moreItems[].parcels[].quantity | integer | Default: 1. Min 1. Max 100. |
moreItems[].parcels[].contents | object[] | Customs lines: international only |
moreItems[].parcels[].contents[].quantity required | integer | Min 1. Max 1000. |
moreItems[].parcels[].contents[].description required | string | Be specific, e.g. 'Paperback book' |
moreItems[].parcels[].contents[].valueMinor required | integer | Line total in minor units |
moreItems[].parcels[].contents[].weightKg | number | Line total |
moreItems[].parcels[].contents[].countryOfManufacture | string | ISO2 |
moreItems[].parcels[].contents[].tariffCode | string | Digits only |
moreItems[].parcels[].contents[].merchantProductId | string | Seller's SKU |
moreItems[].parcels[].contents[].manufacturerProductId | string | Model or part number |
moreItems[].parcels[].contents[].standardProductId | string | Barcode (GTIN/EAN/UPC/ISBN) |
moreItems[].collectionDate | string (date) | |
moreItems[].extras | string[] | Extra keys from get_quotes |
moreItems[].customs | object | |
moreItems[].customs.exportReason | string | |
moreItems[].customs.dutyTerms | "ddu" | "ddp" | "ioss" | |
moreItems[].customs.ioss | string | IM + 10 digits |
moreItems[].from | object | |
moreItems[].from.name required | string | Contact name |
moreItems[].from.organisation | string | |
moreItems[].from.property required | string | House number or name |
moreItems[].from.street required | string | |
moreItems[].from.locality | string | |
moreItems[].from.town required | string | |
moreItems[].from.county | string | State or province code where required (e.g. NY) |
moreItems[].from.postcode required | string | |
moreItems[].from.country required | string | Country code get_quotes returned (may be a territory such as GB-NIR) |
moreItems[].from.email | string | |
moreItems[].from.phone | string | |
moreItems[].from.shopId | string | Drop shop id from search_drop_shops |
moreItems[].from.companyStatus | "individual" | "business-registered" | "business-not-registered" | |
moreItems[].from.companyTaxNumber | string | VAT or company tax number |
moreItems[].from.eori | string | |
moreItems[].from.taxId | string | Personal tax id |
moreItems[].from.residential | boolean | false for a business address (cheaper on some sites) |
customer | object | Defaults to the sender's name and email |
customer.forename required | string | |
customer.surname required | string | |
customer.email required | string |
Examples
curl -X POST "https://parcel-mcp.com/v1/orders/validate" \
-H "content-type: application/json" \
-d '{
"serviceSlug": "dpd-collection",
"from": {
"name": "Sam Sender",
"property": "1",
"street": "Piccadilly",
"town": "Manchester",
"postcode": "M1 1AE",
"country": "GB",
"email": "sam@example.com",
"phone": "01611234567"
},
"to": {
"name": "Robin Receiver",
"property": "10",
"street": "Downing Street",
"town": "London",
"postcode": "SW1A 2AA",
"country": "GB",
"email": "robin@example.com",
"phone": "02071234567"
},
"parcels": [
{
"weightKg": 2,
"lengthCm": 30,
"widthCm": 20,
"heightCm": 15,
"valueMinor": 2000,
"description": "Books"
}
]
}'
As an MCP tool call over POST /mcp:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "validate_order",
"arguments": {
"serviceSlug": "dpd-collection",
"from": {
"name": "Sam Sender",
"property": "1",
"street": "Piccadilly",
"town": "Manchester",
"postcode": "M1 1AE",
"country": "GB",
"email": "sam@example.com",
"phone": "01611234567"
},
"to": {
"name": "Robin Receiver",
"property": "10",
"street": "Downing Street",
"town": "London",
"postcode": "SW1A 2AA",
"country": "GB",
"email": "robin@example.com",
"phone": "02071234567"
},
"parcels": [
{
"weightKg": 2,
"lengthCm": 30,
"widthCm": 20,
"heightCm": 15,
"valueMinor": 2000,
"description": "Books"
}
]
}
}
}
Response
| Field | Type | Notes |
|---|---|---|
service required | object | |
service.slug required | string | |
service.name required | string | |
service.courier required | string | |
from required | string | |
to required | string | |
date | string | Collection or drop-off date that will be booked |
delivery | string | Expected delivery date or range |
total required | object | Final price of the whole order. Show it, the breakdown and every warning before booking |
total.minor required | integer | Amount in minor units (pence, cents) |
total.currency required | string | ISO 4217 code, e.g. GBP |
total.display required | string | Formatted, e.g. £12.16 |
breakdown required | object[] | Incl. tax, grouped by charge |
breakdown[].name required | string | |
breakdown[].amount required | object | |
breakdown[].amount.minor required | integer | Amount in minor units (pence, cents) |
breakdown[].amount.currency required | string | ISO 4217 code, e.g. GBP |
breakdown[].amount.display required | string | Formatted, e.g. £12.16 |
items | object[] | Every shipment, in order, when the order has more than one |
items[].service required | object | |
items[].service.slug required | string | |
items[].service.name required | string | |
items[].service.courier required | string | |
items[].from required | string | |
items[].to required | string | |
items[].date | string | Collection or drop-off date that will be booked |
items[].delivery | string | Expected delivery date or range |
warnings | string[] | |
confirmationToken required | string | Pass to create_order before expiresAt. It holds this exact order |
expiresAt required | string |
Errors
Errors are problem JSON. Each issue names the field to fix and how to fix it. See every error code and its fix.