Cart Calculation

The Cart Calculation request enables you to perform updates to the checkout price prior to completing a transaction. This request is useful when your shopper has added a coupon and you want to provide the updated total immediately for your shopper. Other possible use cases for this service are when you need to display the impact of tax or shipping to your shoppers.



Request Content

cart-info    required, contains the following properties (see cart-info):

PropertyTypeRequired
cart-paramscontainerrequired (see cart-params)
cartcontainerrequired (see cart)
skucontainerrequired (see sku)
couponsintegeroptional

Response Details

If successful, the response HTTP status code is 200 OK.


Examples

Request Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/cart-calculation \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '

<cart-info xmlns="http://ws.plimus.com">
<cart-params>
<currency>USD</currency>
</cart-params>
<cart>
<cart-item>
<sku>
<sku-id>2180434</sku-id>
</sku>
<quantity>1</quantity>
</cart-item>
<coupons>
<coupon>ccv20</coupon>
</coupons>
</cart>
</cart-info>
curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/cart-calculation \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '

<cart-info xmlns="http://ws.plimus.com">
<cart-params>
<currency>USD</currency>
<country>US</country>
<state>CA</state>
<zip>12345</zip>
</cart-params>
<cart>
<cart-item>
<sku>
<sku-id>2176834</sku-id>
</sku>
<quantity>1</quantity>
</cart-item>
</cart>
</cart-info>

Response Examples

curl -v -X POST https://sandbox.bluesnap.com/services/2/tools/cart-calculation \
-H 'Content-Type: application/xml' \
-H 'Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=' \
-d '
<cart-info xmlns="http://ws.plimus.com">
<cart>
<charged-currency>USD</charged-currency>
<cart-item>
<sku>
<sku-id>2180434</sku-id>
</sku>
<quantity>1</quantity>
<item-sub-total>20.00</item-sub-total>
<item-coupon-total>10.00</item-coupon-total>
<item-total>10.00</item-total>
</cart-item>
<coupons>
<coupons-total>10.00</coupons-total>
</coupons>
<tax>0.00</tax>
<tax-rate>0</tax-rate>
<total-cart-cost>10.00</total-cart-cost>
</cart>
</cart-info>'
<!-- NOTE: Actual taxes may differ from this example -->

<!-- Response begins below -->
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<cart-info xmlns="http://ws.plimus.com">
<cart>
<charged-currency>USD</charged-currency>
<cart-item>
<sku>
<sku-id>2176834</sku-id>
</sku>
<quantity>1</quantity>
<item-sub-total>49.99</item-sub-total>
<item-coupon-total>0.00</item-coupon-total>
<item-total>49.99</item-total>
</cart-item>
<coupons>
<coupons-total>0.00</coupons-total>
</coupons>
<tax>4.12</tax>
<tax-rate>8.25</tax-rate>
<total-cart-cost>54.11</total-cart-cost>
</cart>
</cart-info>