Chronopost France Tracking API
Create a tracking
Creates a new tracking object.
Parameters
tracking_numberstring required
Tracking number of a shipment. Duplicated tracking numbers, tracking numbers with invalid tracking number format will not be accepted.
Only accept tracking numbers with length from 4 to 100slugstring, staticchronopost-france.titlestring
By default this field shows thetracking_number, but you can customize it as you wish with any info (e.g. the order number).order_idstring
A globally-unique identifier for the order.order_promised_delivery_datestring
The promised delivery date of the order. It uses the formatYYYY-MM-DD. This has no timezone and uses whatever date you provide. Since other EDDs use the shipment recipient’s timezone, we suggest following the same logic here.
Returns
Return a tracking object if the call succeeded.
curl --request POST \
--url https://api.aftership.com/tracking/2024-04/trackings \
--header 'Content-Type: application/json'\
--data '{"tracking":{"slug":"chronopost-france","title":"Title Name","smses":["+18555072509","+18555072501"],"emails":["[email protected]","[email protected]"],"order_id":"ID 1234","language":"en","pickup_note":"Reach out to our staffs when you arrive our stores for shipment pickup","origin_city":"Beijing","order_number":"1234","origin_state":"Beijing","order_id_path":"http://www.aftership.com/order_id=1234","custom_fields":{"product_name":"iPhone Case","product_price":"USD19.99"},"delivery_type":"pickup_at_store","tracking_number":"123456789","pickup_location":"Flagship Store","destination_city":"New York City","destination_state":"New York","origin_postal_code":"065001","origin_country_iso3":"CHN","origin_raw_location":"Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China","destination_postal_code":"10001","destination_country_iso3":"USA","destination_raw_location":"13th Street, New York, NY, 10011, USA, United States","order_promised_delivery_date":"2019-05-20"}}'const url = 'https://api.aftership.com/tracking/2024-04/trackings';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"tracking\":{\"slug\":\"chronopost-france\",\"title\":\"Title Name\",\"smses\":[\"+18555072509\",\"+18555072501\"],\"emails\":[\"[email protected]\",\"[email protected]\"],\"order_id\":\"ID 1234\",\"language\":\"en\",\"pickup_note\":\"Reach out to our staffs when you arrive our stores for shipment pickup\",\"origin_city\":\"Beijing\",\"order_number\":\"1234\",\"origin_state\":\"Beijing\",\"order_id_path\":\"http://www.aftership.com/order_id=1234\",\"custom_fields\":{\"product_name\":\"iPhone Case\",\"product_price\":\"USD19.99\"},\"delivery_type\":\"pickup_at_store\",\"tracking_number\":\"123456789\",\"pickup_location\":\"Flagship Store\",\"destination_city\":\"New York City\",\"destination_state\":\"New York\",\"origin_postal_code\":\"065001\",\"origin_country_iso3\":\"CHN\",\"origin_raw_location\":\"Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China\",\"destination_postal_code\":\"10001\",\"destination_country_iso3\":\"USA\",\"destination_raw_location\":\"13th Street, New York, NY, 10011, USA, United States\",\"order_promised_delivery_date\":\"2019-05-20\"}}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/trackings"
payload := strings.NewReader("{\"tracking\":{\"slug\":\"chronopost-france\",\"title\":\"Title Name\",\"smses\":[\"+18555072509\",\"+18555072501\"],\"emails\":[\"[email protected]\",\"[email protected]\"],\"order_id\":\"ID 1234\",\"language\":\"en\",\"pickup_note\":\"Reach out to our staffs when you arrive our stores for shipment pickup\",\"origin_city\":\"Beijing\",\"order_number\":\"1234\",\"origin_state\":\"Beijing\",\"order_id_path\":\"http://www.aftership.com/order_id=1234\",\"custom_fields\":{\"product_name\":\"iPhone Case\",\"product_price\":\"USD19.99\"},\"delivery_type\":\"pickup_at_store\",\"tracking_number\":\"123456789\",\"pickup_location\":\"Flagship Store\",\"destination_city\":\"New York City\",\"destination_state\":\"New York\",\"origin_postal_code\":\"065001\",\"origin_country_iso3\":\"CHN\",\"origin_raw_location\":\"Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China\",\"destination_postal_code\":\"10001\",\"destination_country_iso3\":\"USA\",\"destination_raw_location\":\"13th Street, New York, NY, 10011, USA, United States\",\"order_promised_delivery_date\":\"2019-05-20\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/trackings"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"tracking\":{\"slug\":\"chronopost-france\",\"title\":\"Title Name\",\"smses\":[\"+18555072509\",\"+18555072501\"],\"emails\":[\"[email protected]\",\"[email protected]\"],\"order_id\":\"ID 1234\",\"language\":\"en\",\"pickup_note\":\"Reach out to our staffs when you arrive our stores for shipment pickup\",\"origin_city\":\"Beijing\",\"order_number\":\"1234\",\"origin_state\":\"Beijing\",\"order_id_path\":\"http://www.aftership.com/order_id=1234\",\"custom_fields\":{\"product_name\":\"iPhone Case\",\"product_price\":\"USD19.99\"},\"delivery_type\":\"pickup_at_store\",\"tracking_number\":\"123456789\",\"pickup_location\":\"Flagship Store\",\"destination_city\":\"New York City\",\"destination_state\":\"New York\",\"origin_postal_code\":\"065001\",\"origin_country_iso3\":\"CHN\",\"origin_raw_location\":\"Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China\",\"destination_postal_code\":\"10001\",\"destination_country_iso3\":\"USA\",\"destination_raw_location\":\"13th Street, New York, NY, 10011, USA, United States\",\"order_promised_delivery_date\":\"2019-05-20\"}}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/tracking/2024-04/trackings', headers=headers, json={"tracking":{"slug":"chronopost-france","title":"Title Name","smses":["+18555072509","+18555072501"],"emails":["[email protected]","[email protected]"],"order_id":"ID 1234","language":"en","pickup_note":"Reach out to our staffs when you arrive our stores for shipment pickup","origin_city":"Beijing","order_number":"1234","origin_state":"Beijing","order_id_path":"http://www.aftership.com/order_id=1234","custom_fields":{"product_name":"iPhone Case","product_price":"USD19.99"},"delivery_type":"pickup_at_store","tracking_number":"123456789","pickup_location":"Flagship Store","destination_city":"New York City","destination_state":"New York","origin_postal_code":"065001","origin_country_iso3":"CHN","origin_raw_location":"Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China","destination_postal_code":"10001","destination_country_iso3":"USA","destination_raw_location":"13th Street, New York, NY, 10011, USA, United States","order_promised_delivery_date":"2019-05-20"}}){
"meta": {
"code": 201
},
"data": {
"tracking": {
"id": "5b766a5cc7c33c0e007de3c9",
"ios": [],
"tag": "Pending",
"slug": "chronopost-france",
"note": "test note",
"smses": [],
"title": "1111111111111",
"active": true,
"emails": [],
"source": "api",
"subtag": "Pending_001",
"android": [],
"order_id": "123",
"language": null,
"signed_by": "John Doe",
"created_at": "2018-08-17T06:25:32+00:00",
"updated_at": "2018-08-17T06:25:32+00:00",
"order_date": "2021-07-26T11:23:51-05:00",
"order_tags": [],
"checkpoints": [],
"pickup_note": "Contact shop keepers when you arrive our stores for shipment pickup",
"unique_token": "deprecated",
"tracking_key": null,
"custom_fields": null,
"customer_name": "John doe",
"delivery_time": 0,
"order_id_path": "/123",
"shipment_type": "{shipment_type}",
"tracked_count": 0,
"delivery_type": "pickup_at_store",
"subtag_message": "Pending",
"tracking_state": null,
"on_time_status": "trending-on-time",
"last_updated_at": "2018-08-17T06:25:32+00:00",
"tracking_number": "1111111111111",
"shipment_weight": 1,
"pickup_location": "Flagship Store",
"subscribed_smses": [],
"return_to_sender": false,
"expected_delivery": "2018-08-16",
"subscribed_emails": [],
"tracking_ship_date": null,
"first_attempted_at": "2018-08-16",
"on_time_difference": 0,
"origin_country_iso3": "USD",
"shipment_pickup_date": "2018-08-16",
"shipment_weight_unit": "kg",
"tracking_postal_code": null,
"courier_tracking_link": "{courier_tracking_link}",
"courier_redirect_link": "{courier_redirect_link}",
"shipment_package_count": 0,
"shipment_delivery_date": "2018-08-16",
"tracking_account_number": null,
"tracking_origin_country": null,
"destination_country_iso3": "USA",
"last_mile_tracking_supported": false,
"tracking_destination_country": null,
"order_promised_delivery_date": "2019-05-20",
"courier_destination_country_iso3": "USA",
"aftership_estimated_delivery_date": null
}
}
}Retrieve a tracking
Retrieves the details of an existing tracking. Supply the unique tracking ID from either a tracking creation request or the tracking list, and AfterShip will return the corresponding tracking information.
Parameters
fieldsstring
List of fields to include in the response. Use comma for multiple values. Fields to include:tracking_postal_code,tracking_ship_date,tracking_account_number,tracking_key,tracking_origin_country,tracking_destination_country,tracking_state,title,order_id,tag,checkpointslangstring
Translate checkpoint messages from the carrier’s provided language to the target language.
Returns
Returns a tracking object if a valid identifier was provided.
curl --request GET \
--url https://api.aftership.com/tracking/2024-04/trackings/id \
--header 'Content-Type: application/json'const url = 'https://api.aftership.com/tracking/2024-04/trackings/id';
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/trackings/id"
req, _ := http.NewRequest("GET", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/trackings/id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.get('https://api.aftership.com/tracking/2024-04/trackings/id', headers=headers){
"meta": {
"code": 200
},
"data": {
"tracking": {
"id": "5b7658cec7c33c0e007de3c5",
"ios": [],
"tag": "Delivered",
"slug": "chronopost-france",
"note": null,
"smses": [],
"title": "Title Name",
"active": false,
"emails": [],
"source": "api",
"subtag": "Delivered_001",
"android": [],
"order_id": null,
"language": null,
"signed_by": "..KOSUTOKO",
"created_at": "2018-08-17T05:10:38+00:00",
"updated_at": "2018-08-17T05:10:46+00:00",
"order_tags": [],
"checkpoints": [
{
"slug": "chronopost-france",
"city": null,
"created_at": "2018-08-17T05:10:41+00:00",
"location": null,
"country_name": null,
"message": "Shipment information sent to Chronopost France",
"country_iso3": null,
"tag": "InfoReceived",
"subtag": "InfoReceived_001",
"subtag_message": "Info Received",
"checkpoint_time": "2018-07-23T01:21:39-05:00",
"coordinates": [],
"state": null,
"zip": null,
"raw_tag": "FPX_L_RPIF"
}
],
"pickup_note": null,
"order_number": "1234",
"unique_token": "deprecated",
"tracking_key": null,
"custom_fields": null,
"customer_name": null,
"delivery_time": 2,
"order_id_path": null,
"shipment_type": "{shipment_type}",
"tracked_count": 1,
"delivery_type": "pickup_at_store",
"subtag_message": "Delivered",
"tracking_state": null,
"on_time_status": "trending-on-time",
"last_updated_at": "2018-08-17T05:10:46+00:00",
"tracking_number": "111111111111",
"shipment_weight": 4,
"pickup_location": "Flagship Store",
"subscribed_smses": [],
"return_to_sender": false,
"expected_delivery": null,
"subscribed_emails": [],
"tracking_ship_date": null,
"first_attempted_at": "2018-07-25T10:10:00+09:00",
"on_time_difference": 0,
"origin_country_iso3": "CHN",
"shipment_pickup_date": "2018-07-23T08:58:00",
"shipment_weight_unit": "kg",
"tracking_postal_code": null,
"courier_tracking_link": "{courier_tracking_link}",
"courier_redirect_link": "{courier_redirect_linkGet tracking results of a single tracking.}",
"shipment_package_count": 1,
"shipment_delivery_date": "2018-07-25T01:10:00",
"tracking_account_number": null,
"tracking_origin_country": null,
"destination_country_iso3": "JPN",
"last_mile_tracking_supported": null,
"tracking_destination_country": null,
"order_promised_delivery_date": "2019-05-02",
"courier_destination_country_iso3": "JPN",
"aftership_estimated_delivery_date": {
"confidence_score": null,
"estimated_delivery_date": "2022-01-03",
"estimated_delivery_date_min": "2022-01-01",
"estimated_delivery_date_max": "2022-01-06"
}
}
}
}Update a tracking
Updates the specific tracking by setting the values of the parameters passed. Any parameters not provided will be left unchanged.
Parameters
smsesarray[string]
The phone number(s) to receive sms notifications. Input [] to clear the value of this field. Supports up to 3 phone numbers.emailsarray[string]
Email address(es) to receive email notifications. Input [] to clear the value of this field. Supports up to 3 email addresses.titlestring
By default this field shows the tracking_number, but you can customize it as you wish with any info (e.g. the order number).customer_namestring
Customer name of the tracking.order_idstring
A globally-unique identifier for the order.order_id_pathstring
The URL for the order in your system or store.notestring
Text field for the note. Input""to clear the value of this field.languagestring
The recipient’s language. If you set up AfterShip notifications in different languages, we use this to send the recipient tracking updates in their preferred language. Use an ISO 639-1 Language Code to specify the language.order_promised_delivery_datestring
The promised delivery date of the order. It uses the format YYYY-MM-DD. This has no timezone and uses whatever date you provide. Since other EDDs use the shipment recipient’s timezone, we suggest following the same logic here.
Returns
Returns the tracking object if the update succeeded.
curl --request PUT \
--url https://api.aftership.com/tracking/2024-04/trackings/id \
--header 'Content-Type: application/json'\
--data '{"value":{"tracking":{"note":"some notes","title":"New Title"}}}'const url = 'https://api.aftership.com/tracking/2024-04/trackings/id';
const options = {
method: 'PUT',
headers: {
'Content-Type': 'application/json'
},
body: "{\"value\":{\"tracking\":{\"note\":\"some notes\",\"title\":\"New Title\"}}}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/trackings/id"
payload := strings.NewReader("{\"value\":{\"tracking\":{\"note\":\"some notes\",\"title\":\"New Title\"}}}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/trackings/id"))
.method("PUT", HttpRequest.BodyPublishers.ofString("{\"value\":{\"tracking\":{\"note\":\"some notes\",\"title\":\"New Title\"}}}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.put('https://api.aftership.com/tracking/2024-04/trackings/id', headers=headers, json={"value":{"tracking":{"note":"some notes","title":"New Title"}}}){
"value": {
"meta": {
"code": 200
},
"data": {
"tracking": {
"id": "5b7658cec7c33c0e007de3c5",
"ios": [],
"tag": "Delivered",
"slug": "chronopost-france",
"note": null,
"smses": [],
"title": "Title Name",
"active": false,
"emails": [],
"source": "api",
"subtag": "Delivered_001",
"android": [],
"order_id": null,
"language": null,
"signed_by": "..KOSUTOKO",
"created_at": "2018-08-17T05:10:38+00:00",
"updated_at": "2018-08-17T05:10:46+00:00",
"order_tags": [],
"checkpoints": [
{
"slug": "chronopost-france",
"city": null,
"created_at": "2018-08-17T05:10:41+00:00",
"location": null,
"country_name": null,
"message": "Shipment information sent to Chronopost France",
"country_iso3": null,
"tag": "InfoReceived",
"subtag": "InfoReceived_001",
"subtag_message": "Info Received",
"checkpoint_time": "2018-07-23T01:21:39-05:00",
"coordinates": [],
"state": null,
"zip": null,
"raw_tag": "FPX_L_RPIF"
}
],
"pickup_note": null,
"unique_token": "deprecated",
"tracking_key": null,
"custom_fields": null,
"customer_name": null,
"delivery_time": 2,
"order_id_path": null,
"shipment_type": "{shipment_type}",
"tracked_count": 1,
"delivery_type": "pickup_at_store",
"subtag_message": "Delivered",
"tracking_state": null,
"on_time_status": "trending-on-time",
"last_updated_at": "2018-08-17T05:10:46+00:00",
"tracking_number": "111111111111",
"shipment_weight": 4,
"pickup_location": "Flagship Store",
"subscribed_smses": [],
"return_to_sender": false,
"expected_delivery": null,
"subscribed_emails": [],
"tracking_ship_date": null,
"first_attempted_at": "2018-07-25T10:10:00+09:00",
"on_time_difference": 0,
"origin_country_iso3": "CHN",
"shipment_pickup_date": "2018-07-23T08:58:00",
"shipment_weight_unit": "kg",
"tracking_postal_code": null,
"courier_tracking_link": "{courier_tracking_link}",
"courier_redirect_link": "{courier_redirect_link}",
"shipment_package_count": 1,
"shipment_delivery_date": "2018-07-25T01:10:00",
"tracking_account_number": null,
"tracking_origin_country": null,
"destination_country_iso3": "JPN",
"last_mile_tracking_supported": null,
"tracking_destination_country": null,
"order_promised_delivery_date": "2019-05-02",
"courier_destination_country_iso3": "JPN",
"aftership_estimated_delivery_date": {
"confidence_score": null,
"estimated_delivery_date": "2022-01-03",
"estimated_delivery_date_min": "2022-01-01",
"estimated_delivery_date_max": "2022-01-06"
}
}
}
}
}Delete a tracking
Delete a tracking.
Parameters
idstring required
Tracking ID
Returns
Returns a deleted object on success. Otherwise, this call raises an error.
curl --request DELETE \
--url https://api.aftership.com/tracking/2024-04/trackings/id \
--header 'Content-Type: application/json'const url = 'https://api.aftership.com/tracking/2024-04/trackings/id';
const options = {
method: 'DELETE',
headers: {
'Content-Type': 'application/json'
},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/trackings/id"
req, _ := http.NewRequest("DELETE", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/trackings/id"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.delete('https://api.aftership.com/tracking/2024-04/trackings/id', headers=headers){
"value": {
"meta": {
"code": 200
},
"data": {
"tracking": {
"id": "5b7658cec7c33c0e007de3c5",
"slug": "chronopost-france",
"tracking_key": null,
"tracking_state": null,
"tracking_number": "772857780801111",
"tracking_ship_date": null,
"tracking_postal_code": null,
"tracking_account_number": null,
"tracking_origin_country": null,
"tracking_destination_country": null
}
}
}
}Retrack an expired tracking
Retrack an expired tracking. Max 3 times per tracking.
Parameters
idstring, required
Tracking ID
Returns
Returns the tracking object if the retrack succeeded.
curl --request POST \
--url https://api.aftership.com/tracking/2024-04/trackings/id/retrack \
--header 'Content-Type: application/json'const url = 'https://api.aftership.com/tracking/2024-04/trackings/id/retrack';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/trackings/id/retrack"
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/trackings/id/retrack"))
.method("POST", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/tracking/2024-04/trackings/id/retrack', headers=headers){
"meta": {
"code": 200,
"type": "BadRequest",
"message": "string"
},
"data": {
"tracking": {
"id": "string",
"slug": "string",
"active": true,
"tracking_key": "string",
"tracking_state": "string",
"tracking_number": "string",
"tracking_ship_date": "string",
"tracking_postal_code": "string",
"tracking_account_number": "string",
"tracking_origin_country": "string",
"tracking_destination_country": "string"
}
}
}Mark tracking as completed
Mark a tracking as completed. The tracking won't auto update until retrack it.
Parameters
reason string required
required
One of DELIVERED, LOST or RETURNED_TO_SENDER.
- Mark the tracking as completed with
DELIVERED. The tag of the tracking will be updated to Delivered and the subtag will be updated toDelivered_001. - Mark the tracking as completed with
LOST. The tag of the tracking will be updated toExceptionand the subtag will be updated toException_013. - Mark the tracking as completed with
RETURNED_TO_SENDER. The tag of the tracking will be updated to Exception and the subtag will be updated toException_011.
Allowed values: DELIVERED LOST RETURNED_TO_SENDER
Returns
meta meta required
Meta data
codeinteger required
meta code
Example:200messagestring
error message, only exist if the response status is not 2xxtypestring
error type, only exist if the response status is not 2xx
Allowed values:BadRequestUnauthorizedForbiddenNotFoundTooManyRequestsInternalErrordataobject requiredtrackingTracking
Object describes the tracking information.
curl --request POST \
--url https://api.aftership.com/tracking/2024-04/trackings/id/mark-as-completed \
--header 'Content-Type: application/json'\
--data '{"reason":{"type":"string","enum":["DELIVERED","LOST","RETURNED_TO_SENDER"],"description":"One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.\n\n- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.\n- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.\n- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`."}}'const url = 'https://api.aftership.com/tracking/2024-04/trackings/id/mark-as-completed';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"reason\":{\"type\":\"string\",\"enum\":[\"DELIVERED\",\"LOST\",\"RETURNED_TO_SENDER\"],\"description\":\"One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.\\n\\n- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.\\n- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.\\n- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`.\"}}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/trackings/id/mark-as-completed"
payload := strings.NewReader("{\"reason\":{\"type\":\"string\",\"enum\":[\"DELIVERED\",\"LOST\",\"RETURNED_TO_SENDER\"],\"description\":\"One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.\\n\\n- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.\\n- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.\\n- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`.\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/trackings/id/mark-as-completed"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"reason\":{\"type\":\"string\",\"enum\":[\"DELIVERED\",\"LOST\",\"RETURNED_TO_SENDER\"],\"description\":\"One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.\\n\\n- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.\\n- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.\\n- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`.\"}}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/tracking/2024-04/trackings/id/mark-as-completed', headers=headers, json={"reason":{"type":"string","enum":["DELIVERED","LOST","RETURNED_TO_SENDER"],"description":"One of `DELIVERED`, `LOST` or `RETURNED_TO_SENDER`.\n\n- Mark the tracking as completed with `DELIVERED`. The tag of the tracking will be updated to `Delivered` and the subtag will be updated to `Delivered_001`.\n- Mark the tracking as completed with `LOST`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_013`.\n- Mark the tracking as completed with `RETURNED_TO_SENDER`. The tag of the tracking will be updated to `Exception` and the subtag will be updated to `Exception_011`."}}){
"meta": {
"code": 200,
"type": "BadRequest",
"message": "string"
},
"data": {
"tracking": {
"id": "my2uktymyz72xld1f7l3h01z",
"tag": "Delivered",
"slug": "chronopost-france",
"note": "note",
"smses": [
"+8613800138000"
],
"title": "61293150000079650811",
"active": false,
"emails": [
"[email protected]"
],
"source": "api",
"subtag": "Delivered_002",
"order_id": "6845a095a27a4caeb27487806f058add",
"language": "en",
"signed_by": "Steve Young",
"created_at": "2023-01-18T08:47:10+00:00",
"updated_at": "2023-01-18T17:47:10+00:00",
"order_date": "2022-01-20T15:56:12+08:00",
"order_tags": [
"Exception"
],
"origin_city": "Beijing",
"checkpoints": [
{
"created_at": "2023-01-18T08:47:10+00:00",
"slug": "chronopost-france",
"checkpoint_time": "2022-01-01T18:47:10-05:00",
"location": "13th Street, New York, NY 10011, USA, United States",
"city": "New York",
"state": "NY",
"zip": "10011",
"coordinate": null,
"country_iso3": "USA",
"country_name": "United States",
"message": "Package delivered",
"tag": "Delivered",
"subtag": "Delivered_002",
"subtag_message": "Picked up by customer",
"raw_tag": "RO",
"events": {
"code": "unable_to_deliver",
"reason": {
"code": "incorrect_missing_address"
}
}
}
],
"pickup_note": "No notes",
"location_id": "bda843ed811541fc852a8447371cf6f2",
"transit_time": 9,
"origin_state": "Beijing",
"unique_token": "Deprecated",
"tracking_key": null,
"order_number": "162654659775",
"custom_fields": {
"store_name": "my-store"
},
"customer_name": "Steve Young",
"order_id_path": "https://www.aftership.com/my-orders/6845a095a27a4caeb27487806f058add",
"shipment_type": "{shipment_type}",
"tracked_count": 13,
"delivery_type": "pickup_at_store",
"shipment_tags": [
"Returned"
],
"next_couriers": [
{
"slug": "chronopost-france",
"tracking_number": "61293150000079650811",
"source": "system"
}
],
"subtag_message": "Picked up by customer",
"on_time_status": "on-time",
"tracking_state": "CA",
"last_updated_at": "2023-01-18T17:47:10+00:00",
"tracking_number": "61293150000079650811",
"shipment_weight": 0.7,
"pickup_location": "13th Street, New York, NY 10011, USA, United States",
"shipping_method": "Local Delivery",
"destination_city": "New York City",
"subscribed_smses": [
"string"
],
"return_to_sender": false,
"carbon_emissions": {
"unit": "kg",
"value": 0.7
},
"destination_state": "New York",
"expected_delivery": "2022-01-05T12:11:11+01:00",
"subscribed_emails": [
"string"
],
"origin_postal_code": "065001",
"first_attempted_at": "2022-01-01T17:00:00-05:00",
"tracking_ship_date": "20220101",
"on_time_difference": 0,
"origin_country_iso3": "CHN",
"origin_raw_location": "Lihong Gardon 4A 2301, Chaoyang District, Beijing, BJ, 065001, CHN, China",
"shipment_pickup_date": "2022-01-21T15:00:00",
"shipment_weight_unit": "kg",
"tracking_postal_code": "90213",
"courier_tracking_link": "{courier_tracking_link}",
"courier_redirect_link": "{courier_redirect_link}",
"courier_connection_id": "8e1261bde336436abbc7cb3eee8cd707",
"signature_requirement": "signature_required",
"shipment_package_count": 1,
"shipment_delivery_date": "2022-01-29T11:23:00",
"destination_postal_code": "10001",
"tracking_account_number": null,
"tracking_origin_country": "CHN",
"destination_country_iso3": "USA",
"destination_raw_location": "13th Street, New York, NY, 10011, USA, United States",
"first_estimated_delivery": {
"type": "specific",
"source": "Carrier EDD",
"datetime": "2022-01-05T12:11:11+01:00",
"datetime_min": null,
"datetime_max": null
},
"failed_delivery_attempts": 2,
"latest_estimated_delivery": {
"type": "specific",
"source": "AfterShip EDD",
"datetime": "2022-01-05T12:11:11+01:00",
"datetime_min": null,
"datetime_max": null
},
"last_mile_tracking_supported": true,
"order_promised_delivery_date": "2022-01-01",
"tracking_destination_country": "USA",
"custom_estimated_delivery_date": {
"type": "specific",
"datetime": "2022-01-05",
"datetime_min": null,
"datetime_max": null
},
"courier_destination_country_iso3": "USA",
"aftership_estimated_delivery_date": {
"confidence_code": 10001,
"estimated_delivery_date": "2022-01-03",
"estimated_delivery_date_min": "2022-01-02",
"estimated_delivery_date_max": "2022-01-04"
}
}
}
}Chronopost France Last Checkpoint API
Get last checkpoint
Return the tracking information of the last checkpoint of a single tracking.
Parameters
fieldsstring
List of fields to include in the response. Use comma for multiple values. Fields to include:slug,created_at,checkpoint_time,city,coordinates,country_iso3,country_name,message,state,tag,zip
Example:city,taglangstring
Support Chinese to English translation forchina-emsandchina-postonly
Example:en
Returns
metametacodeinteger required
meta code
Example: 200messagestring
error message, only exist if the response status is not 2xxtypestring
error type, only exist if the response status is not 2xx
Allowed values:BadRequestUnauthorizedForbiddenNotFoundTooManyRequestsInternalError
dataobjectidstring
Tracking idtracking_numberstring
Tracking number.slugstring chronopost-france
Unique code of courier.tagstring
Current status of tracking. (See tag definition)
Allowed values:PendingInfoReceivedInTransitOutForDeliveryAttemptFailDeliveredAvailableForPickupExceptionExpired
Example:Deliveredsubtagstring
Current subtag of tracking. ([See subtag definition]subtag_messagestring
Normalized tracking message. (See subtag message definition)checkpointCheckpoint
Object describes checkpoint information.
curl --request GET \
--url https://api.aftership.com/tracking/2024-04/last_checkpoint/tracking_id \
--header 'Content-Type: application/json'const url = 'https://api.aftership.com/tracking/2024-04/last_checkpoint/tracking_id';
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/last_checkpoint/tracking_id"
req, _ := http.NewRequest("GET", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/last_checkpoint/tracking_id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.get('https://api.aftership.com/tracking/2024-04/last_checkpoint/tracking_id', headers=headers){
"value": {
"meta": {
"code": 200
},
"data": {
"id": "5b74f4958776db0e00b6f5ed",
"tag": "Delivered",
"slug": "chronopost-france",
"subtag": "Delivered_001",
"checkpoint": {
"tag": "Delivered",
"zip": null,
"slug": "chronopost-france",
"city": "Deal",
"state": "NJ",
"subtag": "Delivered_001",
"message": "Delivered - Left at front door. Signature Service not requested.",
"raw_tag": "FPX_L_RPIF",
"created_at": "2018-08-16T03:50:47+00:00",
"coordinates": [],
"country_iso3": null,
"country_name": null,
"subtag_message": "Delivered",
"checkpoint_time": "2018-08-01T13:19:47-04:00"
},
"subtag_message": "Delivered",
"tracking_number": "111111111111"
}
}
}Chronopost France Estimated delivery date API
Batch predict the estimated delivery date
The estimated delivery date is provided by AfterShip, based on its AI-predictive model. You can display the EDD on the product page, cart, and order checkout page. It indicates when a customer will receive the order.
You can use AfterShip’s AI-powered predictive estimated delivery date API to provide expected delivery dates to shoppers for online orders without tracking numbers. You can get the earliest date, the latest date, and the most-likely-arrival date through our AI-predictive EDD API.
Display accurate estimated delivery dates on the product page, store cart, and order checkout page to encourage customers to check out faster and give them a better customer experience.
Contact sales to activate this feature.
Supported functionalities require:
- One
EstimatedDeliveryDateobject for one prediction result. - Maximum 5
EstimatedDeliveryDateobjects are allowed. - API call will fail if any of the requests
EstimatedDeliveryDateobjects do not meet the specification requirement.
Parameters
estimated_delivery_datesarray[EstimatedDeliveryDate] required>= 1 items<= 5 itemsslugstringchronopost-francerequired
AfterShip's unique code of courier. Please refer to https://track.aftership.com/couriers/download.service_type_namestring or null
AfterShip’s unique code represents carrier’s shipping and delivery options. Refer to Download Link.origin_addressobjectrequired
The location from where the package is picked up by the carrier to be delivered to the final destination.destination_addressobjectrequired
The final destination of the customer where the delivery will be made.weightobject or null
AfterShip uses this object to calculate the total weight of the order.package_countinteger or null
The number of packages.pickup_timestring or null
The local pickup time in the origin address time zone of the package.estimated_pickupobject or null
The local pickup time of the package. Eitherpickup_timeorestimated_pickupis required.
Returns
metameta requiredcodeinteger required
meta codemessagestring
error message, only exist if the response status is not 2xxtypestring
error type, only exist if the response status is not 2xx
Allowed values:BadRequestUnauthorizedForbiddenNotFoundTooManyRequestsInternalError
- data object required
estimated_delivery_datesarray[EstimatedDeliveryDate] required
curl --request POST \
--url https://api.aftership.com/tracking/2024-04/estimated-delivery-date/predict-batch \
--header 'Content-Type: application/json'\
--data '{"estimated_delivery_dates":[{"slug":"chronopost-france","service_type_name":"{service_type_name}","origin_address":{"country":"USA","state":"WA","city":"Seattle","postal_code":"98108","raw_location":"Seattle, Washington, 98108, USA, United States"},"destination_address":{"country":"USA","state":"CA","postal_code":"92019","raw_location":"El Cajon, California, 92019, USA, United States"},"weight":{"unit":"kg","value":1},"package_count":1,"pickup_time":"2021-07-01 15:00:00"},{"slug":"chronopost-france","service_type_name":"{service_type_name}","origin_address":{"country":"USA","state":"WA","postal_code":"98108","raw_location":"Seattle, Washington, 98108, USA, United States"},"destination_address":{"country":"USA","state":"California","postal_code":"92019","raw_location":"El Cajon, California, 92019, USA, United States"},"weight":null,"package_count":null,"estimated_pickup":{"order_time":"2021-07-01 15:04:05","order_cutoff_time":"20:00:00","business_days":[1,2,3,4,5,6,7],"order_processing_time":{"unit":"day","value":0}}}]}'const url = 'https://api.aftership.com/tracking/2024-04/estimated-delivery-date/predict-batch';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"estimated_delivery_dates\":[{\"slug\":\"chronopost-france\",\"service_type_name\":\"{service_type_name}\",\"origin_address\":{\"country\":\"USA\",\"state\":\"WA\",\"city\":\"Seattle\",\"postal_code\":\"98108\",\"raw_location\":\"Seattle, Washington, 98108, USA, United States\"},\"destination_address\":{\"country\":\"USA\",\"state\":\"CA\",\"postal_code\":\"92019\",\"raw_location\":\"El Cajon, California, 92019, USA, United States\"},\"weight\":{\"unit\":\"kg\",\"value\":1},\"package_count\":1,\"pickup_time\":\"2021-07-01 15:00:00\"},{\"slug\":\"chronopost-france\",\"service_type_name\":\"{service_type_name}\",\"origin_address\":{\"country\":\"USA\",\"state\":\"WA\",\"postal_code\":\"98108\",\"raw_location\":\"Seattle, Washington, 98108, USA, United States\"},\"destination_address\":{\"country\":\"USA\",\"state\":\"California\",\"postal_code\":\"92019\",\"raw_location\":\"El Cajon, California, 92019, USA, United States\"},\"weight\":null,\"package_count\":null,\"estimated_pickup\":{\"order_time\":\"2021-07-01 15:04:05\",\"order_cutoff_time\":\"20:00:00\",\"business_days\":[1,2,3,4,5,6,7],\"order_processing_time\":{\"unit\":\"day\",\"value\":0}}}]}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/tracking/2024-04/estimated-delivery-date/predict-batch"
payload := strings.NewReader("{\"estimated_delivery_dates\":[{\"slug\":\"chronopost-france\",\"service_type_name\":\"{service_type_name}\",\"origin_address\":{\"country\":\"USA\",\"state\":\"WA\",\"city\":\"Seattle\",\"postal_code\":\"98108\",\"raw_location\":\"Seattle, Washington, 98108, USA, United States\"},\"destination_address\":{\"country\":\"USA\",\"state\":\"CA\",\"postal_code\":\"92019\",\"raw_location\":\"El Cajon, California, 92019, USA, United States\"},\"weight\":{\"unit\":\"kg\",\"value\":1},\"package_count\":1,\"pickup_time\":\"2021-07-01 15:00:00\"},{\"slug\":\"chronopost-france\",\"service_type_name\":\"{service_type_name}\",\"origin_address\":{\"country\":\"USA\",\"state\":\"WA\",\"postal_code\":\"98108\",\"raw_location\":\"Seattle, Washington, 98108, USA, United States\"},\"destination_address\":{\"country\":\"USA\",\"state\":\"California\",\"postal_code\":\"92019\",\"raw_location\":\"El Cajon, California, 92019, USA, United States\"},\"weight\":null,\"package_count\":null,\"estimated_pickup\":{\"order_time\":\"2021-07-01 15:04:05\",\"order_cutoff_time\":\"20:00:00\",\"business_days\":[1,2,3,4,5,6,7],\"order_processing_time\":{\"unit\":\"day\",\"value\":0}}}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/tracking/2024-04/estimated-delivery-date/predict-batch"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"estimated_delivery_dates\":[{\"slug\":\"chronopost-france\",\"service_type_name\":\"{service_type_name}\",\"origin_address\":{\"country\":\"USA\",\"state\":\"WA\",\"city\":\"Seattle\",\"postal_code\":\"98108\",\"raw_location\":\"Seattle, Washington, 98108, USA, United States\"},\"destination_address\":{\"country\":\"USA\",\"state\":\"CA\",\"postal_code\":\"92019\",\"raw_location\":\"El Cajon, California, 92019, USA, United States\"},\"weight\":{\"unit\":\"kg\",\"value\":1},\"package_count\":1,\"pickup_time\":\"2021-07-01 15:00:00\"},{\"slug\":\"chronopost-france\",\"service_type_name\":\"{service_type_name}\",\"origin_address\":{\"country\":\"USA\",\"state\":\"WA\",\"postal_code\":\"98108\",\"raw_location\":\"Seattle, Washington, 98108, USA, United States\"},\"destination_address\":{\"country\":\"USA\",\"state\":\"California\",\"postal_code\":\"92019\",\"raw_location\":\"El Cajon, California, 92019, USA, United States\"},\"weight\":null,\"package_count\":null,\"estimated_pickup\":{\"order_time\":\"2021-07-01 15:04:05\",\"order_cutoff_time\":\"20:00:00\",\"business_days\":[1,2,3,4,5,6,7],\"order_processing_time\":{\"unit\":\"day\",\"value\":0}}}]}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/tracking/2024-04/estimated-delivery-date/predict-batch', headers=headers, json={"estimated_delivery_dates":[{"slug":"chronopost-france","service_type_name":"{service_type_name}","origin_address":{"country":"USA","state":"WA","city":"Seattle","postal_code":"98108","raw_location":"Seattle, Washington, 98108, USA, United States"},"destination_address":{"country":"USA","state":"CA","postal_code":"92019","raw_location":"El Cajon, California, 92019, USA, United States"},"weight":{"unit":"kg","value":1},"package_count":1,"pickup_time":"2021-07-01 15:00:00"},{"slug":"chronopost-france","service_type_name":"{service_type_name}","origin_address":{"country":"USA","state":"WA","postal_code":"98108","raw_location":"Seattle, Washington, 98108, USA, United States"},"destination_address":{"country":"USA","state":"California","postal_code":"92019","raw_location":"El Cajon, California, 92019, USA, United States"},"weight":null,"package_count":null,"estimated_pickup":{"order_time":"2021-07-01 15:04:05","order_cutoff_time":"20:00:00","business_days":[1,2,3,4,5,6,7],"order_processing_time":{"unit":"day","value":0}}}]}){
"meta": {
"code": 200
},
"data": {
"estimated_delivery_dates": [
{
"slug": "chronopost-france",
"service_type_name": "{service_type_name}",
"origin_address": {
"country": "USA",
"state": "WA",
"postal_code": "98108",
"raw_location": "Seattle, Washington, 98108, USA, United States",
"city": null
},
"destination_address": {
"country": "USA",
"state": "CA",
"postal_code": "92019",
"raw_location": "El Cajon, California, 92019, USA, United States",
"city": null
},
"weight": {
"unit": "kg",
"value": 1
},
"package_count": 1,
"pickup_time": "2021-07-01 15:00:00",
"estimated_pickup": null,
"estimated_delivery_date": "2021-07-04",
"estimated_delivery_date_min": "2021-07-03",
"estimated_delivery_date_max": "2021-07-04"
},
{
"slug": "chronopost-france",
"service_type_name": "{service_type_name}",
"origin_address": {
"country": "USA",
"state": "WA",
"postal_code": "98108",
"raw_location": "Seattle, Washington, 98108, USA, United States",
"city": null
},
"destination_address": {
"country": "USA",
"state": "CA",
"postal_code": "92019",
"raw_location": "El Cajon, California, 92019, USA, United States",
"city": null
},
"weight": null,
"package_count": null,
"pickup_time": null,
"estimated_pickup": {
"order_time": "2021-07-01 15:04:05",
"order_cutoff_time": "20:00:00",
"business_days": [
1,
2,
3,
4,
5,
6,
7
],
"order_processing_time": {
"unit": "day",
"value": 0
},
"pickup_time": "2021-07-01 20:00:00"
},
"estimated_delivery_date": "2021-07-03",
"estimated_delivery_date_min": "2021-07-02",
"estimated_delivery_date_max": "2021-07-04"
}
]
}
}Chronopost France Rate API
Get a rate
Get rate
Parameters
idstring required
Rate id
Returns
metaMetacodeinteger required
Code of Metamessagestring required
Message of Metadetailsarray[Error]
Details of Metaretryableboolean
Whether this request will be retryable or not
dataRateRecord
RateRecord object: the description of rates informationcreated_atstring
the timestamp of created_at, example: 2022-05-18T09:17:38+00:00idstring
rate idupdated_atstring
the timestamp of updated_at, example: 2022-05-18T09:17:38+00:00statusstring
Allowed values:calculatingcalculatedfailedratesarray[Rate]
rates array
curl --request GET \
--url https://api.aftership.com/postmen/v3/rates/id \
--header 'Content-Type: application/json'const url = 'https://api.aftership.com/postmen/v3/rates/id';
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/postmen/v3/rates/id"
req, _ := http.NewRequest("GET", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/postmen/v3/rates/id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.get('https://api.aftership.com/postmen/v3/rates/id', headers=headers){
"meta": {
"code": 200,
"type": "OK",
"message": "Everything worked as expected."
},
"data": {
"id": "ad1f9340-608d-4a30-be0e-b0a62e07e4cc",
"rates": [
{
"charge_weight": {
"value": 1.5,
"unit": "kg"
},
"total_charge": {
"amount": 429.57,
"currency": "HKD"
},
"shipper_account": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "chronopost-france",
"description": "Chronopost France Sandbox"
},
"service_type": "{service_type}",
"service_name": "{service_name}",
"pickup_deadline": "2015-09-01T18:00:00+00:00",
"booking_cut_off": "2015-09-01T17:00:00+00:00",
"delivery_date": "2015-09-01T23:00:00+00:00",
"transit_time": 1,
"detailed_charges": [
{
"type": "base",
"charge": {
"amount": 387,
"currency": "HKD"
}
},
{
"type": "fuel_surcharge",
"charge": {
"amount": 42.57,
"currency": "HKD"
}
}
],
"error_message": null,
"info_message": null
},
{
"charge_weight": {
"value": 1.5,
"unit": "kg"
},
"total_charge": {
"amount": 528,
"currency": "HKD"
},
"shipper_account": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "chronopost-france",
"description": "Chronopost France Sandbox"
},
"service_type": "{service_type}",
"service_name": "{service_name}",
"pickup_deadline": "2015-09-01T18:00:00+00:00",
"booking_cut_off": "2015-09-01T17:00:00+00:00",
"delivery_date": "2015-09-01T23:00:00+00:00",
"transit_time": 1,
"detailed_charges": [
{
"type": "base",
"charge": {
"amount": 528,
"currency": "HKD"
}
}
],
"error_message": null,
"info_message": null
}
],
"status": "calculated",
"created_at": "2015-09-09T07:49:54.060Z",
"updated_at": "2015-09-09T07:49:57.360Z"
}
}Calculate rates
Calculate rates
Parameters
asyncboolean
enable async mode or not (set to false if not provided)is_documentboolean
If the shipment is document type. (set to false if not provided)ship_datestring
Ship Date in YYYY-MM-DD, if not provided, will be today of the shipper account timezoneshipper_accountsarray[object]- id string
shipmentShipment
Shipment object: the description of shipment informationship_fromAddress required
Address object: the description of address informationship_toAddress required
Address object: the description of address informationparcelsarray[Parcel] required
required
Parcels of shipmentreturn_toAddress
Address object: the description of address informationdelivery_instructionsstring
Instructions to aid in prompt delivery of the shipment.
Returns
metaMeta
Meta data object.codeinteger required
Code of Metamessagestring required
Message of Metadetailsarray[Error]
Details of Metaretryableboolean
Whether this request will be retryable or not
dataRateRecord
RateRecord object: the description of rates informationcreated_atstring
the timestamp of created_at, example: 2022-05-18T09:17:38+00:00idstring
rate idupdated_atstring
the timestamp of updated_at, example: 2022-05-18T09:17:38+00:00statusstring
Allowed values:calculatingcalculatedfailedratesarray[Rate]
rates array
curl --request POST \
--url https://api.aftership.com/postmen/v3/rates \
--header 'Content-Type: application/json'\
--data '{"shipment":{"ship_to":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"},"parcels":[{"box_type":"custom","dimension":{"width":10,"height":10,"depth":10,"unit":"cm"},"items":[{"description":"Food Bar","quantity":1,"price":{"currency":"USD","amount":100},"item_id":"1234567","origin_country":"CHN","weight":{"unit":"kg","value":10},"sku":"imac2014","hs_code":"1006.30"}],"description":"Food XS","weight":{"unit":"kg","value":10}}],"ship_from":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"},"return_to":{"city":"New York","type":"residential","state":"New York","phone":"1-123-456-5496","email":"[email protected]","street1":"This is the first streeet","street2":"This is the second streeet","country":"USA","postal_code":"10001","contact_name":"AfterShip Shipping"},"delivery_instructions":"handle with care"},"shipper_accounts":[{"id":"3ba41ff5-59a7-4ff0-8333-64a4375c7f21"}]}'const url = 'https://api.aftership.com/postmen/v3/rates';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"shipment\":{\"ship_to\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"parcels\":[{\"box_type\":\"custom\",\"dimension\":{\"width\":10,\"height\":10,\"depth\":10,\"unit\":\"cm\"},\"items\":[{\"description\":\"Food Bar\",\"quantity\":1,\"price\":{\"currency\":\"USD\",\"amount\":100},\"item_id\":\"1234567\",\"origin_country\":\"CHN\",\"weight\":{\"unit\":\"kg\",\"value\":10},\"sku\":\"imac2014\",\"hs_code\":\"1006.30\"}],\"description\":\"Food XS\",\"weight\":{\"unit\":\"kg\",\"value\":10}}],\"ship_from\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"return_to\":{\"city\":\"New York\",\"type\":\"residential\",\"state\":\"New York\",\"phone\":\"1-123-456-5496\",\"email\":\"[email protected]\",\"street1\":\"This is the first streeet\",\"street2\":\"This is the second streeet\",\"country\":\"USA\",\"postal_code\":\"10001\",\"contact_name\":\"AfterShip Shipping\"},\"delivery_instructions\":\"handle with care\"},\"shipper_accounts\":[{\"id\":\"3ba41ff5-59a7-4ff0-8333-64a4375c7f21\"}]}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/postmen/v3/rates"
payload := strings.NewReader("{\"shipment\":{\"ship_to\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"parcels\":[{\"box_type\":\"custom\",\"dimension\":{\"width\":10,\"height\":10,\"depth\":10,\"unit\":\"cm\"},\"items\":[{\"description\":\"Food Bar\",\"quantity\":1,\"price\":{\"currency\":\"USD\",\"amount\":100},\"item_id\":\"1234567\",\"origin_country\":\"CHN\",\"weight\":{\"unit\":\"kg\",\"value\":10},\"sku\":\"imac2014\",\"hs_code\":\"1006.30\"}],\"description\":\"Food XS\",\"weight\":{\"unit\":\"kg\",\"value\":10}}],\"ship_from\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"return_to\":{\"city\":\"New York\",\"type\":\"residential\",\"state\":\"New York\",\"phone\":\"1-123-456-5496\",\"email\":\"[email protected]\",\"street1\":\"This is the first streeet\",\"street2\":\"This is the second streeet\",\"country\":\"USA\",\"postal_code\":\"10001\",\"contact_name\":\"AfterShip Shipping\"},\"delivery_instructions\":\"handle with care\"},\"shipper_accounts\":[{\"id\":\"3ba41ff5-59a7-4ff0-8333-64a4375c7f21\"}]}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/postmen/v3/rates"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"shipment\":{\"ship_to\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"parcels\":[{\"box_type\":\"custom\",\"dimension\":{\"width\":10,\"height\":10,\"depth\":10,\"unit\":\"cm\"},\"items\":[{\"description\":\"Food Bar\",\"quantity\":1,\"price\":{\"currency\":\"USD\",\"amount\":100},\"item_id\":\"1234567\",\"origin_country\":\"CHN\",\"weight\":{\"unit\":\"kg\",\"value\":10},\"sku\":\"imac2014\",\"hs_code\":\"1006.30\"}],\"description\":\"Food XS\",\"weight\":{\"unit\":\"kg\",\"value\":10}}],\"ship_from\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"return_to\":{\"city\":\"New York\",\"type\":\"residential\",\"state\":\"New York\",\"phone\":\"1-123-456-5496\",\"email\":\"[email protected]\",\"street1\":\"This is the first streeet\",\"street2\":\"This is the second streeet\",\"country\":\"USA\",\"postal_code\":\"10001\",\"contact_name\":\"AfterShip Shipping\"},\"delivery_instructions\":\"handle with care\"},\"shipper_accounts\":[{\"id\":\"3ba41ff5-59a7-4ff0-8333-64a4375c7f21\"}]}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/postmen/v3/rates', headers=headers, json={"shipment":{"ship_to":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"},"parcels":[{"box_type":"custom","dimension":{"width":10,"height":10,"depth":10,"unit":"cm"},"items":[{"description":"Food Bar","quantity":1,"price":{"currency":"USD","amount":100},"item_id":"1234567","origin_country":"CHN","weight":{"unit":"kg","value":10},"sku":"imac2014","hs_code":"1006.30"}],"description":"Food XS","weight":{"unit":"kg","value":10}}],"ship_from":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"},"return_to":{"city":"New York","type":"residential","state":"New York","phone":"1-123-456-5496","email":"[email protected]","street1":"This is the first streeet","street2":"This is the second streeet","country":"USA","postal_code":"10001","contact_name":"AfterShip Shipping"},"delivery_instructions":"handle with care"},"shipper_accounts":[{"id":"3ba41ff5-59a7-4ff0-8333-64a4375c7f21"}]}){
"meta": {
"code": 200,
"type": "OK",
"message": "Everything worked as expected."
},
"data": {
"id": "ad1f9340-608d-4a30-be0e-b0a62e07e4cc",
"rates": [
{
"charge_weight": {
"value": 1.5,
"unit": "kg"
},
"total_charge": {
"amount": 429.57,
"currency": "HKD"
},
"shipper_account": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "chronopost-france",
"description": "Chronopost France Sandbox"
},
"service_type": "{service_type}",
"service_name": "{service_name}",
"pickup_deadline": "2015-09-01T18:00:00+00:00",
"booking_cut_off": "2015-09-01T17:00:00+00:00",
"delivery_date": "2015-09-01T23:00:00+00:00",
"transit_time": 1,
"detailed_charges": [
{
"type": "base",
"charge": {
"amount": 387,
"currency": "HKD"
}
},
{
"type": "fuel_surcharge",
"charge": {
"amount": 42.57,
"currency": "HKD"
}
}
],
"error_message": null,
"info_message": null
},
{
"charge_weight": {
"value": 1.5,
"unit": "kg"
},
"total_charge": {
"amount": 528,
"currency": "HKD"
},
"shipper_account": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "chronopost-france",
"description": "Chronopost France Sandbox"
},
"service_type": "{service_type}",
"service_name": "{service_name}",
"pickup_deadline": "2015-09-01T18:00:00+00:00",
"booking_cut_off": "2015-09-01T17:00:00+00:00",
"delivery_date": "2015-09-01T23:00:00+00:00",
"transit_time": 1,
"detailed_charges": [
{
"type": "base",
"charge": {
"amount": 528,
"currency": "HKD"
}
}
],
"error_message": null,
"info_message": null
}
],
"status": "calculated",
"created_at": "2015-09-09T07:49:54.060Z",
"updated_at": "2015-09-09T07:49:57.360Z"
}
}Chronopost France Label API
Create a label
Create a label.
Parameters
billingBilling
Billing object: the description of billing informationpaid_bystring required
Allowed values:shipperthird_partyrecipientmethodPaymentMethodAccount
PaymentMethodAccount object: the description of account information
customsCustoms
Customs object: the description of customs informationpurposestring required
Allowed values:giftmerchandisepersonalsamplereturnrepairnon-merchandiseterms_of_tradestring
Allowed values:datdduddpdapexwfcafobcipcifcptcfrdpueeione of: AES
AES object: the description of EEI Type - aesbillingBilling
Billing object: the description of billing informationimporter_addressAddress
Address object: the description of address informationpassportobject
Passport Objectadditional_chargesarray[object]
This array contains additional_charges object. Additional charge to be added to the commercial invoice of this shipment. Only applies to FedEx, DHL, UPS currently.
shipmentShipment
Shipment object: the description of shipment informationship_fromAddress required
Address object: the description of address informationship_to Addressrequired
Address object: the description of address informationparcelsarray[Parcel] required
Parcels of shipmentreturn_toAddress
Address object: the description of address informationdelivery_instructionsstring
Instructions to aid in prompt delivery of the shipment.
Return
metaMeta
Meta data object.codeinteger required
Code of Metamessagestring required
Message of Metadetailsarray[Error]
Details of Metaretryableboolean
Whether this request will be retryable or not
dataLabel
Label object: the description of label objectidstring
Label IDstatusstring
Allowed values:creatingcreatedcancellingcancelledmanifestingmanifestedfailedship_datestringtracking_numbersarray[string]
curl --request POST \
--url https://api.aftership.com/postmen/v3/labels \
--header 'Content-Type: application/json'\
--data '{"shipment":{"ship_to":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"},"parcels":[{"box_type":"custom","dimension":{"width":10,"height":10,"depth":10,"unit":"cm"},"items":[{"description":"Food Bar","quantity":1,"price":{"currency":"USD","amount":100},"item_id":"1234567","origin_country":"CHN","weight":{"unit":"kg","value":1},"sku":"imac2014","hs_code":"100630","return_reason":"too big"}],"description":"Food XS","weight":{"unit":"kg","value":1}}],"ship_from":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"}},"paper_size":"4x6","references":["refernce1"],"is_document":false,"service_type":"usps-discounted_express_mail","custom_fields":{"ship_code":"01"},"return_shipment":false,"shipper_account":{"id":"3ba41ff5-59a7-4ff0-8333-64a4375c7f21"}}'const url = 'https://api.aftership.com/postmen/v3/labels';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"shipment\":{\"ship_to\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"parcels\":[{\"box_type\":\"custom\",\"dimension\":{\"width\":10,\"height\":10,\"depth\":10,\"unit\":\"cm\"},\"items\":[{\"description\":\"Food Bar\",\"quantity\":1,\"price\":{\"currency\":\"USD\",\"amount\":100},\"item_id\":\"1234567\",\"origin_country\":\"CHN\",\"weight\":{\"unit\":\"kg\",\"value\":1},\"sku\":\"imac2014\",\"hs_code\":\"100630\",\"return_reason\":\"too big\"}],\"description\":\"Food XS\",\"weight\":{\"unit\":\"kg\",\"value\":1}}],\"ship_from\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"}},\"paper_size\":\"4x6\",\"references\":[\"refernce1\"],\"is_document\":false,\"service_type\":\"usps-discounted_express_mail\",\"custom_fields\":{\"ship_code\":\"01\"},\"return_shipment\":false,\"shipper_account\":{\"id\":\"3ba41ff5-59a7-4ff0-8333-64a4375c7f21\"}}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/postmen/v3/labels"
payload := strings.NewReader("{\"shipment\":{\"ship_to\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"parcels\":[{\"box_type\":\"custom\",\"dimension\":{\"width\":10,\"height\":10,\"depth\":10,\"unit\":\"cm\"},\"items\":[{\"description\":\"Food Bar\",\"quantity\":1,\"price\":{\"currency\":\"USD\",\"amount\":100},\"item_id\":\"1234567\",\"origin_country\":\"CHN\",\"weight\":{\"unit\":\"kg\",\"value\":1},\"sku\":\"imac2014\",\"hs_code\":\"100630\",\"return_reason\":\"too big\"}],\"description\":\"Food XS\",\"weight\":{\"unit\":\"kg\",\"value\":1}}],\"ship_from\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"}},\"paper_size\":\"4x6\",\"references\":[\"refernce1\"],\"is_document\":false,\"service_type\":\"usps-discounted_express_mail\",\"custom_fields\":{\"ship_code\":\"01\"},\"return_shipment\":false,\"shipper_account\":{\"id\":\"3ba41ff5-59a7-4ff0-8333-64a4375c7f21\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/postmen/v3/labels"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"shipment\":{\"ship_to\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"},\"parcels\":[{\"box_type\":\"custom\",\"dimension\":{\"width\":10,\"height\":10,\"depth\":10,\"unit\":\"cm\"},\"items\":[{\"description\":\"Food Bar\",\"quantity\":1,\"price\":{\"currency\":\"USD\",\"amount\":100},\"item_id\":\"1234567\",\"origin_country\":\"CHN\",\"weight\":{\"unit\":\"kg\",\"value\":1},\"sku\":\"imac2014\",\"hs_code\":\"100630\",\"return_reason\":\"too big\"}],\"description\":\"Food XS\",\"weight\":{\"unit\":\"kg\",\"value\":1}}],\"ship_from\":{\"city\":\"Salt Lake City\",\"state\":\"UT\",\"phone\":\"123456789\",\"email\":\"[email protected]\",\"street1\":\"230 W 200 S LBBY\",\"country\":\"USA\",\"postal_code\":\"84101\",\"contact_name\":\"AfterShip Shipping\",\"company_name\":\"AfterShip Shipping\"}},\"paper_size\":\"4x6\",\"references\":[\"refernce1\"],\"is_document\":false,\"service_type\":\"usps-discounted_express_mail\",\"custom_fields\":{\"ship_code\":\"01\"},\"return_shipment\":false,\"shipper_account\":{\"id\":\"3ba41ff5-59a7-4ff0-8333-64a4375c7f21\"}}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/postmen/v3/labels', headers=headers, json={"shipment":{"ship_to":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"},"parcels":[{"box_type":"custom","dimension":{"width":10,"height":10,"depth":10,"unit":"cm"},"items":[{"description":"Food Bar","quantity":1,"price":{"currency":"USD","amount":100},"item_id":"1234567","origin_country":"CHN","weight":{"unit":"kg","value":1},"sku":"imac2014","hs_code":"100630","return_reason":"too big"}],"description":"Food XS","weight":{"unit":"kg","value":1}}],"ship_from":{"city":"Salt Lake City","state":"UT","phone":"123456789","email":"[email protected]","street1":"230 W 200 S LBBY","country":"USA","postal_code":"84101","contact_name":"AfterShip Shipping","company_name":"AfterShip Shipping"}},"paper_size":"4x6","references":["refernce1"],"is_document":false,"service_type":"usps-discounted_express_mail","custom_fields":{"ship_code":"01"},"return_shipment":false,"shipper_account":{"id":"3ba41ff5-59a7-4ff0-8333-64a4375c7f21"}}){
"meta": {
"code": 200,
"message": "OK",
"details": []
},
"data": {
"id": "3318b97b-150f-4205-840d-a6d966b9e0ea",
"rate": {
"total_charge": {
"amount": 0,
"currency": "USD"
},
"service_type": "{service_type}",
"service_name": "{service_name}",
"transit_time": null,
"info_message": null,
"charge_weight": {
"unit": "lb",
"value": 3.307
},
"delivery_date": null,
"error_message": null,
"shipper_account": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "chronopost-france",
"description": "Chronopost France Sandbox"
},
"pickup_deadline": null,
"booking_cut_off": null,
"detailed_charges": []
},
"files": {
"label": {
"url": "https://sandbox-download.postmen.com/label/2015-11-27/00000000-0000-0000-0000-000000000000-1441785264309885.pdf",
"file_type": "pdf",
"paper_size": "4x8"
},
"invoice": null,
"manifest": null,
"customs_declaration": null
},
"status": "created",
"ship_date": "2022-09-09",
"created_at": "2022-05-09T07:54:13.024Z",
"updated_at": "2022-09-09T07:54:24.569Z",
"tracking_numbers": [
"3884930103"
]
},
"custom_fields": {
"ship_code": "01"
}
}Get a label
Get a label.
Parameters
idstring required
label id
Returns
metaMeta
Meta data object.codeinteger required
Code of Metamessagestring required
Message of Metadetailsarray[Error]
Details of Metaretryableboolean
Whether this request will be retryable or not
dataLabel
Label object: the description of label objectidstring
Label IDstatusstring
Allowed values:creatingcreatedcancellingcancelledmanifestingmanifestedfailed
curl --request GET \
--url https://api.aftership.com/postmen/v3/labels/id \
--header 'Content-Type: application/json'const url = 'https://api.aftership.com/postmen/v3/labels/id';
const options = {
method: 'GET',
headers: {
'Content-Type': 'application/json'
},
body: undefined
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/postmen/v3/labels/id"
req, _ := http.NewRequest("GET", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/postmen/v3/labels/id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.get('https://api.aftership.com/postmen/v3/labels/id', headers=headers){
"meta": {
"code": 200,
"type": "OK",
"message": "Everything worked as expected."
},
"data": {
"id": "3318b97b-150f-4205-840d-a6d966b9e0ea",
"rate": {
"total_charge": {
"amount": 0,
"currency": "USD"
},
"service_type": "{service_type}",
"service_name": "{service_name}",
"transit_time": null,
"info_message": null,
"charge_weight": {
"unit": "lb",
"value": 3.307
},
"delivery_date": null,
"error_message": null,
"shipper_account": {
"id": "00000000-0000-0000-0000-000000000000",
"slug": "chronopost-france",
"description": "Chronopost France Sandbox"
},
"pickup_deadline": null,
"booking_cut_off": null,
"detailed_charges": []
},
"files": {
"label": {
"url": "https://sandbox-download.postmen.com/label/2015-11-27/00000000-0000-0000-0000-000000000000-1441785264309885.pdf",
"file_type": "pdf",
"paper_size": "4x8"
},
"invoice": null,
"manifest": null,
"customs_declaration": null
},
"status": "created",
"ship_date": "2015-09-09",
"created_at": "2015-09-09T07:54:13.024Z",
"updated_at": "2015-09-09T07:54:24.569Z",
"tracking_numbers": [
"3884930103"
]
}
}Chronopost France Manifest API
We currently do not support this API. If you are interested in this API, please request for an integration .
Chronopost France Cancel Label API
Cancel a label
Cancel a label.
Parameters
labelobjectidstring
Returns
metaMeta
Meta data object.codeinteger required
Code of Metamessagestring required
Message of Metadetailsarray[Error]
Details of Metaretryableboolean
Whether this request will be retryable or not
dataobjectidstringstatusstring
Allowed values:cancellingcancelledfailedrefund_statusstringlabelobjectcreated_atstringupdated_atstring
curl --request POST \
--url https://api.aftership.com/postmen/v3/cancel-labels \
--header 'Content-Type: application/json'\
--data '{"label":{"id":"00000000-0000-0000-0000-000000000000"}}'const url = 'https://api.aftership.com/postmen/v3/cancel-labels';
const options = {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: "{\"label\":{\"id\":\"00000000-0000-0000-0000-000000000000\"}}"
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aftership.com/postmen/v3/cancel-labels"
payload := strings.NewReader("{\"label\":{\"id\":\"00000000-0000-0000-0000-000000000000\"}}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.aftership.com/postmen/v3/cancel-labels"))
.method("POST", HttpRequest.BodyPublishers.ofString("{\"label\":{\"id\":\"00000000-0000-0000-0000-000000000000\"}}"))
.header("Content-Type", "application/json")
.build();
HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString());import requests
headers = {
'Content-Type': 'application/json',
}
response = requests.post('https://api.aftership.com/postmen/v3/cancel-labels', headers=headers, json={"label":{"id":"00000000-0000-0000-0000-000000000000"}}){
"meta": {
"code": 200,
"type": "OK",
"message": "Everything worked as expected."
},
"data": {
"id": "00000000-0000-0000-0000-000000000000",
"label": {
"id": "00000000-0000-0000-0000-000000000000"
},
"status": "cancelled",
"created_at": "2022-02-11T08:10:47+00:00",
"updated_at": "2022-02-11T08:10:47+00:00"
}
}Chronopost France Pickup API
We currently do not support this API. If you are interested in this API, please request for an integration .
Chronopost France Cancel Pickup API
We currently do not support this API. If you are interested in this API, please request for an integration .
Chronopost France Shipper Account API
We currently do not support this API. If you are interested in this API, please request for an integration .
Chronopost France Address Validation (Beta) API
We currently do not support this API. If you are interested in this API, please request for an integration .