Close
logo

Calculating Rates

Git RepositoryEdit on Github
Last update: 2 years ago by luigi mangaReading time: 2 min

Whether you are integrating Onport with a custom channel or customizing an existing one by implementing a custom checkout flow, you may need to look up the Shipping Rates as they are calculated by Onport.

This can be accomplished by making a POST call to https://rates.jetti.io/api/channels/:id/rates.json where :id is the Onport Channel id.

The destination address needs to be sent as payload as well as the SKU and quantity of the different items being shipped.

{
"rate": {
"destination": {
"country": "US",
"postal_code": "20500",
"province": "DC",
"city": "Washington",
"name": "Test",
"address1": "1600 Pennsylvania Avenue NW",
"address2": null,
"phone": "14441112233",
"fax": null,
"address_type": null,
"company_name": null
},
"items": [
{
"sku": "c1235mgb1",
"quantity": "1"
}
],
"currency": "USD"
},
"options": {
"scope": "sku"
}
}

Onport will return the rates as well as additional details for each shipment needed to deliver the items entered in the payload. In case there are multiple options, Onport will also return the alternative shipment methods available.

๐Ÿ“ฆ Shipping โ€” Previous
Custom tracking integrations
Next โ€” ๐Ÿ“ฆ Shipping
Generating Shipping Labels