Delete Deliveries

4. DELETE DELIVERIES

URL: https://app.detrack.com/api/v1/deliveries/delete.json
Limit: 100 deliveries per request (send separate requests if you are deleting more than 100 deliveries)
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 delete. It should contain an array with the following fields:

Field Description
date The delivery date. Format: YYYY-MM-DD e.g. 2014-02-28. Required field.
do The D.O. #. The D.O. # of the delivery to delete. 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 deleted 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 delete request. The value will be “ok” if the delivery is successfully deleted or “failed” if the delivery is not deleted.
errors Contains an array of error messages if the delivery delete request failed. Note: this field is set only if the delivery delete request failed.

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