How to use the Carriyo API

The host for Carriyo API requests is https://api.carriyo.com/.

All requests must be made over HTTPS. The API does not support HTTP.

You will need a Carriyo account to use the Carriyo API. Click here to sign up

API Authentication

Carriyo API supports OAuth2.0 authentication. To access any Carriyo API you must first get an Oauth Access Token.

Once you have the access token, you must pass the following headers to make an API call:

  • tenant-id: YOUR-TENANT-ID
  • x-api-key: YOUR-API-KEY
  • Authorization: Bearer YOUR-OAUTH-ACCESS-TOKEN

Make your first call

Follow these steps to make your first call to the Carriyo API

Step 1. Copy your Tenant ID and API Key from the Carriyo Dashboard

Login as a Carriyo admin to perform this action
Copy Tenant ID and API Key

Step 2. Create a new Client Application to get your Client ID and Client Secret

Login as a Carriyo admin to perform this action
Copy the Client ID and Client Secret

Step 3. Request for the Oauth Access Token using the Client ID and Client Secret

Use the cURL command below

Copy
Copied
curl --location --request POST 'https://api.carriyo.com/oauth/token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "client_id": "YOUR_CLIENT_ID",
    "client_secret": "YOUR_CLIENT_SECRET"
}'
Authentication Steps Complete

You now have the credentials to make your first API call

Step 4. Now call the Carriyo endpoint with the Tenant ID, API Key and Access Token

Let's try to create your first shipment.

Click here to see use the 'Try It' console to create your draft shipment

Or you can use the 'cURL' command below

Copy
Copied
curl --location --request POST 'https://api.carriyo.com/shipments/draft' \
--header 'Content-Type: application/json' \
--header 'x-api-key: YOUR_API_KEY' \
--header 'tenant-id: YOUR_TENANT_ID' \
--header 'Authorization: Bearer YOUR_OAUTH_ACCESS_TOKEN' \
--data-raw '{
    "references": {
        "partner_order_reference": "my_first_shipment_1",
        "partner_shipment_reference": "my_first_shipment_1"
    },
    "payment": {
        "payment_mode": "PRE_PAID",
        "total_amount": 100.0,
        "currency": "USD"
    },
    "items": [
        {
            "description": "CARRIYO T-SHIRT",
            "quantity": 1,
            "price": {
                "amount": 100.0,
                "currency": "USD"
            },
            "sku": "S12345"
        }
    ],
    "dropoff": {
        "contact_name": "My Customer",
        "contact_phone": "(+971)0501100997",
        "contact_email": "mycustomer@gmail.com",
        "address1": "101 Dubai Maina Promenade",
        "city": "DUBAI",
        "country": "AE",
        "coords": [
            24.2495705,
            55.6900005
        ]
    }
}'