api/customerorders
About 2 min
api/customerorders
Description
Submit new customer order batched. Saves a new orders or updates a pending order. If the packing slip number has already been processed, the message will be ignored. This method will accept orders as a array.
Request
- Method:
PUT
- Content Type:
application/json
- URL:
https://api.gosweetspot.com/api/customerorders
Headers
- access_key : your unqiue api key provided by GSS.
- site_id : which site you are requesting action for.
Parameters
The body of the message should be sent as an JSON array.
Parameter | Type | Description |
---|---|---|
packingslipno | string | Specify the unique order number from your source system, that was used as the packing slip no when the order was published. |
consignee | string | Recepient name. |
address1 | string | Address line 1, eg, building identifier, like Level 1, Fisher House, etc. |
address2 | string | Address line 2, street name. |
suburb | string | Suburb name. |
city | string | City name or state name. Depending on destination country, if state information is available, this should be the abbreviated state code. |
postcode | string | Post code, for NZ addresses, this can be left blank if unknown. |
country | string | ISO Alpha 2 country code, eg NZ, AU, US, UK, CN. |
delvref | string | Order number, or customer reference for this order. |
delvinstructions | string | Any specific instructions to be printed on the label. |
contactname | string | Name of person, optional. |
contactphone | string | Phone number of person, optional. |
string | Email address for track & trace email, optional. | |
rawaddress | string | Full, unvalidated address body for display purposes only. Use \n for newline in this field, optional. |
costcentre | string | Put the exact name of a cost centre here and the cost centre will be pre-selected when fulfilling the order, optional. |
products | object list | Optional, JSON object of product. |
packages | object list | Optional, JSON object of package. |
iconUrl | string | Optional, custom icon Url link. |
Return format
JSON object array per order with true for a successfult submit or false for an ignored submit.
Request example
curl --location --request PUT 'https://api.gosweetspot.com/api/customerorders' \
--header 'access_key;' \
--header 'site_id;' \
--header 'Content-Type: application/json' \
--data '[
{
"packingslipno": "test1-14-07-01",
"consignee": "Test 1",
"address1": "1 Queens Street",
"address2": "",
"suburb": "Auckland Central",
"city": "Auckland",
"postcode": "",
"country": null,
"delvref": null,
"delvinstructions": null,
"contactname": null,
"contactphone": null,
"email": null,
"iconUrl": null,
"Products": [{
"productcode": "ABC",
"Description": "Wall Paint",
"Units": 1.0,
"UnitValue": 10.0,
"CountryofManufacture": null,
"UnitKg": 1.0,
"ImageUrl": null,
"Currency": "NZD"
}, {
"productcode": "DCF",
"Description": "Wall Art",
"Units": 1.0,
"UnitValue": 10.0,
"CountryofManufacture": null,
"UnitKg": 1.0,
"ImageUrl": null,
"Currency": "NZD"
}]
},
{
"packingslipno": "test2-14-07-01",
"consignee": "Test 2",
"address1": "1 Queens Street",
"address2": "",
"suburb": "Auckland Central",
"city": "Auckland",
"postcode": "",
"country": null,
"delvref": null,
"delvinstructions": null,
"contactname": null,
"contactphone": null,
"email": null
}
]'
Response example
[
{
"packingslipno": "test1-14-07-01",
"result": true,
"msg":""
},
{
"packingslipno": "test2-14-07-01",
"result": false,
"msg":"already processed"
}
]