Create Order

Creates a new order in Despatch Cloud and returns a success or failure message as well as the order id of the order created.

This API call can be used to create both manual orders and orders linked to a sales channel setup in Despatch Cloud.

Endpoint: https://app.despatch.cloud/YOUR-ACCOUNT-NAME/ws/v1/wsorders/create_order/
Method: POST
 
Field Name  Required FormatNotes
order_idNoStringAutomatically generated if empty.
date_receivedNoUnix Time Stamp Automatically generated if empty.
sales_channelNoStringMust be a valid sales channel, Automatically set to manual if empty. 
statusNoInteger1 = Draft / 3 = Ready
invoice_name_companyNoString 
invoice_nameNoString 
invoice_address_line_oneNoString 
invoice_address_line_twoNoString 
invoice_address_cityNoString 
invoice_address_countyNoString 
invoice_address_countryNoString 
invoice_address_postcodeNoString 
invoice_address_isoNoString 
shipping_name_companyNoString 
shipping_nameNoString 
shipping_address_line_oneNoString 
shipping_address_line_twoNoString 
shipping_address_cityNoString 
shipping_address_countyNoString 
shipping_address_countryNoString 
shipping_address_postcodeNoString 
shipping_address_isoNoString 
emailNoString 
phone_oneNoString 
phone_twoNoString 
total_paidNoString 
tax_paidNoString 
shipping_paidNoString 
payment_methodNoString 
payment_refNoString 
payment_currencyNoString 
shipping_method_requested NoString 
customer_commentsNoString 
staff_notesNoString 


Example Request (POST):
CopyCopyCopy{
   "order_id":"123456789-9",
   "date_received":1529939182,
   "sales_channel":"manual",
   "status":3,
   "invoice_address":{
      "invoice_name_company":"Despatch Cloud Ltd",
      "invoice_name":"John Smith",
      "invoice_address_line_one":"Unit 76",
      "invoice_address_line_two":"Warfield Road",
      "invoice_address_city":"Kellythorpe",
      "invoice_address_county":"East Yorkshire",
      "invoice_address_country":"United Kingdom",
      "invoice_address_postcode":"YO25 9DJ",
      "invoice_address_iso":"GB"
   },
   "shipping_address":{
      "shipping_name_company":"Despatch Cloud Ltd",
      "shipping_name":"John Smith",
      "shipping_address_line_one":"Unit 76",
      "shipping_address_line_two":"Warfield Road",
      "shipping_address_city":"Kellythorpe",
      "shipping_address_county":"East Yorkshire",
      "shipping_address_country":"United Kingdom",
      "shipping_address_postcode":"YO25 9DJ",
      "shipping_address_iso":"GB"
   },
   "contact":{
      "email":"[email protected]",
      "phone_one":"01377455180",
      "phone_two":""
   },
   "payment":{
      "total_paid":"22.99",
      "tax_paid":"0.00",
      "shipping_paid":"2.99",
      "payment_method":"Test",
      "payment_ref":"TEST0001",
      "payment_currency":"GBP"
   },
   "shipping":{
      "shipping_method_requested":"UKMail Next Day"
   },
   "comments":{
      "customer_comments":"Please leave parcel next door if not in.",
      "staff_notes":"This order was created using the Despatch Cloud Web Service."
   }
}

Example Response:
CopyCopyCopy{"status":"SUCCESS","order_id":"123456789-9"}