Fetch Shipping Rates
1 min
GET
https://api.upstartcommerce.com/v1/order/{orderId}/shipments/{shipmentId}/rates
Path Parameters
- orderIdstring<uuid>requiredDescriptionFormatuuid
- shipmentIdstring<uuid>requiredDescriptionFormatuuid
Header Parameters
- x-upstart-tenantstringrequiredDescription
Responses
200
- ShipmentAlternativeRatesResponse
- idstring<uuid>requiredFormatuuid
- shipmentRatesOrderShipmentRatesResponse[]required
- idstring<uuid>requiredFormatuuid
- shippingMethodIdstring<uuid>requiredFormatuuid
- shippingMethodNamestring
- shippingMethodTaxCodestring
- trackingNumberstring
- addressFromAddressDescription
- street1stringrequired
- street2string
- citystringrequired
- countystring
- stateOrRegionstringrequired
- countrystringrequiredDescriptionMin Length2Max Length2
- postalCodestringrequired
- poBoxbooleanrequiredDefaultfalse
- nameName
- firststringrequiredExampleDescription
- laststringrequiredExampleDescription
- middleInitialstringExampleDescription
- salutationstringExampleDescription
- suffixstringExampleDescription
- businessNamestring
- phoneNumberstring
- locationFromIdstring
- addressToAddressDescription
- street1stringrequired
- street2string
- citystringrequired
- countystring
- stateOrRegionstringrequired
- countrystringrequiredDescriptionMin Length2Max Length2
- postalCodestringrequired
- poBoxbooleanrequiredDefaultfalse
- nameName
- firststringrequiredExampleDescription
- laststringrequiredExampleDescription
- middleInitialstringExampleDescription
- salutationstringExampleDescription
- suffixstringExampleDescription
- businessNamestring
- phoneNumberstring
- locationToIdstring
- shippingToDistanceDistanceDescription
- valuenumber<double>requiredExampleDescriptionFormatdouble
- unitDistanceUnitsrequiredDescription
- rateServiceCodestring
- rateVariantsShippingRate[]required
- rateIdstringrequired
- carrierIdstringrequired
- pricingShippingRatePricingrequired
- shippingnumberrequired
- insurancenumber
- confirmationnumber
- othernumber
- feenumber
- packageTypestring
- deliveryDaysinteger<int32>Formatint32
- estimatedDeliveryDatestring<date-time>Formatdate-time
- carrierDeliveryDatesstringrequired
- shipDatestring<date-time>Formatdate-time
- serviceTypestringrequired
- serviceCodestringrequired
- carrierCodestringrequired
- packagesShippingPackage[]required
- dimensionsDimensionsDescription
- widthnumber<double>requiredExampleFormatdouble
- lengthnumber<double>requiredExampleFormatdouble
- heightnumber<double>requiredExampleFormatdouble
- unitstring<cm | m | in | mm>requiredAllowedcmminmm
- insuredValuenumber
- packageCodestring
- weightWeightrequiredDescription
- valuenumber<double>requiredFormatdoubleMinimum0
- unitstring<g | kg | lb>requiredDescriptionAllowedgkglb
- trackingNumberstring
- errorsErrorMessage[]requiredDescription
- codestringrequiredDescription
- detailstringDescription
- levelstring<ERROR | INFO | WARNING>requiredDescriptionAllowedERRORINFOWARNING
- messagestringDescription
- errorsErrorMessage[]requiredDescription
- codestringrequiredDescription
- detailstringDescription
- levelstring<ERROR | INFO | WARNING>requiredDescriptionAllowedERRORINFOWARNING
- messagestringDescription
401
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
404
- ErrorResponse
- namestringrequired
- codestringrequired
- detailstringrequired
- reasonstring
curl
curl --request GET \
--url https://api.upstartcommerce.com/v1/order/{orderId}/shipments/{shipmentId}/rates \
--header 'accept: application/json' \
--header 'x-upstart-tenant: string'javascript
var myHeaders = new Headers();
myHeaders.append("accept", "application/json");
myHeaders.append("content-type", "application/json");
myHeaders.append("x-upstart-tenant", "string");
var requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow'
};
fetch("https://api.upstartcommerce.com/v1/order/{orderId}/shipments/{shipmentId}/rates", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));ruby
require "uri"
require "json"
require "net/http"
url = URI("https://api.upstartcommerce.com/v1/order/{orderId}/shipments/{shipmentId}/rates")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["accept"] = "application/json"
request["content-type"] = "application/json"
request["x-upstart-tenant"] = "string"
response = https.request(request)
puts response.read_body
python
import requests
import json
url = "https://api.upstartcommerce.com/v1/order/{orderId}/shipments/{shipmentId}/rates"
payload = {}
headers = {
'accept': 'application/json',
'content-type': 'application/json',
'x-upstart-tenant': 'string'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
200
// Success-shipping rates returned.
{
"id": "",
"shipmentRates": [
{
"id": "",
"shippingMethodId": "",
"shippingMethodName": "",
"shippingMethodTaxCode": "",
"trackingNumber": "",
"addressFrom": {
"street1": "",
"street2": "",
"city": "",
"county": "",
"stateOrRegion": "",
"country": "",
"postalCode": "",
"poBox": false,
"name": {
"first": "John",
"last": "Smith",
"middleInitial": "D.",
"salutation": "Capt.",
"suffix": "Sr."
},
"businessName": "",
"phoneNumber": ""
},
"locationFromId": "",
"addressTo": {
"street1": "",
"street2": "",
"city": "",
"county": "",
"stateOrRegion": "",
"country": "",
"postalCode": "",
"poBox": false,
"name": {
"first": "John",
"last": "Smith",
"middleInitial": "D.",
"salutation": "Capt.",
"suffix": "Sr."
},
"businessName": "",
"phoneNumber": ""
},
"locationToId": "",
"shippingToDistance": {
"value": 157.75,
"unit": ""
},
"rateServiceCode": "",
"rateVariants": [
{
"rateId": "",
"carrierId": "",
"pricing": {
"shipping": 0,
"insurance": 0,
"confirmation": 0,
"other": 0,
"fee": 0
},
"packageType": "",
"deliveryDays": "",
"estimatedDeliveryDate": "",
"carrierDeliveryDates": "",
"shipDate": "",
"serviceType": "",
"serviceCode": "",
"carrierCode": ""
}
],
"packages": [
{
"dimensions": {
"width": 18.5,
"length": 18.5,
"height": 18.5,
"unit": ""
},
"insuredValue": 0,
"packageCode": "",
"weight": {
"value": "",
"unit": ""
},
"trackingNumber": ""
}
],
"errors": [
{
"code": "",
"detail": "",
"level": "",
"message": ""
}
]
}
],
"errors": [
{
"code": "",
"detail": "",
"level": "",
"message": ""
}
]
}401
// The provided credentials were not valid for this endpoint. It may be that they are expired or that the user's roles are insufficient.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}404
// The requested resource was not found in the NoChannel system.
{
"name": "",
"code": "",
"detail": "",
"reason": ""
}