Jobs
Reattempt a job
POST /dn/jobs/reattempt schedules a new attempt for a failed job. Requires do_number and returns the new attempt as a job.
POST
/
dn
/
jobs
/
reattempt
Reattempt a job
curl --request POST \
--url https://app.detrack.com/api/v2/dn/jobs/reattempt \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"data": {
"do_number": "DO-10001",
"date": "2026-09-15",
"type": "Delivery",
"new_date": "2026-09-17"
}
}
'import requests
url = "https://app.detrack.com/api/v2/dn/jobs/reattempt"
payload = { "data": {
"do_number": "DO-10001",
"date": "2026-09-15",
"type": "Delivery",
"new_date": "2026-09-17"
} }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
do_number: 'DO-10001',
date: '2026-09-15',
type: 'Delivery',
new_date: '2026-09-17'
}
})
};
fetch('https://app.detrack.com/api/v2/dn/jobs/reattempt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.detrack.com/api/v2/dn/jobs/reattempt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'do_number' => 'DO-10001',
'date' => '2026-09-15',
'type' => 'Delivery',
'new_date' => '2026-09-17'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.detrack.com/api/v2/dn/jobs/reattempt"
payload := strings.NewReader("{\n \"data\": {\n \"do_number\": \"DO-10001\",\n \"date\": \"2026-09-15\",\n \"type\": \"Delivery\",\n \"new_date\": \"2026-09-17\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.detrack.com/api/v2/dn/jobs/reattempt")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"do_number\": \"DO-10001\",\n \"date\": \"2026-09-15\",\n \"type\": \"Delivery\",\n \"new_date\": \"2026-09-17\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/jobs/reattempt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"do_number\": \"DO-10001\",\n \"date\": \"2026-09-15\",\n \"type\": \"Delivery\",\n \"new_date\": \"2026-09-17\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "5b22055510c92b1a046ece04",
"type": "Delivery",
"do_number": "DO-10001",
"date": "2026-09-15",
"status": "dispatched",
"primary_job_status": "dispatched",
"tracking_status": "Info received",
"attempt": 1,
"detrack_number": "DET2000001",
"tracking_number": "T0",
"order_number": "ORN12345678",
"address": "Singapore 470140",
"postal_code": "470140",
"deliver_to_collect_from": "James Li",
"phone_number": "65432178",
"notify_email": "test@example.com",
"items_count": 2,
"created_at": "2026-09-15T06:04:06.017Z",
"items": [
{
"id": "5b22055510c92b1a046ece05",
"sku": "12345678",
"description": "iPad",
"quantity": 10,
"checked": false
}
],
"milestones": [
{
"status": "info_recv",
"assign_to": null,
"reason": null,
"pod_at": "2026-09-15T06:04:06.017Z",
"created_at": "2026-09-15T06:04:06.017Z",
"user_name": "Simon"
}
]
}
}{
"code": "invalid_json_format"
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Could not find job with this DO number"
}{
"code": "conflict",
"message": "Could not acquire lock for this job"
}{
"code": "invalid_reattempt",
"message": "Job must be failed for reattempt"
}Use the Reattempt Job endpoint to schedule a new attempt for a job that could not be completed. The job must have failed or been partially completed; otherwise the API returns
For what
422 with the code invalid_reattempt.
You must provide the do_number. If several jobs share the DO number, add date and type to pick the right one; otherwise the most recent matching job is used. You can optionally set a new_date for the new attempt. If you leave it out, the new attempt is scheduled for today.
Point-to-point jobs are the exception. For these, the API updates the original job in place instead of creating a new one, and returns it with the same
id. The date only changes if you send new_date.status, primary_job_status, and tracking_status mean, see Status fields.
See also Retrieve job, Update job, and List jobs.Authorizations
Your Detrack API key, from Integrations > API Key in the dashboard.
Body
application/json
Show child attributes
Show child attributes
Response
The new attempt.
A delivery or collection job. Only the most-used fields are listed; the API returns more.
Show child attributes
Show child attributes
Reattempt a job
curl --request POST \
--url https://app.detrack.com/api/v2/dn/jobs/reattempt \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"data": {
"do_number": "DO-10001",
"date": "2026-09-15",
"type": "Delivery",
"new_date": "2026-09-17"
}
}
'import requests
url = "https://app.detrack.com/api/v2/dn/jobs/reattempt"
payload = { "data": {
"do_number": "DO-10001",
"date": "2026-09-15",
"type": "Delivery",
"new_date": "2026-09-17"
} }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: {
do_number: 'DO-10001',
date: '2026-09-15',
type: 'Delivery',
new_date: '2026-09-17'
}
})
};
fetch('https://app.detrack.com/api/v2/dn/jobs/reattempt', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.detrack.com/api/v2/dn/jobs/reattempt",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => [
'do_number' => 'DO-10001',
'date' => '2026-09-15',
'type' => 'Delivery',
'new_date' => '2026-09-17'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.detrack.com/api/v2/dn/jobs/reattempt"
payload := strings.NewReader("{\n \"data\": {\n \"do_number\": \"DO-10001\",\n \"date\": \"2026-09-15\",\n \"type\": \"Delivery\",\n \"new_date\": \"2026-09-17\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.detrack.com/api/v2/dn/jobs/reattempt")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"data\": {\n \"do_number\": \"DO-10001\",\n \"date\": \"2026-09-15\",\n \"type\": \"Delivery\",\n \"new_date\": \"2026-09-17\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.detrack.com/api/v2/dn/jobs/reattempt")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": {\n \"do_number\": \"DO-10001\",\n \"date\": \"2026-09-15\",\n \"type\": \"Delivery\",\n \"new_date\": \"2026-09-17\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "5b22055510c92b1a046ece04",
"type": "Delivery",
"do_number": "DO-10001",
"date": "2026-09-15",
"status": "dispatched",
"primary_job_status": "dispatched",
"tracking_status": "Info received",
"attempt": 1,
"detrack_number": "DET2000001",
"tracking_number": "T0",
"order_number": "ORN12345678",
"address": "Singapore 470140",
"postal_code": "470140",
"deliver_to_collect_from": "James Li",
"phone_number": "65432178",
"notify_email": "test@example.com",
"items_count": 2,
"created_at": "2026-09-15T06:04:06.017Z",
"items": [
{
"id": "5b22055510c92b1a046ece05",
"sku": "12345678",
"description": "iPad",
"quantity": 10,
"checked": false
}
],
"milestones": [
{
"status": "info_recv",
"assign_to": null,
"reason": null,
"pod_at": "2026-09-15T06:04:06.017Z",
"created_at": "2026-09-15T06:04:06.017Z",
"user_name": "Simon"
}
]
}
}{
"code": "invalid_json_format"
}{
"code": "invalid_key",
"message": "Invalid key"
}{
"code": "forbidden"
}{
"code": "not_found",
"message": "Could not find job with this DO number"
}{
"code": "conflict",
"message": "Could not acquire lock for this job"
}{
"code": "invalid_reattempt",
"message": "Job must be failed for reattempt"
}