Shopper APIs Cart Managing shipping options Getting shipping options Lear how to get shipping options.
Getting a shipping option by identifier
To get a shipping option by identifier , specify the shipping options identifier (shippingOptionsId
) in the URI path.
cURL 200 OK response
Copy curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options/{shippingOptionsId}' \
--header 'authorization: Basic ***\
...
Copy {
"shippingOptions" : {
"uri" : "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options" ,
"shippingOption" : [
{
"uri" : "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options/5858800" ,
"description" : "UPS" ,
"formattedCost" : "19.99USD" ,
"applyShippingOptionToCart" : {
"uri" : "https://api.digitalriver.com/v1/shoppers/me/carts/active/apply-shipping-option?shippingOptionId=5858800"
}
}
]
}
}
See Shipping options for more information.
Getting all shipping options
You can also get all shipping options .
cURL 200 OK response
Copy curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options' \
--header 'authorization: Basic ***\
...
Copy {
"shippingOption" : {
"uri" : "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options/142400" ,
"id" : 142400 ,
"description" : "UPS Ground" ,
"cost" : {
"currency" : "USD" ,
"value" : "19.99"
} ,
"formattedCost" : "19.99USD" ,
"applyShippingOptionToCart" : {
"uri" : "https://api.digitalriver.com/v1/shoppers/me/carts/active/apply-shipping-option?shippingOptionId=142400"
}
}
}
See shipping options query parameters for more information.
Shipping options
You can retrieve the shipping options for a cart or all shipping options . The shippingOptions
object in the response retrieves the discounted shipping rate based on the matching deployed shipping discount offer . A successful request returns the costWithDiscount
and formattedCostWithDiscount
.
The sum of the shipping cost with discounts.
formattedCostWithDiscount
The sum of the shipping cost with a discount in locale currency format (for example, $ 19.14). Contact your Digital River team to set up the currency symbol, decimal separator, and number of fractional digits for the formatted cost with discount amount.
JSON
Copy {
"shippingOption" : {
"uri" : "http://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options/167400" ,
"id" : 167400 ,
"description" : "Express" ,
"cost" : {
"currency" : "USD" ,
"value" : 12.5
} ,
"formattedCost" : "12.50USD" ,
"costWithDiscount" : {
"currency" : "USD" ,
"value" : 10.87
} ,
"formattedCostWithDiscount" : "10.87USD" ,
"applyShippingOptionToCart" : {
"uri" : "http://api.digitalriver.com/v1/shoppers/me/carts/active/apply-shipping-option?shippingOptionId=167400"
}
}
}
Last updated 8 months ago