Carrier Integrations APIs

Modified on Wed, 1 Oct at 8:43 PM

Check OTO Delivery Fee

Endpoint URL
POST https://api.tryoto.com/rest/v2/checkOTODeliveryFee
Example Request Body

Here is an example of a request body:

{
  "originCity": "ar rass",
  "destinationCity": "Riyadh",
  "boxes": [
    {
      "width": 40,
      "length": 40,
      "height": 30,
      "weight": 3,
      "boxName": "Box1"
    },
    {
      "width": 25,
      "length": 25,
      "height": 30,
      "weight": 7,
      "boxName": "Box2"
    }
  ]
}
Request Parameters
NameRequiredTypeDescription
originCityyesstringpickup city
destinationCityyesstringdestination city
originLatnonumberreqired for `bullet` type
originLonnonumberreqired for `bullet` type
destinationLatnonumberreqired for `bullet` type
destinationLonnonumberreqired for `bullet` type
weight\*yesnumberapproximate weight of package(kg)
forReverseShipmentnobooleanWhen you set is true, it will list the delivery companies that you can create reverse shipments.
currencynostringISO 4217 code, "SAR","KWD", etc
packageCountnonumber1
totalDuenonumbercash on delivery amount
lengthnonumberlength of the package(cm)
widthnonumberwidth of the package(cm)
heightnonumberheight of the package(cm)
serviceTypenoenum`express`,`sameDay`, `fastDelivery`, `coldDelivery`,`heavyAndBulky`, `electronicAndHeavy`
deliveryTypenoenum`toCustomerDoorstep pickupByCustomer toCustomerDoorstepOrPickupByCustomer`

Available Packages : All Packages

This API endpoint calculates shipping prices offered by OTO rates. By providing the origin city, destination city, and package details (such as weight and dimensions), the API computes the price based on the provided request parameters.

##### Important Note:

The prices returned by this API are applicable only to shipping options available under OTO's contracts.

To calculate prices for your own custom contracts, please use the Check Delivery Fee API.

You can see the shipping prices of delivery companies regarding to your account's country information.

##### Pricing Calculation Details:

The price is determined based on the greater value between the actual weight and the volumetric weight of the package.

Be sure to include the larger of these two values in your request.

Request Parameters: |


Check Delivery Fee

Endpoint URL
POST https://api.tryoto.com/rest/v2/checkDeliveryFee
Example Request Body

Here is an example of a request body:

{
  "weight": "50",
  "totalDue": 10,
  "originCity": "Riyadh",
  "destinationCity": "Jeddah",
  "height": 170,
  "width": 50,
  "length": 50
}
Request Parameters
NameRequiredTypeDescription
originCityyesstringpickup city
destinationCityyesstringdestination city
weightyesnumberweight of package
totalDuenonumbercash on delivery amount
deliveryTypenoenum`bullet`,`courier`
originLatnostringreqired for `bullet` type
originLonnostringreqired for `bullet` type
destinationLatnostringreqired for `bullet` type
destinationLonnostringreqired for `bullet` type

Available Packages: All Packages

This API endpoint calculates contract based pricing using your own rates. By providing the origin city, destination city, and package details such as weight and dimensions, the API determines the price based on the supplied parameters.

Important Note: The prices returned by this API apply exclusively to your own contracts.

Request Parameters: |


Get Delivery Fee

Endpoint URL
POST https://api.tryoto.com/rest/v2/getDeliveryFee
Example Request Body

Here is an example of a request body:

{
  "orderId": "OID-22700-1006"
}
Request Parameters
NameRequiredTypeDescription
orderIdyesstringId of the order
deliveryCompanySettingsIdnostringDelivery Company settings id

Available Packages: All Packages

This API endpoint calculates the shipping fee for a specific order in OTO. It offers two methods for price calculation:

1. By Order ID: Provide the orderId, and the API will return all possible shipping rates for each defined shipping company.

2. By Delivery Option ID: Provide the deliveryOptionId to calculate the shipping fee for a specific shipping company. You can get this information from checkOTODeliveryFee or from checkDeliveryFee endpoints.

Request Parameters: |


Get Delivery Estimation

Endpoint URL
POST https://api.tryoto.com/rest/v2/getDeliveryEstimation
Example Request Body

Here is an example of a request body:

{
  "calculationData": {
    "originAddress": {
      "city": "Riyadh",
      "country": "SA",
      "lat": 45,
      "lon": 45,
      "district": ""
    },
    "destinationAddress": {
      "city": "Riyadh",
      "country": "SA",
      "lat": 45,
      "lon": 45,
      "district": ""
    }
  },
  "deliveryCompanySettingsId": 1233,
  "slaMethodType": "CITY_BASED"
}
Request Parameters
NameRequiredTypeDescription
calculationDatayesJSONObjectAttributes will be used to calculate estimations
deliveryCompanySettingsIdnonumberTo ask for specific contract
slaMethodTypenoenumTo filter contracts based on the SLA Calculation Method. Enum list: \["BULLET_KM","CITY_BASED","DISTRICT_BASED","KM_BASED","TIER_BASED"\]
NameRequiredTypeDescription
cityyesstringPickup city and destination city separately
countryyesstringPickup country and destination country separately
latnonumberReqired for bullet type
lonnonumberReqired for bullet type
districtnonumberReqired for dtistrict based sla

Available Packages: Scale Package, Enterprise Package, Marketplaces

This API endpoint allows you to access estimated delivery dates, times, and other last mile process details by utilizing the SLA configurations of your shipping partners. By providing key information such as the pickup and customer addresses, you can retrieve precise delivery and pickup date estimates. This capability enhances the accuracy of your shipping operations and proves invaluable for businesses and logistics providers aiming to streamline workflows and deliver reliable delivery timelines to their customers.

Request Parameters: |

Request Paramaters: originAddress and destinationAddress |


Check Coverage

Endpoint URL
POST https://api.tryoto.com/rest/v2/checkCoverage
Example Request Body

Here is an example of a request body:

{
  "lat": "24.28738403",
  "lon": "46.44305038",
  "city": "Riyadh"
}
Request Parameters
NameRequiredTypeDescription
cityyesstringCity to check coverage
latyeslongLatitude
lonyeslongLongitude
packageSizenostring`small`,`medium`,`large`,`simcard`,`iphone13`,

Available Packages : Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint allows you to verify whether the location provided in your request is within the coverage area defined by your OTO settings, including the coverage configurations for delivery companies and the branches.

Request Parameters: |


Available Cities

Endpoint URL
POST https://api.tryoto.com/rest/v2/availableCities
Example Request Body

Here is an example of a request body:

{
  "limit": 3
}
Request Parameters
NameRequiredTypeDescription
pagenonumberNumber of page, default is 1
limitnonumberNumber of cities in a single page, default is 100

Available Packages : Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint retrieves a list of cities available for delivery based on your coverage settings for active delivery companies you have contracts with. To obtain results, ensure that the delivery companies' coverage areas are configured by adding cities through the OTO UI.

Request Parameters: |


Available Time Slots

Endpoint URL
POST https://api.tryoto.com/rest/v2/availableTimeslots
Example Request Body

Here is an example of a request body:

{
  "serviceType": "bullet",
  "packageSize": "simCard",
  "lat": "24.00",
  "lon": "46.00"
}
Request Parameters
NameRequiredTypeDescription
latnostringLatitude
lonnostringLongitude
serviceTypeyesstringPossible values: `bullet`,`courier`
packageSizenostring

Available Packages : Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint retrieves the available delivery time slots for delivery companies based on their specified working hours.

Request Parameters: |


DC List

Endpoint URL
POST https://api.tryoto.com/rest/v2/dcList

Available Packages: Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint provides a list of all delivery companies integrated with OTO. If you have a contract with any of these companies, you can connect your account to OTO. Use the company's unique code to configure settings through the DC Activation and DC Config API endpoints.

If a delivery company you have a contract with is not listed, please notify us to initiate the integration process.


DC Config

Endpoint URL
POST https://api.tryoto.com/rest/v2/dcConfig
Example Request Body

Here is an example of a request body:

{
  "code": "aramex"
}
Request Parameters
NameRequiredTypeDescription
codeyesstringThe integration name obtained from the DC List.

Available Packages : Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint allows you to view the required account credentials and the template for the delivery company specified in the request, which are needed for the next step: DC activation.

Retrieve the delivery company configuration template.

Use this template to create a valid configuration object, similar to the given `exampleJson`.

This configuration object is then used to activate the delivery company with the `DC Activation` API endpoint.

Request Parameters: |


DC Activation

Endpoint URL
POST https://api.tryoto.com/rest/v2/dcActivation
Example Request Body

Here is an example of a request body:

{
  "code": "aramex",
  "deliveryOptionName": "api test aramex",
  "settings": {
    "ClientInfo": {
      "UserName": "apitest@example.com",
      "Version": "v1",
      "AccountPin": "123",
      "AccountCountryCode": "SA",
      "AccountEntity": "RUH",
      "Source": 24,
      "Password": "123abc",
      "AccountNumber": "123456"
    },
    "productType": "CDS"
  }
}
Request Parameters
NameRequiredTypeDescription
codeyesstringThe integration name obtained from the `DC List.`
deliveryOptionNameyesstringA name you assign to easily identify this configuration.
brandIdnonumberid of the brand created by `Create Brand` endpoint
settingsyesobjectA configuration object created based on the example provided by the `DC Config` endpoint.

Available Packages: Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint is used to perform Delivery Company (DC) activation. It enables you to activate a delivery company by providing the required configuration details.

Request Parameters: |

Note: You can activate 1 DC for the Free package and 3 DC for the Starter package and unlimited for other packages.


Get Delivery Options

Endpoint URL
GET https://api.tryoto.com/rest/v2/getDeliveryOptions
Request Parameters
NameRequiredTypeDescription
citynostringCheck coverage in the city.
orderIdnostringCheck coverage for that specific order.

Available Packages: Starter Package, Scale Package, Enterprise Package, Marketplaces

This API endpoint allows you to check coverage for your active delivery company contracts by providing either the `orderId` or the `city` details. Follow these guidelines:

Important: Do not include both `orderId` and `city` in the same request, as this will result in an error.

Ensure your request contains only one of these parameters to proceed successfully.

Request Parameters: |


Get Cities

Endpoint URL
POST https://api.tryoto.com/rest/v2/getCities
Example Request Body

Here is an example of a request body:

{
  "country": "SA",
  "perPage": 10,
  "page": 1
}
Request Parameters
NameRequiredTypeDescription
countryyesstringThe country for which cities are to be retrieved.
perPagenointegerThe number of cities to be displayed per page. Default value is 100, max value is 500.
pagenointegerThe page number for pagination.

Available Packages: All Packages

This API endpoint is used to retrieve a list of cities of a given country.

Request Parameters: |

Example Response:

``` json

{

"getCities": {

"totalCount": 1,

"perPage": 1,

"Cities": [

{

"name": "Riyadh"

}

]

}

}

```


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article