The Create Shipment endpoint allows the creation of a new shipment in Carriyo, generating a unique shipment ID. Merchants can specify a particular carrier account or rely on Carriyo to automatically assign a carrier based on predefined automation rules.
This endpoint supports the creation of both forward and reverse shipments, determined by the entity_type parameter:
You can create a shipment as either a draft, confirmed, or prebooked shipment:
Draft Shipments:
draft query parameter to true creates the shipment in draft status without booking it with a carrier.Confirmed Shipments:
draft query parameter is omitted or set to false, Carriyo treats the shipment as confirmed, assigns it to a carrier, and immediately initiates a booking request.Note: The API will respond with the status
pending, without waiting for the carrier's response.
Prebooked Shipments:
If you wish to track a shipment already booked outside Carriyo, create a prebooked shipment by setting the pre_booked parameter to true and providing the carrier’s prebooking information, such as in this example:
{
  "pre_booked": true,
  "pre_booking_info": {
    "input_carrier": "DHL",
    "carrier_tracking_no": "1234567890"
  }
}
Once Carriyo sends the booking request to the carrier:
After booking, a label is generated, and Carriyo pushes all status updates, including label details, back to the merchant via webhooks.
{- "entity_type": "FORWARD",
 - "merchant": "MERCHANT-ID",
 - "references": {
- "partner_order_reference": "new-shipment-1",
 - "partner_shipment_reference": "new-shipment-1"
 
}, - "payment": {
- "payment_mode": "PRE_PAID",
 - "total_amount": 100,
 - "currency": "USD"
 
}, - "parcels": [
- {
- "partner_parcel_reference": "parcel-123",
 - "weight": {
- "value": 1,
 - "unit": "kg"
 
}, - "dimension": {
- "width": 20,
 - "height": 40,
 - "depth": 40,
 - "unit": "cm"
 
} 
}, - {
- "partner_parcel_reference": "parcel-124",
 - "weight": {
- "value": 0.5,
 - "unit": "kg"
 
}, - "dimension": {
- "width": 30,
 - "height": 50,
 - "depth": 50,
 - "unit": "cm"
 
} 
} 
], - "items": [
- {
- "description": "Most Adorable Sneakers",
 - "quantity": 1,
 - "price": {
- "amount": 80,
 - "currency": "USD"
 
}, - "weight": {
- "value": 1,
 - "unit": "kg"
 
}, - "sku": "10001"
 
}, - {
- "description": "Absolutely Lovely Hat",
 - "quantity": 1,
 - "price": {
- "amount": 20,
 - "currency": "USD"
 
}, - "cost": {
- "amount": 20,
 - "currency": "USD"
 
}, - "weight": {
- "value": 0.5,
 - "unit": "kg"
 
}, - "sku": "10001"
 
} 
], - "customs": {
- "declared_value": {
- "amount": 100,
 - "currency": "USD"
 
}, - "incoterms": "DDU"
 
}, - "pickup": {
- "contact_name": "Warehouse Manager",
 - "contact_phone": "043872701",
 - "contact_email": "ops@test.com",
 - "address1": "Grand Central Warehouse",
 - "city": "Dubai",
 - "state": "Dubai",
 - "postcode": "",
 - "country": "AE"
 
}, - "dropoff": {
- "contact_name": "Jo Bloggs",
 - "contact_phone": "0561111234",
 - "contact_email": "jo@test.com",
 - "address1": "1, 10th Floor, Tower One",
 - "address2": "Dubai Marina",
 - "city": "DUBAI",
 - "what3words": "///daring.lion.race",
 - "postcode": "",
 - "country": "AE"
 
}, - "order_date": "2021-01-01T10:00:00.999+1:00"
 
}{- "shipment_id": "KR22VUXEXGKX1",
 - "merchant": "MERCHANT-ID",
 - "entity_type": "FORWARD",
 - "carrier_account": { },
 - "references": {
- "partner_order_reference": "test-order-1",
 - "partner_shipment_reference": "test-order-1"
 
}, - "payment": {
- "payment_mode": "PRE_PAID",
 - "pending_amount": 0,
 - "total_amount": 99,
 - "currency": "USD"
 
}, - "delivery": {
- "delivery_type": "STANDARD",
 - "scheduled_from": "2021-07-15T06:00:00.000Z",
 - "scheduled_to": "2021-07-15T10:00:00.000Z"
 
}, - "parcels": [
- {
- "parcel_id": "KR22VUXEXGKX1-1",
 - "partner_parcel_reference": "",
 - "description": "Parcel 1",
 - "weight": {
- "value": 1,
 - "unit": "kg"
 
}, - "dimension": {
- "width": 10,
 - "height": 10,
 - "depth": 10,
 - "unit": "cm"
 
} 
} 
], - "items": [
- {
- "sku": "S12345",
 - "description": "Carriyo T-Shirt",
 - "barcode": "B12345",
 - "origin_country": "US",
 - "quantity": 1,
 - "price": {
- "amount": 99,
 - "currency": "USD"
 
}, - "cost": {
- "amount": 20,
 - "currency": "USD"
 
}, - "weight": {
- "value": 1,
 - "unit": "kg"
 
}, - "dangerous_goods": false
 
} 
], - "customs": {
- "declared_value": {
- "amount": 100,
 - "currency": "USD"
 
}, - "incoterms": "DDU"
 
}, - "pickup": {
- "partner_location_id": "ACCOUNT_bef3862a-b27e-45d4-b077-8e8f4d674849",
 - "contact_name": "Customer Service",
 - "contact_phone": "+971561234567",
 - "contact_email": "crm@mybusiness.com",
 - "address1": "DIP Delivery Warehouse",
 - "area": "DUBAI-INVESTMENT-PARK-1",
 - "city": "DUBAI",
 - "state": "DUBAI",
 - "country": "AE",
 - "coords": [
- 29.373420706419914,
 - 47.97881566875099
 
] 
}, - "dropoff": {
- "contact_name": "Jo Bloggs",
 - "contact_phone": "+971561234567",
 - "contact_email": "jo.bloggs@gmail.com",
 - "address1": "1 Financial Centre Road",
 - "address2": "Downtown Views, Apartment 101",
 - "area": "DOWNTOWN-DUBAI",
 - "city": "DUBAI",
 - "state": "DUBAI",
 - "country": "AE",
 - "coords": [
- 29.294045,
 - 48.087608
 
] 
}, - "post_shipping_info": {
- "status": "error",
 - "key_milestones": { },
 - "error_details": [
- {
- "level": "ERROR",
 - "trigger": "BOOKING",
 - "source": "CARRIYO",
 - "type": "VALIDATION",
 - "message": "No carrier assigned. Please provide valid carrier and reprocess booking again.",
 - "code": "no_carrier_assigned",
 - "field": "carrier"
 
}, - {
- "level": "WARNING",
 - "trigger": "BOOKING",
 - "source": "CARRIYO",
 - "type": "VALIDATION",
 - "message": "Contact Email is missing.",
 - "code": "email_missing",
 - "field": "dropoff.contact_email"
 
} 
] 
}, - "creation_date": "2021-07-13T13:16:23.016Z",
 - "confirmation_date": "2021-07-13T13:16:23.149Z",
 - "update_date": "2021-08-10T17:31:20.218Z",
 - "order_date": "2021-07-13T11:42:12.889Z",
 - "language": "en"
 
}