CreateDelivery

The function will allow for the creation of Deliveries.

POST body(JSON):

company_id(int) - Unique Company Id in the PDM system. Required.
session_token(string) - Session Token valid for finite period of time (See expiry date/time). Issued by the GetSession API call.
delivery
    customer_id(int) - Unique Customer Id in the PDM system. Required*.
    external_customer_ref(string) - External Customer Reference. Required*. Max length = 50
    external_delivery_ref(string) - External Delivery Reference. Max length = 50. Must be unique.
    fridge(boolean) - Fridge. (true / false). Default to false if not supplied
    controlled_delivery(boolean) - Controlled Delivery. (true / false). Default to false if not supplied
    delivery_date(string) - Delivery Date. Format YYYY-MM-DD. Default to next day if not supplied
    boxes(int) - Number of boxes. Must be greater than zero
    items(array)
        item_ref(string) - Item Reference. Max length = 50
        description(string) - Item Description. Max length = 150. Required
        quantity(int) - Item Quantity. Must be greater than zero. Required
        pack_size(string) - Pack Size. Max length = 50
    notes(string) - Notes. Max length = 250
    check_delivery(boolean) - Check for deliveries already scheduled on this date for this customer and raise status 404 if so. (true / false)

*either customer_id or external_customer_ref are required, but not both. If both are provided, both will be tried starting with customer_id and using first match.

Example

{
"company_id": 9001,
"session_token": "9001|85d1c76d-5088-4cbe-a681-f3a86594dac9|0001",
"delivery": {
"customer_id": 1408,
"external_customer_ref": "CUSTEXTREF165128",
"external_delivery_ref": "DELEXTREF165128",
"fridge": true,
"controlled_delivery": true,
"boxes": 2,
"items": [
{
"item_ref": "123",
"description": "Item1",
"quantity": 1,
"pack_size": "Medium"
},
{
"item_ref": "456",
"description": "Item2",
"quantity": 5,
"pack_size": "Small"
}
],
"notes": "Fragile",
"check_delivery": false
}
}

Response(JSON):

status
    code(int) - See status codes
    details(string) - Response details
customer 
    customer_id(int) - Unique Customer Id from the PDM system
    customer_ref(string) - Unique Customer Reference with the format C######
    external_customer_ref(string) - External Customer Reference
delivery
    delivery_id(int)
    delivery_ref(string) - Unique Delivery Reference with the format D######
    tracking_link(string)

 

Response status codes:

101 = OK
201 = Invalid / inactive company ID
202 = Invalid session token
203 = Session token expired
204 = IP address not approved
205 = Rate limit exceeded
301 = Required data missing(list fields in status details)
302 = Data exceeded parameters(list fields in status details)
303 = Incorrect data type(list fields in status details)
401 = No matching customer found
403 = Delivery already exists with same external_delivery_ref
404 = Delivery already scheduled on this date
500 = General service error

Example

{ 
"status": {
"code": 101,
"details": "OK"
},
"customer": {
"customer_id": 1408,
"customer_ref": "C001408",
"external_customer_ref": "EXTREF164736"
},
"delivery": {
"delivery_id": 2945,
"delivery_ref": "D002945",
"tracking_link": ""
}
}