curl -X POST "$API_BASE/api/v1/shipments" \
-H "x-api-key: $MAICOURIER_API_KEY" \
-H "Idempotency-Key: order-10482" \
-H "Content-Type: application/json" \
-d '{
"serviceCode": "STD",
"customerReference": "ORDER-10482",
"sender": {
"name": "Example Store",
"phone": "+302100000000",
"address": {
"line1": "10 Example Ave",
"city": "Athens",
"postalCode": "10431",
"country": "GR"
}
},
"recipient": {
"name": "Maria P.",
"phone": "+306900000000",
"locale": "en",
"address": {
"line1": "5 Sample St",
"city": "Karditsa",
"postalCode": "43100",
"country": "GR"
}
},
"deliveryMode": "DOOR",
"pieces": [
{
"declaredWeightGrams": 1800,
"lengthMm": 300,
"widthMm": 200,
"heightMm": 150
},
{
"declaredWeightGrams": 950
}
],
"codAmountMinor": 4250,
"instructions": "Call before delivery"
}'
HTTP/1.1 201 Created
{
"id": "shp_01J9Z6…",
"ref": "DC-26-000318",
"status": "BOOKED",
"deliveryMode": "DOOR",
"pieces": [
{
"pieceNumber": 1,
"barcode": "DC-26-000318-1",
"status": "BOOKED"
},
{
"pieceNumber": 2,
"barcode": "DC-26-000318-2",
"status": "BOOKED"
}
],
"codAmountMinor": 4250,
"currency": "EUR",
"estimatedTotalMinor": "…",
"labels": {
"pdf": "/api/v1/shipments/shp_01J9Z6…/labels?format=pdf",
"zpl": "/api/v1/shipments/shp_01J9Z6…/labels?format=zpl"
}
}
Simplified example. Amounts are in minor units (cents), weights in grams, dimensions in millimetres.