Change Date Of Deliveries

19. CHANGE DATE OF DELIVERIES

URL: https://app.detrack.com/api/v1/deliveries/change/date
HTTP POST REQUEST

Note: the request structure below is for Method #1: Name/Value Pair (NVP) + JSON String. For Method #2: Custom Header + JSON Body, please refer to the json parameter only.

Parameter Description
key Your API key. You can obtain this from your dashboard.
json

The JSON string containing the deliveries you wish to add. It should contain an array of deliveries with the following fields:

Field Description
date The current delivery date. Format: YYYY-MM-DD e.g. 2014-02-28. Optional. When the date is not provided, the system will search for the latest job with the given D.O. #.
do The D.O. #. This field must be unique for the date. Required field.
new_date The new delivery date. Format: YYYY-MM-DD e.g. 2014-02-30. Required field.
HTTP POST RESPONSE (JSON)
Field Description
info

Contains information on the status of the request.

Field Description
status The status of the request. The value will be “ok” if request is processed successfully or “failed” if the key or json parameter is missing.
failed The number of deliveries that are not changed due to error.
error

Contains the error details if the request failed. Note: this field is set only if the request failed.

Field Description
code The error code. Please refer to Delivery Error Codes
message The corresponding error message.
results

Contains an array of statuses with the following fields:

Field Description
date The date of the delivery. Format: YYYY-MM-DD e.g. 2014-02-28
do The D.O. # of the delivery.
status The status of the delivery change date request. The value will be “ok” if the delivery date is successfully changed or “failed” if the delivery date is not changed.
errors

Contains an array of error messages if the delivery change date request failed. Note: this field is set only if the delivery change date request failed.

Field Description
code The error code. Please refer to Delivery Error Codes
message The corresponding error message.
SAMPLE REQUEST JSON
[
   {
      "date":"2014-04-18",
      "do":"12345",
      "new_date":"2014-04-20"
   }
]
SAMPLE RESPONSE JSON #1
{
    "info":
        {
            "status":"ok",
            "failed":0
        },
    "results":
        [
            {
                "do":"12345",
                "status":"ok"
            }
        ]
}
SAMPLE RESPONSE JSON #2
{ 
    "info": 
        {
            "status": "ok", 
            "failed": 1 
        },
    "results":
        [ 
            { 
                "date": "2014-04-18",
                "do": "12345",
                "status": "failed",
                "errors":
                    [ 
                        {
                            "code": 1003,
                            "message": "Delivery with D.O. # 12345 not found on 2014-04-18." 
                        }
                    ]
            }
        ] 
}