API Documentation - Introduction

uRoute Application Programming Interface (API) enables your application to communicate directly with uRoute to perform common tasks such as create, cancel deliveries without the need for any manual data entry or human intervention. Our API provides an easy HTTP interface to uRoute functionality.

Authentication

To authorize, use this code:


{
    "api_key": "UROUTE_API_KEY",
    "secret_key": "UROUTE_SECRET_KEY",
    "website_url": "WEBSITE_DOMAIN"
}

The above command returns JSON structured like this:


{
    "data": {
        "access_token": "USER_ACCESS_TOKEN"
    },
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Access token successfully received."
}

Make sure to replace UROUTE_API_KEY, UROUTE_SECRET_KEY, WEBSITE_DOMAIN with your inputs.

uRoute API uses API key and Secret key to authenticate and generate access token. You can view and manage your API key and Secret key in the Customer account.

Your API keys carry many privileges, so be sure to keep them secure! Do not share your secret API keys in publicly accessible areas such as GitHub, client-side code, and so forth.

Authentication to the API is performed via HTTP Basic Auth. Provide your API key as the basic auth username value. You do not need to provide a password.

HTTP Request

POST http://stg.uroute.co/api/merchant/auth/

JSON Input Parameters

Parameter Description
api_key uRoute API Key
secret_key uRoute Secret Key
website_url Your website URL

Delivery Type Service List

Get All Delivery Type

Delivery Type Service List:


{
    "access_token": "UROUTE_API_ACCESS_TOKEN"
}

The above command returns JSON structured like this:


{
    "data": {
        "delivery_type": [
            {
                "id_delivery_type": 1,
                "delivery_type": "3Hrs Express"
            },
            {
                "id_delivery_type": 2,
                "delivery_type": "Same Day Collection"
            }
            ...
            ...
            ...
        ]
    
    },
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Delivery type successfully received."
}

Make sure to replace UROUTE_API_ACCESS_TOKEN with your inputs.

This API is used to list down all the delivery types available at uRoute.

HTTP Request

POST http://stg.uroute.co/api/merchant/delivery-type-service-list/

JSON Input Parameters

Parameter Description
access_token uRoute API Access Token.

Parcel Size List

Get All Parcel Size

Parcel Size List:


{
    "access_token": "UROUTE_API_ACCESS_TOKEN"
}

The above command returns JSON structured like this:


{
    "data": {
        "size_list": [
            {
                "id_size": 1,
                "title": "Documents"
            },
            {
                "id_size": 2,
                "title": "<60 cm (H+L+W) & max 1kg"
            },
            {
                "id_size": 3,
                "title": "<80 cm (H+L+W) & max 5kg"
            },
            {
                "id_size": 4,
                "title": "<100 cm (H+L+W) & max 8kg"
            }
            ...
            ...
            ...
        ]
    
    },
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Size list successfully received."
}

Make sure to replace UROUTE_API_ACCESS_TOKEN with your inputs.

This API is used to list down all the parcel size types available at uRoute.

HTTP Request

POST http://stg.uroute.co/api/merchant/parcel-size-list/

JSON Input Parameters

Parameter Description
access_token uRoute API Access Token.

Job Status List

Job Status List:


{
    "access_token": "UROUTE_API_ACCESS_TOKEN"
}

The above command returns JSON structured like this:


{
    "data": {
        "job_status": [
            {
                "id_status": 4,
                "status": "Pending Acceptance"
            },
            {
                "id_status": 5,
                "status": "Pick up in Progress"
            },
            {
                "id_status": 6,
                "status": "Picked"
            },
            {
                "id_status": 7,
                "status": "Item Picked Up"
            },
            {
                "id_status": 8,
                "status": "Delivered"
            },
            {
                "id_status": 9,
                "status": "Undelivered"
            }
        ]
    
    },
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Job status successfully received."
}

Make sure to replace UROUTE_API_ACCESS_TOKEN with your inputs.

This API is used to list down all possible job status available at uRoute.

HTTP Request

POST http://stg.uroute.co/api/merchant/job-status-list/

JSON Input Parameters

Parameter Description
access_token uRoute API Access Token.

Order Create

Order Create:


{
    "access_token": "UROUTE_API_ACCESS_TOKEN",
    "delivery_package": [
        {
            "contact_number": "12345678",
            "delivery_address": "#07-406, 470A Fernvale Link, Singapore 791470",
            "delivery_pincode": "791470",
            "delivery_type": 1,
            "name": "Curb",
            "email": "curb@uparcel.sg",
            "weight": {
                "units": "kg",
                "value": "10"
            },
            "quantity": 1
            "pin_code": "DELIVERY OTP"
        },
        {
            "contact_number": "12345678",
            "delivery_address": "#07-406, 470A Fernvale Link, Singapore 791470",
            "delivery_pincode": "791470",
            "delivery_type": 1,
            "name": "Curb",
            "email": "curb@uparcel.sg",
            "weight": {
                "units": "kg",
                "value": "10"
            },
            "quantity": 1
            "pin_code": "DELIVERY OTP"
        },
        ...
        ...
        ...
    ],
    "order_id": "MERCHANT ORDER ID",
    "api_response_url": "STATUS UPDATE WEBHOOK URL",
    "pickup_detail": {
        "contact_number": "12345678",
        "name": "Curb"
        "email": "Curb@uparcel.sg"
        "pickup_address": "#04-13, Sengkang Square, Compass One, Singapore"
        "pickup_pincode": "545078"
        "pickup_remark": "Test Job"
        "vehicle_type": "all"
    }
}

The above command returns JSON structured like this:


{
    "data": {
        "tracking_number": [
            "TRACKING CODE 1",
            "TRACKING CODE 2",
            ...
            ...
            ...
        ]
        "delivery_date": "2022-02-25"
        "delivery_time": "04:00 PM-12:00 AM"
    
    },
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Order successfully placed."
}

Make sure to replace UROUTE_API_ACCESS_TOKEN, MERCHANT ORDER ID, STATUS UPDATE WEBHOOK URL, DELIVERY OTP with your inputs.

This API is used to post jobs in uRoute system.

HTTP Request

POST http://stg.uroute.co/api/merchant/order-create/

JSON Input Parameters

Parameter Description
access_token uRoute API Access Token.
delivery_package Delivery information that includes
name: Name of Receiver
email: Email of Receiver
contact_number: Contact Number of Receiver
delivery_address: Delivery Address of Receiver
delivery_pincode: Delivery Postal Code
delivery_type: Selected Delivery Type, You can get delivery type value from Delivery Type List Service API
parcel weight: Weight(IN KG) and Unit in KG,
parcel quantity: Number of parcels
pin_code(Optional): This is delivery OTP, delivery agent need to enter during job status update to deliver..
order_id This is your system's(store/website) order id, that we can use in further status update.
api_response_url This is order status webhook url, when job status update in uRoute system we will trigger status update to webhook url in POST method.
pickup_detail Pickup information that includes name, email, contact_number, pickup_address, pickup_pincode, pickup_remark, and vehicle_type.

Order Cancel

Order Cancel:


{
    "access_token": "UROUTE_API_ACCESS_TOKEN",
    "access_token": "MERCHANT ORDER ID"
}

The above command returns JSON structured like this:


{
    "data": [],
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Order successfully canceled."
}

Make sure to replace UROUTE_API_ACCESS_TOKEN, MERCHANT ORDER ID with your inputs.

This API is used to cancel the already submitted order.

HTTP Request

POST http://stg.uroute.co/api/merchant/order-cancel/

JSON Input Parameters

Parameter Description
access_token uRoute API Access Token.
order_id This is your system's(store/website) order id required to cancel the job.

Parcel Track Status

Parcel Track Status:


{
    "access_token": "UROUTE_API_ACCESS_TOKEN"
    "tracking_number": "TRACKING CODE"
}

The above command returns JSON structured like this:


{
    "data": [
        {
            "tracking_code": "TRACKING CODE",
            "remarks": "",
            "receiver_name": "",
            "image_name": "",
            "created_date": "2022-02-17 11:42 AM",
            "general_status_label": "Pending Acceptance",
        },
        ...
        ...
        ...
    ],
    "result": "SUCCESS",
    "errors": [],
    "status": 200,
    "message": "Parcel status successfully listed."
}

Make sure to replace UROUTE_API_ACCESS_TOKEN, TRACKING CODE with your inputs.

This API is used to track the parcel, and to get the status of the parcel.

HTTP Request

POST http://stg.uroute.co/api/merchant/parcel-track-status/

JSON Input Parameters

Parameter Description
access_token uRoute API Access Token.
tracking_number uRoute Job tracking code, you will get this token in response of Order Create API.

Errors

uRoute uses conventional HTTP response codes to indicate the success or failure of an API request. In general: Codes in the 2xx range indicate success. Codes in the 4xx range indicate an error that failed given the information provided (e.g., a required parameter was omitted, a charge failed, etc.). Codes in the 5xx range indicate an error with uRoute's servers (these are rare).

Error Code Meaning
200 - OK Everything worked as expected.
400 - Bad Request The request was unacceptable, often due to missing(incorrect) a required parameter.
401 - Unauthorized No valid API key provided.
402 - Request Failed The parameters were valid but the request failed.
403 - Forbidden The API key doesn't have permissions to perform the request.
404 - Not Found The requested resource doesn't exist.
409 - Conflict The request conflicts with another request (perhaps due to using the same idempotent key).
429 - Too Many Requests Too many requests hit the API too quickly. We recommend an exponential backoff of your requests.
500, 502, 503, 504 - Server Errors Something went wrong on uRoute's end. (These are rare.)

Delight Your Customers With Fast Deliveries & Accurate ETAs