Create Label

Creates a shipment in your Despatch Cloud account and will return a courier label.

Endpoint: https://YOUR-ACCOUNT-NAME.despatchcloud.co.uk/ws/v1/wsorders/create_shipment
Method: POST
 

Field Name  Required FormatNotes
order_idNoStringAutomatically generated if empty.
alt_idNoString 
shipping_name_companyNoString 
shipping_nameYesString 
shipping_address_line_oneYesString 
shipping_address_line_twoNoString 
shipping_address_cityYesString 
shipping_address_countyConditionalStringThis is required for certain countries, such as US or CA who have ISO 3166-2 codes for States (eg. Florida = FL, California = CA).
shipping_address_postcodeConditionalStringRequired in all cases, apart from countries such as IE where post/zip codes aren't mandatory, however, this may be courier specific.
shipping_address_isoYesStringISO 3166-2 code (eg. United Kingdom = GB, Germany = DE, France = FR, Japan = JP).
emailConditionalStringIf the courier service offers an email update service, they may insist this information is sent.
phone_oneConditionalStringIf the courier service offers an SMS update service, they may insist this information is sent. Alternatively, this may be used to contact the recipient in the event of an issue with delivery.
total_paidYesFloat/IntegerValue of the contents of the shipment.
payment_currencyYesStringISO 4217 code for the currency of the value of the shipment (eg. £ = GBP, € = EUR, $ = USD/CAD).
shipping_service_idYesIntegerShipping Rule ID of the shipping service you wish to use to ship the order.
weightYesFloat/IntegerWeight in kilograms. Can be submitted as a whole number or as a float to 3 decimal places (eg. 2kg // 1.998 kg).
valueYesFloat/IntegerValue of the individual parcel. Can be submitted as a whole number or as a float to 2 decimal places (eg. £2 // £1.99).
widthYesFloat/IntegerWidth in centimetres of the parcel. Can be submitted as a whole integer or as a float to 2 decimal places (eg. 30cm // 29.98cm).
lengthYesFloat/IntegerLength in centimetres of the parcel. Can be submitted as a whole integer or as a float to 2 decimal places (eg. 30cm // 29.98cm).
heightYesFloat/IntegerHeight in centimetres of the parcel. Can be submitted as a whole integer or as a float to 2 decimal places (eg. 30cm // 29.98cm).



Example Request (POST):

Copy{
  "order_id": "1234567890",
  "alt_id": "0987654321",
  "shipping_address": {
    "shipping_name_company": "Despatch Cloud Ltd",
    "shipping_name": "John Doe",
    "shipping_address_line_one": "Fake Street",
    "shipping_address_line_two": "Fake Area",
    "shipping_address_city": "Fakeville",
    "shipping_address_county": "Fakeshire",
    "shipping_address_country": "United Kingdom",
    "shipping_address_postcode": "FA11 1KE",
    "shipping_address_iso": "GB"
  },
  "contact": {
    "email": "[email protected]",
    "phone_one": "01234567890"
  },
  "payment": {
    "total_paid": "0.01",
    "payment_currency": "GBP"
  },
  "shipping_service_id": 119,
  "parcels": [
    {
      "weight": 3,
      "value": 25,
      "width": 30,
      "length": 20,
      "height": 10
    },
    {
      "weight": 3,
      "value": 25,
      "width": 30,
      "length": 20,
      "height": 10
    }
  ]
}


Example Response:

Copy{
  "status": "SUCCESS",
  "order_id": "1234567890",
  "despatch_cloud_ref": "DC-1570625609-435",
  "shipping_service": 219,
  "label_type": "pdf",
  "label": "QSBiYXNlLTY0IGVuY29kZWQgbGFiZWwgd2lsbCBhcHBlYXIgaGVyZSE=",
  "tracking_code": "12345678900987654321A",
  "service_code": null,
  "courier_name": "DPD"
}