Introduction
Welcome to the API documentation for Device Rescue. Our API provides a robust, secure, and efficient way to interact with endpoints to manage your account, submit retrieval requests and more.
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can create your Personal Access Token by visiting your profile and clicking Options > Create Token.
Device Retrievals
Create a new retrieval
requires authentication
This endpoint allows you to create a new retrieval requests for your employee.
You can specify whether to use the primary shipping information located in your company settings for the return location information, or provide a new address.
Product IDs: 1 for Laptop, 2 for Monitor, 3 for Tablet, 4 for Cellphone.
Insurance Option IDs: 0 for No Shipping Insurance, 1 for $1,000, 2 for $2,000, 3 for $3,000.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/v1/new-retrieval';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test',
'productID' => 1,
'insurance_option' => 1,
'employee_name' => 'John Doe',
'employee_email' => '[email protected]',
'employee_phone' => '1234567890',
'employee_address_line1' => '123 Main St',
'employee_address_line2' => 'Apartment 4',
'employee_city' => 'New York',
'employee_state' => 'NY',
'employee_zip' => '10001',
'use_primary_address' => false,
'return_name' => 'Jane Smith',
'return_email' => '[email protected]',
'return_phone' => '0987654321',
'return_address_line1' => '456 Elm Street',
'return_address_line2' => 'Suite 5',
'return_city' => 'Los Angeles',
'return_state' => 'CA',
'return_zip' => '90001',
'company_is_residential' => false,
'note' => 'Please do not send until 12-1-2023.',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://app.devicerescue.com/api/v1/new-retrieval" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test\",
\"productID\": 1,
\"insurance_option\": 1,
\"employee_name\": \"John Doe\",
\"employee_email\": \"[email protected]\",
\"employee_phone\": \"1234567890\",
\"employee_address_line1\": \"123 Main St\",
\"employee_address_line2\": \"Apartment 4\",
\"employee_city\": \"New York\",
\"employee_state\": \"NY\",
\"employee_zip\": \"10001\",
\"use_primary_address\": false,
\"return_name\": \"Jane Smith\",
\"return_email\": \"[email protected]\",
\"return_phone\": \"0987654321\",
\"return_address_line1\": \"456 Elm Street\",
\"return_address_line2\": \"Suite 5\",
\"return_city\": \"Los Angeles\",
\"return_state\": \"CA\",
\"return_zip\": \"90001\",
\"company_is_residential\": false,
\"note\": \"Please do not send until 12-1-2023.\"
}"
const url = new URL(
"https://app.devicerescue.com/api/v1/new-retrieval"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test",
"productID": 1,
"insurance_option": 1,
"employee_name": "John Doe",
"employee_email": "[email protected]",
"employee_phone": "1234567890",
"employee_address_line1": "123 Main St",
"employee_address_line2": "Apartment 4",
"employee_city": "New York",
"employee_state": "NY",
"employee_zip": "10001",
"use_primary_address": false,
"return_name": "Jane Smith",
"return_email": "[email protected]",
"return_phone": "0987654321",
"return_address_line1": "456 Elm Street",
"return_address_line2": "Suite 5",
"return_city": "Los Angeles",
"return_state": "CA",
"return_zip": "90001",
"company_is_residential": false,
"note": "Please do not send until 12-1-2023."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (202, Accepted):
{
"Message": "Success",
"Retrieval ID": 2355
}
Example response (402, Payment Required):
{
"Error": "Unable to reduce credit amount from your account or charge your default card on file."
}
Example response (405, Method Not Allowed):
{
"Error": "Invalid mode - Please declare if it is production [prod] or test [test]."
}
}
}
Example response (422, validation error):
{
"Message": "The given data was invalid.",
"errors": {
"productID": ["The product id field is required."],
// Other validation errors
}
Example response (426, Upgrade Required):
{
"Message": "Your subscription does not allow access to this resource. Please upgrade your plan to utilize API resources."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get All Retrievals
requires authentication
This endpoint allows you to fetch all your retrievals in your account.
Results will show 15 per page.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/v1/retrievals';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'page' => '1',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/v1/retrievals" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"page\": \"1\"
}"
const url = new URL(
"https://app.devicerescue.com/api/v1/retrievals"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"page": "1"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, OK):
{
"current_page": 1,
"data": [
{}
],
"first_page_url": "https://app.devicerescue.io/api/v1/retrievals?page=1",
"from": 1,
"last_page": 3,
"last_page_url": "https://app.devicerescue.io/api/v1/retrievals?page=3",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "https://app.devicerescue.io/api/v1/retrievals?page=1",
"label": "1",
"active": true
},
{
"url": "https://app.devicerescue.io/api/v1/retrievals?page=2",
"label": "2",
"active": false
},
{
"url": "https://app.devicerescue.io/api/v1/retrievals?page=3",
"label": "3",
"active": false
}
],
"next_page_url": "https://app.devicerescue.io/api/v1/retrievals?page=2",
"path": "https://app.devicerescue.io/api/v1/retrievals",
"per_page": 15,
"prev_page_url": null,
"to": 15,
"total": 42
}
Example response (426, Upgrade Required):
{
"Message": "Your subscription does not allow access to this resource. Please upgrade your plan to utilize API resources."
}
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Retrieval Information
requires authentication
This endpoint allows you to view your retrieval details along with shipping status.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/v1/retrieval';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'retrieval_id' => '1867',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/v1/retrieval" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"retrieval_id\": \"1867\"
}"
const url = new URL(
"https://app.devicerescue.com/api/v1/retrieval"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"retrieval_id": "1867"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, OK):
{
"retrievalID": 1867,
"retrieval_box": 4,
"employee_name": "Tyler Retrieve",
"employee_email": "[email protected]",
"employee_phone": "(871) 239-0019",
"employee_address_line1": "123 tester Ave",
"employee_address_line2": "Unit 3",
"employee_city": "Athol",
"employee_state": "VT",
"employee_zip": "82341",
"carrier": FedEx,
"ship_date": 06/09/2023,
"tracking_number": 794644565444,
"tracking_url": https://track.easypost.com/djE6dHJrX2Q1MzY2OThjYzNlMzQ3NTE5ZDc4YjVjNzM2OTNiY2Mw,
"shipping_status": "delivered",
"delivery_date_to_employee": 06/12/2023,
"return_name": "Tyler Okland",
"return_email": "[email protected]",
"return_phone": "(877) 418-2088",
"return_address_line1": "784 S Clearwater Loop",
"return_address_line2": "STE 5250",
"return_city": "Post Falls",
"return_state": "ID",
"return_zip": "83854",
"company_is_residential": 0,
"return_carrier": FedEx,
"return_tracking_number": 794644565341,
"return_tracking_url": https://track.easypost.com/djE6dHJrX2NkZjUyNzcyODg3ODQ0MDg5ODMyYjAxNWJlZTdiNzZl,
"return_shipping_status": "pre_transit",
"return_delivery_date": 06/12/2023,
"insurance_option": "No Shipping Insurance",
"device": "e73ec4e5-f4a9-4093-ac33-64209681355e",
"created_by": 62,
"created_at": "2023-12-16T06:10:01.000000Z",
"updated_at": "12/17/23 05:27 AM"
}
Example response (401, Unauthorized):
{
"message": "Unauthenticated."
}
Example response (404, Not Found):
{
"message": "Retrieval not found"
}
Example response (412, Precondition Failed):
{
"message": "Invalid retrieval ID"
}
}
}
Example response (426, Upgrade Required):
{
"Message": "Your subscription does not allow access to this resource. Please upgrade your plan to utilize API resources."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Resellers
APIs for managing reseller operations. To utilize these api calls, you must be registered as an Authorized Reseller for Device Rescue.
GET All Retrieval Products
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/products';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/reseller/products" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/products"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"retrieval_type_id": 1,
"name": "Laptop",
"description": This padded laptop box is shipped to your employee with a prepaid self-stick return label, easy packing / shipping instructions, and tape. Padded laptop box fits most laptops up to 16″ and charger (or other charger-sized accessories) in the appropriate tray. Please be aware, minimum supported device dimensions: 11″ x 7″ x 0.5″ and maximum supported device dimensions are 15.125″ x 10.25″ x 1″. Accessories tray dimensions: 15.75″ x 3.5″ x 1.5″ (accessories tray is not padded).,
"featured_image": https://devicerescue-production.s3.amazonaws.com/20231005191503/epe-laptop-box-device-rescue-min.jpeg,
"dimensions": {
"length": 18,
"width": 12,
"height": 4
},
"pricing": {
"msrp": "89.00",
"reseller_cost": "REDACTED"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET All Insurance Options
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/insurance-options';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/reseller/insurance-options" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/insurance-options"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"insurance_type_id": 1,
"name": "No Shipping Insurance",
"is_popular": false,
"pricing": {
"msrp": 0,
"reseller_cost": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET All Carrier Options
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/carrier-options';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/reseller/carrier-options" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/carrier-options"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"carrier_type_id": 1,
"name": "USPS",
"retrieval_product": "Laptop",
"description": "Your employee will receive the delivery within 2-5 business days. Once your employee ships the device back, it will take an additional 2-5 business days to reach your provided address.",
"pricing": {
"msrp": 0,
"reseller_cost": 0
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET All Retrieval History
requires authentication
Retrieve all retrieval histories associated with the authenticated reseller.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/retrieval-history';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/reseller/retrieval-history" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/retrieval-history"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 123,
"retrieval_type": "Tablet",
"admin_status": null,
"merged_into": null,
"origin": {
"full_name": "John Doe",
"phone": "1234567890",
"email": "[email protected]",
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "Metropolis",
"state": "NY",
"zip": "10101"
},
"shipment_status": "awaiting_shipment",
"carrier": null,
"carrier_service": "Priority",
"tracking_url": null,
"tracking_number": null,
"shipped_date": null,
"delivered_date": null
},
"destination": {
"company": "Example Corp",
"attn_name": "Jane Smith",
"phone": "0987654321",
"email": "[email protected]",
"address": {
"line1": "456 Elm St",
"line2": "Apt 202",
"city": "Gotham",
"state": "CA",
"zip": "20202",
"is_residential": true
},
"shipment_status": "awaiting_shipment",
"carrier": null,
"carrier_service": "Priority",
"tracking_url": null,
"tracking_number": null,
"delivered_date": null
},
"insurance": {
"option": "No Shipping Insurance"
},
"created_at": "2024-04-28 23:21:30",
"updated_at": "04/28/24 11:21 PM"
},
],
"links": {
"first": "https://app.devicerescue.com/api/reseller/retrieval-history?page=1",
"last": "https://app.devicerescue.com/api/reseller/retrieval-history?page=5",
"prev": null,
"next": "https://app.devicerescue.com/api/reseller/retrieval-history?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 5,
"path": "https://app.devicerescue.com/api/reseller/retrieval-history",
"per_page": 10,
"to": 10,
"total": 50
}
}
Example response (403):
{
"message": "Unauthorized action."
}
Example response (404):
{
"message": "No associated reseller found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Retrieval History
requires authentication
Retrieve a specific retrieval history associated with the authenticated reseller by passing the retrieval_id.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/retrieval-history/1267';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/reseller/retrieval-history/1267" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/retrieval-history/1267"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": {
"id": 1267,
"retrieval_type": "Tablet",
"admin_status": null,
"merged_into": null,
"origin": {
"full_name": "John Doe",
"phone": "1234567890",
"email": "[email protected]",
"address": {
"line1": "123 Main St",
"line2": "Suite 101",
"city": "Metropolis",
"state": "NY",
"zip": "10101"
},
"shipment_status": null,
"carrier": null,
"carrier_service": "Priority",
"tracking_url": null,
"tracking_number": null,
"shipped_date": null,
"delivered_date": null
},
"destination": {
"company": "Example Corp",
"attn_name": "Jane Smith",
"phone": "0987654321",
"email": "[email protected]",
"address": {
"line1": "456 Elm St",
"line2": "Apt 202",
"city": "Gotham",
"state": "CA",
"zip": "20202",
"is_residential": true
},
"shipment_status": null,
"carrier": null,
"carrier_service": "Priority",
"tracking_url": null,
"tracking_number": null,
"delivered_date": null
},
"insurance": {
"option": "No Shipping Insurance"
},
"created_at": "2024-04-28 23:22:51",
"updated_at": "04/28/24 11:22 PM"
}
}
Example response (403):
{
"message": "Unauthorized action."
}
Example response (404):
{
"message": "No associated reseller found."
}
Example response (404):
{
"message": "Retrieval history not found."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
PATCH Retrieval Request
requires authentication
This endpoint allows for the modification of retrieval history details associated with a given retrieval_id
aka confirmation number.
The request must specify the mode ('test' or 'production') and provide detailed information about both the origin and the destination.
Updates can only be made if shipping labels have not yet been generated. Device Rescue typically generates shipping labels within one hour of receiving retrieval requests, in preparation for same-day or next business day carrier pickups.
Webhooks can be set up to receive notifications. When information is updated, webhooks will be triggered, sending out the updated information.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/retrieval-history/12345';
$response = $client->patch(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test',
'origin' => [
'full_name' => 'John Doe',
'phone_number' => '1234567890',
'email' => '[email protected]',
'address' => [
'line_1' => '123 Main St',
'line_2' => 'Apt 4',
'city' => 'New York',
'state' => 'NY',
'zipcode' => '10001',
],
],
'destination' => [
'company' => 'Example Inc',
'attn_name' => 'Jane Doe',
'phone_number' => '0987654321',
'email' => '[email protected]',
'address' => [
'line_1' => '456 Elm St',
'line_2' => 'Suite 5',
'city' => 'Chicago',
'state' => 'IL',
'zipcode' => '60601',
'is_residential' => true,
],
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
"https://app.devicerescue.com/api/reseller/retrieval-history/12345" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test\",
\"origin\": {
\"full_name\": \"John Doe\",
\"phone_number\": \"1234567890\",
\"email\": \"[email protected]\",
\"address\": {
\"line_1\": \"123 Main St\",
\"line_2\": \"Apt 4\",
\"city\": \"New York\",
\"state\": \"NY\",
\"zipcode\": \"10001\"
}
},
\"destination\": {
\"company\": \"Example Inc\",
\"attn_name\": \"Jane Doe\",
\"phone_number\": \"0987654321\",
\"email\": \"[email protected]\",
\"address\": {
\"line_1\": \"456 Elm St\",
\"line_2\": \"Suite 5\",
\"city\": \"Chicago\",
\"state\": \"IL\",
\"zipcode\": \"60601\",
\"is_residential\": true
}
}
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/retrieval-history/12345"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test",
"origin": {
"full_name": "John Doe",
"phone_number": "1234567890",
"email": "[email protected]",
"address": {
"line_1": "123 Main St",
"line_2": "Apt 4",
"city": "New York",
"state": "NY",
"zipcode": "10001"
}
},
"destination": {
"company": "Example Inc",
"attn_name": "Jane Doe",
"phone_number": "0987654321",
"email": "[email protected]",
"address": {
"line_1": "456 Elm St",
"line_2": "Suite 5",
"city": "Chicago",
"state": "IL",
"zipcode": "60601",
"is_residential": true
}
}
};
fetch(url, {
method: "PATCH",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200, success):
{
"retrieval_id": "12345"
"message": "Retrieval information updated for this request. If you have webhooks setup, we'll send a webhook with the updated information",
}
Example response (404, not found):
{
"message": "Retrieval history not found. Please check the retrieval ID and try again."
}
Example response (409, conflict):
{
"message": "Cannot update retrieval information. We have already generated shipping labels for this retrieval."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST Create New Retrieval
requires authentication
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/create/retrieval';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'retrieval_type_id' => 1,
'insurance_type_id' => 1,
'carrier_service' => 1,
'origin' => [
'full_name' => 'John Doe',
'phone_number' => '1234567890',
'email' => '[email protected]',
'address' => [
'line_1' => '123 Main St',
'line_2' => 'Apt 101',
'city' => 'New York',
'state' => 'NY',
'zipcode' => '10001',
],
],
'destination' => [
'company' => 'ABC Corp',
'attn_name' => 'Jane Smith',
'phone_number' => '9876543210',
'email' => '[email protected]',
'address' => [
'line_1' => '456 Park Ave',
'line_2' => 'Suite 200',
'city' => 'Los Angeles',
'state' => 'CA',
'zipcode' => '90001',
'is_residential' => true,
],
],
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://app.devicerescue.com/api/reseller/create/retrieval" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"retrieval_type_id\": 1,
\"insurance_type_id\": 1,
\"carrier_service\": 1,
\"origin\": {
\"full_name\": \"John Doe\",
\"phone_number\": \"1234567890\",
\"email\": \"[email protected]\",
\"address\": {
\"line_1\": \"123 Main St\",
\"line_2\": \"Apt 101\",
\"city\": \"New York\",
\"state\": \"NY\",
\"zipcode\": \"10001\"
}
},
\"destination\": {
\"company\": \"ABC Corp\",
\"attn_name\": \"Jane Smith\",
\"phone_number\": \"9876543210\",
\"email\": \"[email protected]\",
\"address\": {
\"line_1\": \"456 Park Ave\",
\"line_2\": \"Suite 200\",
\"city\": \"Los Angeles\",
\"state\": \"CA\",
\"zipcode\": \"90001\",
\"is_residential\": true
}
},
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/create/retrieval"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"retrieval_type_id": 1,
"insurance_type_id": 1,
"carrier_service": 1,
"origin": {
"full_name": "John Doe",
"phone_number": "1234567890",
"email": "[email protected]",
"address": {
"line_1": "123 Main St",
"line_2": "Apt 101",
"city": "New York",
"state": "NY",
"zipcode": "10001"
}
},
"destination": {
"company": "ABC Corp",
"attn_name": "Jane Smith",
"phone_number": "9876543210",
"email": "[email protected]",
"address": {
"line_1": "456 Park Ave",
"line_2": "Suite 200",
"city": "Los Angeles",
"state": "CA",
"zipcode": "90001",
"is_residential": true
}
},
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (201):
{
"retrieval_id": 2017,
"message": "Retrieval successfully submitted, we'll begin processing this within 1 business day."
}
Example response (402):
{
"message": "Transaction Declined: Unable to deduct amount from your wallet balance."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GET Fetch Notes
requires authentication
Allows you to fetch notes for retrievals for a specific retrieval_id.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/retrieval/notes/1267';
$response = $client->get(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
--get "https://app.devicerescue.com/api/reseller/retrieval/notes/1267" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/retrieval/notes/1267"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production"
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"data": [
{
"id": 1,
"note": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
"added_by": "Device Rescue",
"created_at": "2024-04-28 23:23:06"
},
{
"id": 2,
"note": "Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"added_by": "Device Rescue",
"created_at": "2024-04-28 23:23:06"
},
],
"links": {
"first": "https://app.devicerescue.com/api/reseller/retrieval/notes/1267?page=1",
"last": "https://app.devicerescue.com/api/reseller/retrieval/notes/1267?page=2",
"prev": null,
"next": "https://app.devicerescue.com/api/reseller/retrieval/notes/1267?page=2"
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 2,
"path": "https://app.devicerescue.com/api/reseller/retrieval/notes/1267",
"per_page": 10,
"to": 10,
"total": 15
}
}
Example response (403):
{
"message": "Unauthorized action."
}
Example response (404):
{
"message": "No associated reseller found."
}
Example response (404):
{
"message": "No notes found for the specified retrieval ID."
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST Create Retrieval Note
requires authentication
Allows you to create a new note on your retrivals submitted to us.
Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://app.devicerescue.com/api/reseller/retrieval/notes/illum';
$response = $client->post(
$url,
[
'headers' => [
'Authorization' => 'Bearer {YOUR_AUTH_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'mode' => 'test. Allowed values: test, production',
'note' => 'Hello World.',
'added_by' => 'John Smith.',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
"https://app.devicerescue.com/api/reseller/retrieval/notes/illum" \
--header "Authorization: Bearer {YOUR_AUTH_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"mode\": \"test. Allowed values: test, production\",
\"note\": \"Hello World.\",
\"added_by\": \"John Smith.\"
}"
const url = new URL(
"https://app.devicerescue.com/api/reseller/retrieval/notes/illum"
);
const headers = {
"Authorization": "Bearer {YOUR_AUTH_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"mode": "test. Allowed values: test, production",
"note": "Hello World.",
"added_by": "John Smith."
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"id": 1,
"name": "Hello World!",
"added_by": "Device Rescue",
"created_at": "2024-04-29 00:12:03"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.