Skip to Content
Client API 2026-09Create Shipment

Create Shipment

POST /shipments — rate limit 30 / min · requires an active subscription

Creates the shipment with the carrier, charges the account credit and returns the shipment together with its label. The shipment is quoted first: the contract must be available for the destination and packages, exactly as in Get Rates.

Request body

FieldTypeRequiredDescription
referencestring (100)NoYour order reference. Returned as reference, searchable in GET /shipments?reference=, sent in webhooks as order_id
serviceTypestringNocontractCode from /carriers or /rates. Omitted: the first contract of the quote is used
carrierCodestringNoOptional consistency check: must match the carrier of serviceType, otherwise 422
shipperPartyNoSender. Default: the operational address of the account
recipientPartyYesRecipient; name, address.street, address.city, address.postalCode, address.countryCode are required
packages[]Package[]Yes1 to 50 packages, each with its own weight and dimensions (multi-parcel only on contracts with multiParcel: true)
packages[].descriptionstringNoContent of the package
packages[].valuenumberNoValue of the package
optionsobjectNoSee below
customsDetailobjectConditionalRequired when the destination is outside the EU customs territory. See Customs Declaration

Party object

FieldTypeRequiredDescription
namestring (100)YesFull name
companystring (100)NoCompany name
address.streetstring (150)YesStreet and number
address.street2string (100)NoSecond address line
address.citystring (80)Yes
address.provincestring (10)No2-letter province code for Italy
address.postalCodestring (15)Yes
address.countryCodestring (2)YesISO 3166-1 alpha-2
phonestring (30)NoRecommended: carriers use it for delivery notifications
emailstringNo
referencestring (50)NoRecipient reference printed on the label

Options object

FieldTypeDescription
notesstring (255)Notes for the carrier
contentDescriptionstring (255)Description of the content
labelFormat"PDF" | "ZPL"Native format of the label to generate (default PDF)
codMoney + method / typeCash on delivery. method is a key of cashOnDeliveryMethods (from /carriers or /rates); type is the raw carrier code, alternative to method
insuranceMoneyInsured value
accessoryServicesinteger[]serviceId values from /carriers
pickupFromAddressbooleanApply the pickup surcharge

Example

{ "reference": "ORD-1234", "serviceType": "brt-standard", "carrierCode": "brt", "shipper": { "name": "Mario Rossi", "company": "ACME Srl", "address": { "street": "Via Roma 1", "city": "Milano", "province": "MI", "postalCode": "20100", "countryCode": "IT" }, "phone": "+39 333 1234567", "email": "mario@acme.it" }, "recipient": { "name": "Giulia Bianchi", "address": { "street": "Via Garibaldi 10", "street2": "Scala B", "city": "Roma", "province": "RM", "postalCode": "00100", "countryCode": "IT" }, "phone": "+39 333 7654321", "email": "giulia@example.com", "reference": "DEST-9" }, "packages": [ { "weight": { "value": 1.5, "units": "KG" }, "dimensions": { "length": 30, "width": 20, "height": 10, "units": "CM" } } ], "options": { "notes": "Fragile", "contentDescription": "Abbigliamento", "labelFormat": "PDF", "cod": { "amount": 25.5, "currency": "EUR", "method": "CONT" }, "insurance": { "amount": 0, "currency": "EUR" }, "accessoryServices": [] } }

Response

201 Created with the Shipment object plus label:

FieldTypeDescription
label.format"PDF" | "ZPL"Native format of the stored label
label.pdfstring|nullBase64-encoded PDF
label.zplstring|nullBase64-encoded ZPL, when labelFormat was ZPL and the carrier supports it

The label can be fetched again at any time with GET /shipments/{ldv}/label.

Rules

  • recipient and packages are required; shipper is optional.
  • Without serviceType the first contract of the quote is used. To choose, call POST /rates first.
  • Contract codes of level-1 reseller contracts are encrypted: pass them exactly as returned by /carriers or /rates.
  • Weights in KG or G, dimensions in CM or MM; every package carries its own weight.
  • customsDetail is mandatory for destinations outside the EU customs territory and optional elsewhere — see Customs Declaration.
  • The shipment is charged to the account credit (cost.total). Cancelling it with DELETE /shipments/{ldv} refunds the credit.

Errors

HTTPcodeWhen
402subscription_required · subscription_payment_failed · plan_limit_reachedSubscription missing / unpaid / monthly limit reached; also when a reseller contract requires a subscription
403forbiddenEncrypted contract code issued to another account
404not_foundNo contract available for this shipment, contract code unknown, no price list on the account
422validation_failedInvalid payload; details lists the fields. Also serviceType not available for this shipment, carrierCode mismatch, missing customsDetail, or customsValue not matching the commodities
422shipment_rejectedThe carrier or the business rules refused the shipment; the reason is in message
429rate_limitedMore than 30 requests per minute

Decoding the label

const fs = require('fs') fs.writeFileSync('label.pdf', Buffer.from(shipment.label.pdf, 'base64'))

Store trackingNumber (the LDV): it is the identifier of every shipment endpoint (/shipments/{ldv}, label, tracking, cancellation) and of the webhook events.

Last updated on