Skip to main content

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.

ParameterTypeDescription
packingslipnostringSpecify the unique order number from your source system, that was used as the packing slip no when the order was published.
consigneestringRecepient name.
address1stringAddress line 1, eg, building identifier, like Level 1, Fisher House, etc.
address2stringAddress line 2, street name.
suburbstringSuburb name.
citystringCity name or state name. Depending on destination country, if state information is available, this should be the abbreviated state code.
postcodestringPost code, for NZ addresses, this can be left blank if unknown.
countrystringISO Alpha 2 country code, eg NZ, AU, US, UK, CN.
delvrefstringOrder number, or customer reference for this order.
delvinstructionsstringAny specific instructions to be printed on the label.
contactnamestringName of person, optional.
contactphonestringPhone number of person, optional.
emailstringEmail address for track & trace email, optional.
rawaddressstringFull, unvalidated address body for display purposes only. Use \n for newline in this field, optional.
costcentrestringPut the exact name of a cost centre here and the cost centre will be pre-selected when fulfilling the order, optional.
productsobject listOptional, JSON object of product.
packagesobject listOptional, JSON object of package.
iconUrlstringOptional, custom icon Url link.
dangerousgoodsarray of stringOptional, Array of string of Dangerous Goods Presets' descriptions, which are created in Ship.

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"
    }],
    "dangerousgoods":["DGPreset 1", "dgPreset 2"]
  },
  {
    "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"
  }
]
Last update: