CreateCollection
The function will allow for the creation of Branch Collections
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.
collection
customer_id(int) - Unique Customer Id in the PDM system. Required*.
external_customer_ref(string) - External Customer Reference. Required*. Max length = 50
external_collection_ref(string) - External Collection Reference. Max length = 50. Must be unique.
fridge(boolean) - Fridge. (true / false). Default to false if not supplied
controlled_collection(boolean) - Controlled Collection. (true / false). Default to false 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
location(string) - Location. Max length = 200
check_collection(boolean) - Check for another collection already scheduled this customer. (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",
"collection": {
"customer_id": 1408,
"external_customer_ref": "CUSTEXTREF165130",
"external_collection_ref": "COLEXTREF165130",
"fridge": true,
"controlled_collection": true,
"boxes": 2,
"items": [
{
"item_ref": "789",
"description": "CollectionItem1",
"quantity": 1,
"pack_size": "Medium"
},
{
"item_ref": "101",
"description": "CollectionItem2",
"quantity": 5,
"pack_size": "Small"
}
],
"notes": "Fragile",
"location": "Shelf B",
"check_collection": 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
collection
collection_id(int)
collection_ref(string) - Unique Delivery Reference with the format C######
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
405 = Collection already exists with same external_collection_ref
406 = Open collection already exists
500 = General service error
Example
{
"status": {
"code": 101,
"details": "OK"
},
"customer": {
"customer_id": 1408,
"customer_ref": "C001408",
"external_customer_ref": "EXTREF164736"
},
"collection": {
"collection_id": 245,
"collection_ref": "C000245"
}
}