CheapCargo API (2.1)

Download the OpenAPI specification as JSON or YAML.

🚚 CheapCargo Shipping API

Welcome to the CheapCargo API documentation. This comprehensive guide will help you integrate our shipping services into your application for seamless logistics management.

šŸš€ Quick Start Guide

  1. Get API Access: Contact us to receive your API key
  2. Review Authentication: Understand our security requirements below
  3. Test with Rate Request: Start with a simple rate inquiry
  4. Create Your First Shipment: Book your first shipment
  5. Track & Manage: Monitor and manage your shipments

šŸ“„ Data Formats

The API supports both XML and JSON. Set the headers Accept and Content-Type to application/xml or application/json accordingly. The JSON format is a direct translation of the XML structure, where the XML root element becomes the top-level key in the JSON object.

XML attributes are represented as @attributeName fields in JSON. For example:

<shipment pay="false" id="E-1887">
  <reference>ORDER-001</reference>
</shipment>
{
  "shipment": {
    "@pay": false,
    "@id": "E-1887",
    "reference": "ORDER-001"
  }
}

Array elements such as shipment and colli are always represented as JSON arrays, even when there is only one item.

šŸ“‹ What You Can Do

  • šŸ’° Rate Requests: Get competitive shipping rates for your packages
  • šŸ“¦ Create Shipments: Book shipments with trusted carriers
  • šŸ“ Track Shipments: Real-time monitoring and status updates
  • šŸ·ļø Manage Labels: Download and print shipping labels
  • āš™ļø Cancel Shipments: Modify or cancel bookings when needed
  • šŸ‘¤ Manage Accounts: Create and manage user accounts

šŸ” Authentication

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.

Authentication Format

The authentication information will typically look as follows in the request body:

<authentication>317ad2da332f65569b172c77b9565bda</authentication>
<user>
  <email>user@example.com</email>
  <password>51f740668efd21ab9ec1d0d382d9746e</password>
</user>

Or in JSON:

{
  "authentication": "317ad2da332f65569b172c77b9565bda",
  "user": {
    "email": "user@example.com",
    "password": "51f740668efd21ab9ec1d0d382d9746e"
  }
}

Authentication Components

  • Authentication token (authentication):

    • The authentication token is generated by creating an MD5 hash of the user's API key followed by the current date and hour in the format YYYYMMDDHH.
    • The time part HH is based on a 24-hour format with a 2-hour margin. The time should be expressed in the time zone of the Netherlands (CET/CEST). 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):

    • This is the email address associated with the user's account, used for logging in.
  • Password hash (password):

    • The password should be hashed using the MD5 algorithm. CheapCargo would hash to 51f740668efd21ab9ec1d0d382d9746e.
  • User account number (accountNumber):

    • Instead of providing the user email address, the user account number can also be provided.

On Behalf of Another User

The API also supports performing requests on behalf of another user. This allows authorized partners or administrators to execute operations for other accounts without requiring their direct credentials. To do this, include an onBehalfOf element in the request body after the user element, specifying either the user's email address or account number. For example:

<onBehalfOf>
  <email>different_user@example.com</email>
</onBehalfOf>

or

<onBehalfOf>
  <accountNumber>260001337</accountNumber>
</onBehalfOf>

In JSON:

{
  "onBehalfOf": {
    "email": "different_user@example.com"
  }
}

or

{
  "onBehalfOf": {
    "accountNumber": "260001337"
  }
}

This functionality only works if the target user has explicitly authorized you to act on their behalf. Without this authorization, the API will reject the request with an authentication error.

It is recommended to use the account number instead of the email address whenever possible, because account numbers are permanent identifiers, while users can change their email addresses at any time.

šŸ“Š API Versioning

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.

Latest API Versions

EndpointCurrent VersionStatus
createShipment2.1āœ… Stable
rateRequest2.0āœ… Stable
getStatus1.9āœ… Stable
getLabel1.6āœ… Stable
cancelShipment2.1āœ… Stable
createAccount2.1āœ… Stable

šŸ“ž Support & Resources

Need help? Our support team is here to assist you:

  • Email: info@cheapcargo.com
  • Website: https://www.cheapcargo.com
  • Support Portal: https://support.cheapcargo.com

⚔ Rate Limits & Best Practices

  • Rate Limit: 100 requests per minute per API key
  • Timeout: 30 seconds per request
  • Retry Logic: Implement exponential backoff for failed requests
Servers
🌐 Production (Netherlands) - Live environment
https://www.cheapcargo.com/api
🌐 Production (Belgium) - Live environment
https://www.cheapcargo.be/api
🧪 Demo Environment (Netherlands) - Safe testing
https://www.cheapcargo-demo.nl/api
🧪 Demo Environment (Belgium) - Safe testing
https://www.cheapcargo-demo.be/api