API ReferenceCarts
Carts Calculate
Calculate cart summary.
Authorization
API Authentication Authorization<token>
Campaign token based authentication.
In: header
Query Parameters
upsell?boolean
Set to true when calculating from an upsell page; skips site-wide offers.
Response Body
application/json
curl -X POST "https://example.com/api/v1/carts/calculate/" \ -H "Content-Type: application/json" \ -d '{ "lines": [ { "package_id": 0 } ] }'{
"currency": "str",
"lines": [
{
"discounts": [
{
"amount": "string",
"description": "string",
"name": "string",
"offer_id": 0,
"percentage": "string"
}
],
"original_package_price": "string",
"original_unit_price": "string",
"package_id": 0,
"package_price": "string",
"quantity": 0,
"subtotal": "string",
"total": "string",
"total_discount": "string",
"unit_price": "string"
}
],
"offer_discounts": [
{
"amount": "string",
"description": "string",
"name": "string",
"offer_id": 0,
"percentage": "string"
}
],
"shipping_method": {
"code": "string",
"discounts": [
{
"amount": "string",
"description": "string",
"name": "string",
"offer_id": 0,
"percentage": "string"
}
],
"id": 0,
"name": "string",
"original_price": "string",
"price": "string"
},
"subtotal": "string",
"total": "string",
"total_discount": "string",
"voucher_discounts": [
{
"amount": "string",
"description": "string",
"name": "string",
"offer_id": 0,
"percentage": "string"
}
]
}