create_shipment
Create a United Kingdom shipping label via Shippo — pass a to_address, from_address and parcel (dimensions in CENTIMETRES, weight in GRAMS by default), and the server fetches carrier rates, buys the CHEAPEST rate by default (or the carrier/service you specify), and returns the shipment_id, transaction_id, tracking_number, printable label_url and the price paid (GBP). Recommended carrier: Royal Mail Tracked 24/48 via the Shippo master account — no Royal Mail contract or merchant account needed — so an agent can print a Royal Mail label with no merchant courier account. Bring your own Shippo API token via header x-shippo-token: free TEST tokens (prefix shippo_test_…) run the full flow end-to-end at no cost (sign up free, no card, at apps.goshippo.com/join); production tokens (prefix shippo_live_…) buy real labels. The token prefix auto-selects the environment. weight is always required. Owner policy headers gate the label price before any purchase.
Parameters25
| to_name | string | required | Recipient full name. |
| to_street1 | string | required | Recipient street address line 1. |
| to_street2 | string | optional | Optional recipient street address line 2 (flat/unit). |
| to_city | string | required | Recipient town / city. |
| to_state | string | optional | Optional recipient county (county is optional for United Kingdom addresses). |
| to_zip | string | required | Recipient postcode (e.g. "SW1A 1AA"). Required. |
| to_country | string | optional | Recipient ISO country code. Default GB. |
| to_phone | string | optional | Optional recipient phone (some carriers/services require it). |
| to_email | string | optional | Optional recipient email. |
| from_name | string | required | Sender full name. |
| from_street1 | string | required | Sender street address line 1. |
| from_street2 | string | optional | Optional sender street address line 2. |
| from_city | string | required | Sender town / city. |
| from_state | string | optional | Optional sender county. |
| from_zip | string | required | Sender postcode. Required. |
| from_country | string | optional | Sender ISO country code. Default GB. |
| from_phone | string | optional | Optional sender phone. |
| weight | number | required | Parcel weight in GRAMS (g) by default. Required. Use mass_unit to change (kg/oz/lb). |
| mass_unit | string | optional | Weight unit: g (default), kg, oz or lb. |
| length | number | optional | Parcel length in CENTIMETRES (cm) by default. Provide length+width+height together. |
| width | number | optional | Parcel width in CENTIMETRES. |
| height | number | optional | Parcel height in CENTIMETRES. |
| distance_unit | string | optional | Dimension unit: cm (default), m, in or ft. |
| carrier | string | optional | Optional: restrict to a carrier (e.g. "Royal Mail"). Default: cheapest across all available carriers. |
| service | string | optional | Optional: restrict to a service level name or token (e.g. "Tracked 24/48"). Default: cheapest. |
Raw schema
{
"type": "object",
"properties": {
"to_name": {
"type": "string",
"description": "Recipient full name."
},
"to_street1": {
"type": "string",
"description": "Recipient street address line 1."
},
"to_street2": {
"type": "string",
"description": "Optional recipient street address line 2 (flat/unit)."
},
"to_city": {
"type": "string",
"description": "Recipient town / city."
},
"to_state": {
"type": "string",
"description": "Optional recipient county (county is optional for United Kingdom addresses)."
},
"to_zip": {
"type": "string",
"description": "Recipient postcode (e.g. \"SW1A 1AA\"). Required."
},
"to_country": {
"type": "string",
"description": "Recipient ISO country code. Default GB."
},
"to_phone": {
"type": "string",
"description": "Optional recipient phone (some carriers/services require it)."
},
"to_email": {
"type": "string",
"description": "Optional recipient email."
},
"from_name": {
"type": "string",
"description": "Sender full name."
},
"from_street1": {
"type": "string",
"description": "Sender street address line 1."
},
"from_street2": {
"type": "string",
"description": "Optional sender street address line 2."
},
"from_city": {
"type": "string",
"description": "Sender town / city."
},
"from_state": {
"type": "string",
"description": "Optional sender county."
},
"from_zip": {
"type": "string",
"description": "Sender postcode. Required."
},
"from_country": {
"type": "string",
"description": "Sender ISO country code. Default GB."
},
"from_phone": {
"type": "string",
"description": "Optional sender phone."
},
"weight": {
"type": "number",
"description": "Parcel weight in GRAMS (g) by default. Required. Use mass_unit to change (kg/oz/lb)."
},
"mass_unit": {
"type": "string",
"description": "Weight unit: g (default), kg, oz or lb."
},
"length": {
"type": "number",
"description": "Parcel length in CENTIMETRES (cm) by default. Provide length+width+height together."
},
"width": {
"type": "number",
"description": "Parcel width in CENTIMETRES."
},
"height": {
"type": "number",
"description": "Parcel height in CENTIMETRES."
},
"distance_unit": {
"type": "string",
"description": "Dimension unit: cm (default), m, in or ft."
},
"carrier": {
"type": "string",
"description": "Optional: restrict to a carrier (e.g. \"Royal Mail\"). Default: cheapest across all available carriers."
},
"service": {
"type": "string",
"description": "Optional: restrict to a service level name or token (e.g. \"Tracked 24/48\"). Default: cheapest."
}
},
"required": [
"to_name",
"to_street1",
"to_city",
"to_zip",
"from_name",
"from_street1",
"from_city",
"from_zip",
"weight"
]
}