Book a parcel, step by step
An assistant books a parcel in five calls. The price is only final at validation, and the user pays on the linked payment page. This service never takes payment.
1 Get quotes
Send the sender and destination countries and postcodes, and each parcel's weight and size. Show the user a few options. Quotes are indicative. Tool:
get_quotes.{ "from": { "country": "GB", "postcode": "M1 1AE" }, "to": { "country": "DE", "postcode": "10115" }, "parcels": [ { "weightKg": 2, "lengthCm": 30, "widthCm": 20, "heightCm": 15, "valueMinor": 2000 } ] }2 Check what the service needs
Use the service slug and the from and to codes that get_quotes returned. Ask the user only for the fields it lists as required. Tool:
get_booking_requirements.{ "serviceSlug": "dpd-classic", "from": "GB", "to": "DE" }3 Pick a drop-off shop (drop-off services only)
Search the service's drop-off network near the sender, and let the user choose a shop. Tool:
search_drop_shops.{ "provider": "INPOST", "near": "M1 1AE", "purpose": "dropoff" }4 Validate the order
Send the full order. Fix any issues and validate again. Show the user the total, the breakdown and every warning, and get a clear yes. Tool:
validate_order.{ "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" } ] }5 Create the order
Send the confirmationToken from validate_order, once. Give the user the payment link. Nothing is booked until they pay. Tool:
create_order.{ "confirmationToken": "v1.<from validate_order>" }
Safe by design
- create_order books exactly the order that was validated. If the price has changed since, it refuses and asks for a new validation.
- create_order is never retried automatically. If it fails, the error says whether an order may exist.
- The payment link comes from this site and forwards to the booking site's payment page.
Several parcels at once
Sending to several people? Price them together, then book them as one order with one payment link.
- get_quotes takes
moreShipments: up to 10 shipments in one call, each with its own addresses and parcels. A shipment that cannot be quoted gets its own error; the rest are still priced. - validate_order takes
moreItems: up to 5 shipments on one order, one total and one breakdown. Each item names its service and receiver; the sender defaults to the order's, and must be in the same country. - create_order books them all with one payment link. Problems point at the item, for example
moreItems[0].to.postcode.
Same-day delivery
A dedicated motorcycle or van collects and delivers on the same day, within mainland Great Britain. Quotes leave it out unless includeSameDay: true.
- Expensive. Priced by distance and vehicle, not weight: about £22 across a city, over £1,000 between distant cities. Confirm the price with the user first.
- Both postcodes are required, and both must be in mainland Great Britain. Without them no same-day service is returned.
- Same day means delivered the day it is collected, not collected today. The earliest collection is the next working day (or a Saturday, which may deliver on Monday). The driver comes between 06:00 and 19:00; no time can be chosen.
- Pick the vehicle for the total. Limits are checked per parcel, so add up the weight and choose the smallest vehicle that carries it all: motorcycle 5 kg, small van 400 kg, large van 800 kg, extra-large van 1,100 kg.
- The receiver's phone is required, as is the sender's. No label is needed: the driver collects from the address.
- The courier prices live, so validate straight before booking and get the user's yes on that total.