Getting the current cart

Learn how to get the active current cart for a specified token.

You must send a GET /v1/shoppers/me/carts/active request to obtain the details of a shopper's currently active shopping cart. It will return a JSON response with all the relevant cart information, such as product details, pricing, and applicable taxes. The following sections provide step-by-step instructions on how to retrieve the active cart using a simple cURL command.

To get the current cart, send a GET /v1/shoppers/me/carts/active request with the appropriate headers. Replace {Your_API_Key} with your actual API key. Use the following cURL command to retrieve the active cart for a specified token:

curl --location -g --request GET ' https://api.digitalriver.com/v1/shoppers/me/carts/active' \
--header 'Accept: application/json' \
--header 'Authorization: Basic {Your_API_Key}' \
--header 'Content-Type: application/json'

The 200 OK response from the GET /v1/shoppers/me/carts/active request details on various aspects of the active cart. If the product is a product combination, the combined product information appears under the lineItem object, and component information appears under the components object.

Key information

The key information in the JSON response from the GET /v1/shoppers/me/carts/active request includes:

  • cart: The main object containing all the details about the active shopping cart.

    • uri: The API endpoint to access the current cart details.

    • paymentMethods: This object includes the payment information displayed when using a Payment Source created payment.

    • webCheckout: URL for initiating a web-based checkout.

    • id: A unique identifier assigned to the cart.

    • lineItems: This object includes of products in the cart, including their details such as name, quantity, and pricing.

    • totalItemsInCart: The total number of items in the cart.

    • billingAddress and shippingAddress: These objects include the cart's billing and shipping addresses.

    • pricing: A summary of the cart's costs, including subtotal, discounts, shipping, taxes, and order total.

Last updated