Welcome to the CheapCargo API documentation. This comprehensive guide will help you integrate our shipping services into your application for seamless logistics management.
To access our API, each request must include an authentication token and user credentials. The authentication process ensures that only authorized users can interact with the API. Ensure that the hashes in authentication
and password
are correctly generated and match the expected format to successfully authenticate with the API.
The authentication information will look as follows in the request body:
<authentication>317ad2da332f65569b172c77b9565bda</authentication>
<user>
<email>user@example.com</email>
<password>51f740668efd21ab9ec1d0d382d9746e</password>
</user>
Authentication token (authentication
):
YYYYMMDDHH
.HH
is based on a 24-hour format with a 2-hour margin. For example, if the request is made between 13:00 and 17:59 on 15 December 2023, the time portion would be 15
, resulting in a date and time format of 2023121515
. So if the user's API key is Vlp3RxUvRF9xDzoX
, then Vlp3RxUvRF9xDzoX2023121515
would hash to 317ad2da332f65569b172c77b9565bda
.User email address (email
):
Password hash (password
):
CheapCargo
would hash to 51f740668efd21ab9ec1d0d382d9746e
.To ensure optimal compatibility with our API, each request should include the version number your system is using. This versioning helps prevent issues when we make changes to the message structure or functionality of the API. By specifying the version number, your system can continue to function correctly even if updates are made on our end.
The version number is applied on a per-method basis, meaning different methods in your system may use different version numbers.
If no version number is provided, the API will assume you are using the latest version. However, if CheapCargo introduces changes and a new version becomes available that differs from the previous one, this could lead to errors. Therefore, we strongly recommend always including the version number in your requests to ensure consistent operation.
Endpoint | Current Version | Status |
---|---|---|
createShipment | 2.1 |
✅ Stable |
rateRequest | 2.0 |
✅ Stable |
getStatus | 1.9 |
✅ Stable |
getLabel | 1.6 |
✅ Stable |
cancelShipment | 2.1 |
✅ Stable |
Need help? Our support team is here to assist you:
Get competitive shipping rates from multiple carriers for your shipments.
Features:
Perfect for:
authentication required | string <password> ^[a-f\d]{32}$ Example: "317ad2da332f65569b172c77b9565bda" Authentication token for verifying the request | ||||||||||
version required | string Example: "2" API version being used | ||||||||||
required | object (User) Information about the user making the request | ||||||||||
| |||||||||||
required | Array of objects non-empty List of shipments to get rates for | ||||||||||
Array (non-empty)
|
required | object Rates information for the shipments | ||||||||
| |||||||||
environment | string Example: "test" Environment in which the request was processed, omitted in production |
Basic rate request to compare shipping options and prices
<?xml version="1.0" encoding="UTF-8"?> <shipments> <authentication>317ad2da332f65569b172c77b9565bda</authentication> <version>2.0</version> <user> <email>user@example.com</email> <password>51f740668efd21ab9ec1d0d382d9746e</password> </user> <shipment orderBy="price"> <sender> <zipcode>1511AN</zipcode> <city>Nijmegen</city> <country>NL</country> <type>business</type> </sender> <receiver> <zipcode>12345</zipcode> <city>Amsterdam</city> <country>NL</country> <type>business</type> </receiver> <content> <colli> <description>Test package</description> <weight>5</weight> <length>120</length> <width>100</width> <height>50</height> <value>100.00</value> <package>PACKAGE</package> <quantity>1</quantity> </colli> </content> <incoterm>DAP</incoterm> </shipment> </shipments>
Example response showing available shipping rates from different carriers
<?xml version="1.0" encoding="UTF-8"?> <rates> <rates> <status>ok</status> <shipment> <rate> <id>2b6d503497d9df6ff3c1a355f855e7b2</id> <carrierCode>UPF</carrierCode> <carrierName>UPS Freight</carrierName> <serviceLevelUid>f8246332-5b82-ad1e-1465-436137530c19</serviceLevelUid> <serviceLevel>Express FREIGHT</serviceLevel> <serviceCode>96</serviceCode> <serviceTime>00:00</serviceTime> <price>984.77</price> <weight>120</weight> <modality>express</modality> <info>UPS Freight - Express FREIGHT</info> <shop>false</shop> <dailyPickup>false</dailyPickup> <pickup>2024-03-15</pickup> <delivery>2024-03-18</delivery> <surcharges> <surcharge> <name>Ophaalkosten</name> <percentage>33.5</percentage> <price>137.59</price> </surcharge> </surcharges> </rate> </shipment> </rates> <environment>test</environment> </rates>
Creates one or more new shipments with the given pickup and delivery addresses and the given parcels.
Key Features:
Use Cases:
authentication required | string <password> ^[a-f\d]{32}$ Example: "317ad2da332f65569b172c77b9565bda" Authentication token for verifying the request | ||||||||||||||||||||||||
version required | string Example: "2.1" API version being used | ||||||||||||||||||||||||
required | object (User) Information about the user making the request | ||||||||||||||||||||||||
| |||||||||||||||||||||||||
required | Array of objects non-empty List of shipments to be processed | ||||||||||||||||||||||||
Array (non-empty)
|
status required | string Example: "ok" Status of the shipment request | ||||||||||||||||||||||||||||
required | object Detailed information about the shipment | ||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||
environment | string Example: "test" Environment in which the request was processed, omitted in production |
A basic example to get you started with a simple domestic shipment within the Netherlands
<?xml version="1.0" encoding="UTF-8"?> <shipments> <authentication>317ad2da332f65569b172c77b9565bda</authentication> <version>2.1</version> <user> <email>user@example.com</email> <password>51f740668efd21ab9ec1d0d382d9746e</password> </user> <shipment pay="false" waitForLabel="false" id="E-1887" orderBy="price"> <sender> <companyName>My Company</companyName> <contactPerson>John Sender</contactPerson> <street>Hoofdstraat</street> <number>123</number> <zipcode>1000AA</zipcode> <city>Amsterdam</city> <country>NL</country> <phone>+31612345678</phone> <email>sender@example.com</email> <type>business</type> </sender> <receiver> <companyName>Customer Corp</companyName> <contactPerson>Jane Receiver</contactPerson> <street>Kerkstraat</street> <number>456</number> <zipcode>2000BB</zipcode> <city>Rotterdam</city> <country>NL</country> <phone>+31687654321</phone> <email>receiver@example.com</email> <type>business</type> </receiver> <content> <colli> <description>Electronics package</description> <weight>2.5</weight> <length>30</length> <width>20</width> <height>15</height> <value>150.00</value> <package>PACKAGE</package> <quantity>1</quantity> </colli> </content> <reference>ORDER-2024-001</reference> </shipment> </shipments>
Example response when a shipment is successfully created and booked
<?xml version="1.0" encoding="UTF-8"?> <shipment> <status>ok</status> <order id="E-1887"> <number>240004885</number> <paid>true</paid> <details> <datePickup>2023-12-15</datePickup> <dateDelivery>2023-12-20</dateDelivery> <carrierCode>DPS</carrierCode> <carrierName>DPD Parcelshop</carrierName> <status>booked</status> <awb>5112060086107</awb> <trackAndTrace>https://www.cheapcargo.com/Data/TrackAndTrace?id=c3412900-ac53-423f-86dd-10eb8de25542&ajax=true</trackAndTrace> <commercialInvoiceUrl>https://www.cheapcargo.com/Order/CommercialInvoice?orderId=c3412900-ac53-423f-86dd-10eb8de25542</commercialInvoiceUrl> </details> </order> <environment>test</environment> </shipment>
Retrieve comprehensive status information and tracking details for your shipments.
Information Provided:
Status Types:
new
- Added to cart, not paidpaid
- Paid but not bookedbooked
- Paid, booked, and labeledcancel
- Canceled shipmentauthentication required | string <password> ^[a-f\d]{32}$ Example: "317ad2da332f65569b172c77b9565bda" Authentication token for verifying the request | ||||
version required | string Example: "1.9" API version being used | ||||
required | object (User) Information about the user making the request | ||||
| |||||
required | Array of objects non-empty List of status requests | ||||
Array (non-empty)
|
status required | string Example: "ok" Status of the request | ||||||||||||||||||||||||||||||||
required | object Information about the shipment label | ||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||
environment | string Example: "test" Environment in which the request was processed, omitted in production |
Check the status of a specific shipment using its order number
<?xml version="1.0" encoding="UTF-8"?> <shipments> <authentication>317ad2da332f65569b172c77b9565bda</authentication> <version>1.9</version> <user> <email>user@example.com</email> <password>51f740668efd21ab9ec1d0d382d9746e</password> </user> <status> <orderNumber>240004885</orderNumber> </status> </shipments>
Comprehensive status response including tracking history and shipment details
<?xml version="1.0" encoding="UTF-8"?> <status> <status>ok</status> <label> <orderNumber>240004885</orderNumber> <paid>true</paid> <details> <datePickup>2024-05-15</datePickup> <dateDelivery>2024-05-17</dateDelivery> <carrierCode>DPS</carrierCode> <carrierName>DPD Parcelshop</carrierName> <totalNet>9.8</totalNet> <insurance>0.01</insurance> <weight>2</weight> <status>booked</status> <awb>5112060086107</awb> <pickup> <plannedDate>2024-05-15</plannedDate> <code>CFX-97</code> </pickup> <trackAndTrace> <url>https://www.cheapcargo.com/Data/TrackAndTrace?id=45cf567a-d29c-c362-4d29-90c3ca3f6a82&ajax=true</url> <statuses> <status> <status>inTransit</status> <message>Departed from Facility</message> <occurred>2023-12-15 13:37:00</occurred> </status> </statuses> </trackAndTrace> </details> </label> <environment>test</environment> </status>
Download shipping labels for your booked shipments.
Label Options:
pdf
- Standard label formatpdfa4
- A4 format for easy printingFeatures:
Requirements:
booked
statusauthentication required | string <password> ^[a-f\d]{32}$ Example: "317ad2da332f65569b172c77b9565bda" Authentication token for verifying the request | ||||
version required | string Example: "1.6" API version being used | ||||
required | object (User) Information about the user making the request | ||||
| |||||
required | Array of objects non-empty List of labels to be requested | ||||
Array (non-empty)
|
status required | string Example: "ok" Status of the label creation request | ||||||
required | object Information about the created label | ||||||
| |||||||
environment | string Example: "test" Environment in which the request was processed, omitted in production |
Download a shipping label for a booked shipment
<?xml version="1.0" encoding="UTF-8"?> <labels> <authentication>317ad2da332f65569b172c77b9565bda</authentication> <version>1.6</version> <user> <email>user@example.com</email> <password>51f740668efd21ab9ec1d0d382d9746e</password> </user> <labels> <orderNumber>240004885</orderNumber> <type>pdf</type> </labels> </labels>
Response containing the download URL for the requested shipping label
<?xml version="1.0" encoding="UTF-8"?> <labels> <status>ok</status> <label> <number>240004885</number> <type>pdf</type> <url>https://labels.cheapcargo.com/2024/05/14/45cf567a-d29c-c362-4d29-90c3ca3f6a82/label10x21.pdf</url> </label> <environment>test</environment> </labels>
Cancel one or more shipments using their order numbers.
Cancellation Rules:
new
, paid
, or booked
status can be canceledWhat Happens:
cancel
Best Practices:
authentication required | string <password> ^[a-f\d]{32}$ Example: "317ad2da332f65569b172c77b9565bda" Authentication token for verifying the request | ||||
version required | string Example: "2.1" API version being used | ||||
required | object (User) Information about the user making the request | ||||
| |||||
required | Array of objects non-empty List of cancel requests | ||||
Array (non-empty)
|
status required | string Example: "ok" Status of the shipment request | ||||
required | object Information about the canceled shipment | ||||
| |||||
environment | string Example: "test" Environment in which the request was processed, omitted in production |
Cancel a specific shipment using its order number
<?xml version="1.0" encoding="UTF-8"?> <shipments> <authentication>317ad2da332f65569b172c77b9565bda</authentication> <version>2.1</version> <user> <email>user@example.com</email> <password>51f740668efd21ab9ec1d0d382d9746e</password> </user> <order id="E-1887"> <orderNumber>240004885</orderNumber> </order> </shipments>
Confirmation response when a shipment is successfully canceled
<?xml version="1.0" encoding="UTF-8"?> <shipment> <status>ok</status> <order id="E-1887"> <number>240004885</number> </order> <environment>test</environment> </shipment>