LogoLogo
System Status
  • Commerce API
    • Test and use cases
    • Roles and permissions
    • Sending API calls
  • Shopper APIs
    • Shopper basics
      • Common use cases
        • Creating a customer
        • Applying store credit
        • Private store workflow
        • Guest checkout
    • OAuth
      • Authentication
      • OAuth 2.0 APIs
      • Token
      • Access tokens
      • Session-aware access tokens
      • Authorizing a shopper
    • Shoppers
      • Managing shoppers
        • User management
        • Single sign-on (SSO)
        • Data validation
        • Bulk user management
        • Bulk user account export
      • Managing a shopper's account
      • Managing a shopper's address
      • Managing payment options
    • Product discovery
      • Categories
      • Products
      • Product variations
      • Pricing
      • Inventory status
      • Financing
      • Offers
        • Understanding offers
        • How to use point of promotions (POPs)
          • Retrieving all point of promotion offers for a specific product
          • Retrieving all offers for a specific point of promotion
        • How to use offers
      • Private stores
        • Managing private stores
        • Submitting an order for a private store
        • Useful APIs
      • Fulfillment
        • Electronic Fulfillment Service (OFI)
        • Digital rights
        • Digital rights revocation
        • Physical fulfillment
          • EDI X12 832 definition data elements
          • EDI X12 846 definition data elements
          • EDI X12 850 definition data elements
          • EDI X12 855 definition data elements
          • EDI X12 856 definition data elements
          • EDI X12 180-1 definition data elements
          • EDI X12 180-2 definition of data elements
          • EDI X12 180-3 definition of data elements
    • Cart
      • Applying a shopper to a cart
      • Getting the current cart
      • Creating or updating a cart
        • Adding a product to a cart
          • Gifting
        • Capturing the customer's IP address
        • Providing address information
        • Managing the shipping or billing address
        • Providing subscription information
        • Managing payment methods
        • Capturing the Terms of Sale (TOS) acceptance
      • Managing offers in a cart
        • Applying an offer
        • Applying a coupon or promo code
        • Getting all applied offers
        • Removing an applied offer
        • Removing eligible offers
        • Reconciling conflicting offers
        • Dynamic offers/personalization
          • Skipping Global Commerce merchandising offer arbitration
          • Triggering a promotional URL offer
          • Overriding a promotional URL offer discount
      • Pricing
        • Landed cost
          • Mixed cart support
          • Tax-included pretty price
      • Redirecting to a Digital River-hosted cart
      • Configuring taxes
        • Managing tax identifiers
      • Managing shipping options
        • Getting shipping options
        • Providing a shipping discount
      • Managing line items
      • Applying a price override
      • Managing payment sessions
      • Managing web checkout
      • Submitting a cart
        • Initiating a charge
        • Authorization declines
      • Resuming cart submission
      • HGOP2
    • Orders
      • Getting orders
      • Selling entities
      • Retrieving addresses from an order
      • Retrieving line items from an order
      • Order lookup
      • Returns
        • Initiate an authenticated session
        • Setting up returns in Global Commerce
        • Managing returns
    • Subscriptions
      • Retrieve the subscription
        • Getting all orders for a subscription
        • Getting a subscription's pending actions
        • Getting all subscriptions for a shopper
        • Getting a subscription by identifier
      • Update subscription at the next renewal
        • Changing the subscription renewal type
        • Changing the subscription renewal quantity
        • Adding or updating a perpetual unit price
        • Changing the subscription's payment option
        • Changing the subscription's payment source
      • Immediately change the subscription
        • Updating the subscription's shipping address
        • Updating a subscription's billing and shipping email address
        • Cancelling a subscription
      • Immediately apply a midterm subscription change
        • Reducing the subscription renewal quantity
  • Admin APIs
    • Admin basics
      • Available Admin API calls
    • Order management
      • Getting the order's details
      • Downloading the invoice
    • Offer management
    • Refund management
      • Authorization
      • Refund reason codes
      • Creating a satisfaction refund
      • Getting the available refunds for a specific order
      • Getting refunds for a specific order
      • Getting refunds available for a shopper's order
      • Getting the JSON schema for an order refund
      • Managing a refund for a delayed payment method
      • Refund error scenarios
    • Subscription management
      • Retrieve the subscription
        • Getting all orders for a subscription
        • Getting a subscription's pending actions
        • Getting all subscriptions for a shopper
        • Getting a subscription by identifier
      • Update the subscription at the next renewal
        • Changing the subscription renewal type
        • Changing the subscription renewal product
        • Changing the subscription renewal price
        • Changing the subscription renewal quantity
        • Adding or updating a perpetual unit price
        • Changing the subscription's payment option
        • Changing the subscription's payment source
      • Immediately change the subscription
        • Activating a subscription
        • Changing the subscription's external reference identifier
        • Updating a subscription's billing and shipping email address
        • Cancelling a subscription
        • Updating the subscription's expiration date
      • Immediately apply a midterm subscription change
        • Applying a midterm change with price override
        • Reducing the subscription renewal quantity
      • Subscription notifications
        • Updating the subscriber's email address
        • Card Account Updater
        • Sending a payment information change notification
        • Sending an expired credit card notification
        • Sending an invalid payment account notification
        • Sending a payment failure notification
        • Sending a subscription renewal reminder notification
        • Setting up subscription renewal reminders
        • Setting up trial subscription renewal reminders
        • Setting up marketing reminders
      • Using the Expired Card Optimizer
    • Customer management
      • Retrieving customer details
      • Requesting PII removal for a customer
    • Site management
      • Configuring authorized shipping and billing countries
      • Getting a site's authorized billing countries
      • Getting a site's authorized shipping countries
    • Product management
      • Getting started
      • Manage products (asynchronous API)
        • Creating or updating a product
        • Adding or updating a product variation
        • Deploying a product
        • Applying live changes
        • Retiring a product
        • Deleting a product variation
        • Deleting a base or individual product's locale
      • Retrieve products (synchronous API)
        • Getting a product by locale
        • Getting a product variation
        • Getting a product variation by locale
      • Get the task status for a product (synchronous API)
        • Getting the latest information on a product task
        • Retrieving the tasks for a specific product
        • Retrieving the tasks for products
      • Bulk operation
        • Asynchronous bulk operations
          • Creating products in bulk
          • Updating products in bulk
          • Deploying products in bulk
          • Deleting product variations in bulk
        • Bulk product upload (BPU)
        • Bulk Product Export (BPE)
          • Line-item level satisfaction refund
          • Order-level satisfaction refund
          • Auto-created line-item level return product
          • Line-item level return product
    • File management
      • Downloading a file
  • Payments
    • Payments solutions
      • Drop-in payments
        • How Drop-in payments work
        • Drop-in payments integration guide
      • DigitalRiver.js with Elements
        • Elements integration guide
        • Configuring payment methods
          • Configuring Afterpay
          • Configuring Alipay+ (cross-border)
          • Configuring Alipay (domestic)
          • Configuring Amazon Pay
          • Configuring Apple Pay
          • Configuring Bancontact
          • Configuring BLIK
          • Configuring Boleto
          • Configuring CCAvenue
          • Configuring Clearpay
          • Configuring Credit Cards
          • Configuring FPX Online Banking
          • Configuring Google Pay
          • Configuring iDEAL
          • Configuring Klarna
          • Configuring Konbini
          • Configuring Online Banking (IBP)
          • Configuring Online Banking (Korea Bank Transfer)
          • Configuring PayCo
          • Configuring PayPal
          • Configuring SEPA Direct Debit
          • Configuring Trustly
          • Configuring Wire Transfer
          • Common payment sources
          • Common payment objects
    • Supported payment methods
      • Afterpay
      • Alipay (domestic)
      • Alipay+ (cross-border)
      • Amazon Pay
      • Apple Pay
      • Bancontact
      • BLIK
      • Boleto
      • CCAvenue
      • Clearpay
      • Credit Cards
      • FPX Online Banking
      • Google Pay
      • iDEAL
      • Klarna
      • Konbini
      • Korea Bank Transfer (Online Banking)
      • Online Banking (IBP)
      • PayCo
      • PayPal
      • PayPal Billing Agreement
      • PayPal Credit
      • PayPal Pay in 3
      • PayPal Pay in 4
      • PayPal RatenZahlung (Installment Payment)
      • SEPA Direct Debit
      • Trustly
      • Wire Transfer
    • Source basics
      • Managing sources
      • Handling credit card sources
      • Retrieving sources
    • Building payment workflows
      • Flows by payment type
      • Handling redirect payment methods
    • PSD2 and SCA
    • Payment testing scenarios
      • Testing standard payment methods
      • Testing redirect payment methods
      • Testing receiver payment methods
      • Testing the CCAvenue payment method
  • Events
    • Events overview
    • Responding to events
    • Event types
      • Delayed payment event types
        • Delayed payment expired event
          • Boleto
          • Konbini
          • Wire Transfer
        • Delayed payment reminder event
          • Boleto
          • Konbini
          • Wire Transfer
      • Subscription event types
        • Subscription created event
        • Subscription updated event
        • Subscription action processed event
        • Subscription cancelled event
        • Subscription credit card expired event
        • Subscription payment information changed event
        • Subscription renewal reminder event
        • Subscription renewed event
        • Subscription trial converted event
        • Subscription trial renewal reminder event
        • Subscription payment failed event
      • Post-order event types
        • Invoice created event
        • Refund credit memo event
      • Inventory event types
        • Inventory out of stock event
        • Inventory source and management
        • Inventory self-managed updated event
        • Inventory fulfiller-managed updated event
      • Post-order Notification Integration Guide
    • Webhooks
      • Commerce API safelist
      • Searching for a webhook
      • Creating a webhook
      • Using webhooks
      • Editing a webhook
      • Turning webhooks on or off
      • Revealing a webhook's secret
      • Rotating a webhook's secret
      • Viewing the webhook details
      • Deleting a webhook
  • Developer Resources
    • Postman collection
    • Commerce API references
    • Shopper APIs reference
    • Admin APIs reference
    • DigitalRiver.js reference
      • Including DigitalRiver.js
      • Initializing DigitalRiver.js
      • DigitalRiver object
      • Elements
        • Amazon Pay element
        • Apple Pay elements
        • Google Pay elements
        • IBAN element
        • iDEAL element
        • Konbini elements
        • Compliance element
        • Offline refund element
        • Online Banking elements
        • Tax Identifier element
        • Delayed payment instructions element
        • PayPal elements
      • Guidelines for capturing payment details
      • Security
      • Digital River payment objects
      • Error types, codes, and objects
  • General resources
    • Global Commerce
    • Global Commerce
      • Company hierarchy
      • Categories
        • Getting a list of categories
      • Products
        • Product scenarios
        • Individual products
          • Creating an individual product
        • Base product with variants
          • Creating a base product with variants
        • Bundle offers
          • Creating a prorated bundle offer with a subscription
        • Product combination
          • Creating a product combination
        • Gifting
        • Inventory status
      • Customer service
        • Log a shopper's request to remove PII
      • Customers
        • Creating a customer
        • Digital River-maintained customer login
        • Client-maintained customer login
      • Transparent Commerce purchase flow
    • eCompass
    • eCompass documentation
    • Release notes
      • 2024
      • 2024 latest
      • 2023
      • 2022
      • 2021
      • 2020
Powered by GitBook
On this page
  • Creating a cart
  • Updating a cart
  • Additional information

Was this helpful?

  1. Shopper APIs
  2. Cart

Creating or updating a cart

Learn how to create or update a cart.

PreviousGetting the current cartNextAdding a product to a cart

Last updated 11 months ago

Was this helpful?

Managing a cart is crucial for providing a seamless shopping experience. The process involves interacting with the Commerce API, whether creating a new cart or updating an existing one. This guide will cover the API requests and responses needed to create or update a cart successfully. Follow along to ensure your cart operations are smooth and efficient. If you want to add a gift to a cart, see .

Creating a cart

Creating a cart involves several steps, from obtaining an access token to verifying the cart's creation. This guide will walk you through the necessary API requests and responses to ensure a successful cart creation process.

To create a cart:

  1. Send a request to obtain an access token. You must include this token in all subsequent cart interactions.

  2. After receiving the token, verify the cart creation by sending a request. Replace {Your_API_Key} with your actual access token.

You can use cURL for this process, as shown below:

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

A successful request returns a 200 OK response.

{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active",
  "paymentMethods": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/payment-methods"
  },
  "applyPaymentMethod": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/apply-payment-method"
  },
  "submitCart": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/submit-cart"
  },
  "webCheckout": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/web-checkout"
  },
  "id": "47278010023",
  "lineItems": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items",
    "lineItem": {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items/488822300023",
      "id": "488822300023",
      "quantity": "1",
      "product": {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500",
        "parentProduct": {
          "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64358200"
        },
        "id": "64578500",
        "name": "Class I",
        "displayName": "Class I",
        "shortDescription": "Class I is the perfect GPS waypoint and route manager for the beginning or occasional GPS user.",
        "longDescription": "Class I is the fast and easy way to create, edit, and transfer waypoints and routes between your computer and your Garmin, Magellan, or Lowrance GPS. Using Class I, you can manage all of your waypoints and routes, and display them in lists sorted by name, elevation, or distance. Class I connects your GPS to the best mapping and information sites on the Internet, giving you one-click access to street and topo maps, aerial photos, weather forecasts, and nearby attractions.",
        "productType": "DOWNLOAD",
        "sku": "Class I",
        "externalReferenceId": "Test External Reference Number",
        "companyId": "demosft1",
        "displayableProduct": "true",
        "purchasable": "true",
        "manufacturerName": "Test Manufacturer Name",
        "manufacturerPartNumber": "Test Manufacturer Part Number",
        "thumbnailImage": "https://drh-int-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/thumbnail/classIThumb.jpg",
        "productImage": "https://drh-int-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/detail/classIBox.jpg",
        "keywords": "testKeyword",
        "customAttributes": {
          "attribute": [
            {
              "name": "name",
              "value": "string",
              "type": "string"
            }
          ]
        }
      },
      "pricing": {
        "listPrice": {
          "currency": "USD",
          "value": "19.99"
        },
        "listPriceWithQuantity": {
          "currency": "USD",
          "value": "19.99"
        },
        "salePriceWithQuantity": {
          "currency": "USD",
          "value": "19.99"
        },
        "formattedListPrice": "$19.99",
        "formattedListPriceWithQuantity": "$19.99",
        "formattedSalePriceWithQuantity": "$17.99",
        "formattedCommitmentPrice": "$240.00",
        "commitmentPrice": {
          "currency": "USD",
          "value": 240.00
        },
        "tax": {
          "currency": "USD",
          "value": 2.00
        },
        "taxRate": 0.1111
      }
    }
  },
  "totalItemsInCart": "1",
  "businessEntityCode": "DR_INC-ENTITY",
  "billingAddress": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/billing-address"
  },
  "shippingAddress": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-address"
  },
  "payment": {
    "name": "Discover",
    "displayableNumber": "************4321",
    "expirationMonth": "01",
    "expirationYear": "2020"
  },
  "shippingOptions": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options"
  },
  "pricing": {
    "subtotal": {
      "currency": "USD",
      "value": "19.99"
    },
    "discount": {
      "currency": "USD",
      "value": "19.99"
    },
    "shippingAndHandling": {
      "currency": "USD",
      "value": "19.99"
    },
    "tax": {
      "currency": "USD",
      "value": "19.99"
    },
    "orderTotal": {
      "currency": "USD",
      "value": "19.99"
    },
    "formattedSubtotal": "$17.99",
    "formattedDiscount": "$5.00",
    "formattedShippingAndHandling": "$0.00",
    "formattedTax": "$0.96",
    "formattedOrderTotal": "$13.95"
  }
}

A successful request returns a 200 OK response, confirming the creation of the cart with various URIs for further interactions, such as managing payment methods and submitting the cart.

Updating a cart

Updating an existing cart allows you to add various elements such as products, coupon codes, billing, and shipping addresses. Below, you'll find a comprehensive guide on how to update your cart using cURL effectively. Ensure you have the API key and permission to modify the cart details.

You can use the resource to add products, coupon codes, billing/shipping addresses, and offers to a customer's cart. You can leverage all of the resources contained in the Cart to modify specific cart data elements. See the cart query parameters for more information.

Required: To pass customer credit card information through the Cart resource, you need a level 3 API key, a legal/contract amendment, and PCI documentation. Contact your Account Manager if you are interested in this capability.

To update a cart:

You can use cURL for this process, as shown below:

curl --location --request POST 'https://api.digitalriver.com/v1/shoppers/me/carts/active' \
--header 'Content-Type:  application/json' \
--header 'authorization: Basic {Your_API_Key}\
--data-raw '{
  "cart": {
    "ipAddress": "10.24.2.28",
    "customAttributes": {
      "attribute": [
        {
          "name": "name",
          "value": "string",
          "type": "string"
        }
      ]
    },
    "suppressOrderConfirmationEmail": true,
    "lineItems": {
      "lineItem": [
        {
          "quantity": "1",
          "product": {
            "id": 1234
          },
          "customAttributes": {
            "attribute": [
              {
                "name": "name",
                "value": "string",
                "type": "string"
              }
            ]
          }
        }
      ]
    },
    "billingAddress": {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/address/47278020023",
      "relation": "https://developers.digitalriver.com/v1/shoppers/AddressesResource",
      "id": "billingAddress",
      "firstName": "Automation",
      "lastName": "Tester",
      "companyName": "Digital River",
      "line1": "PO BOX 6930",
      "line2": "123",
      "line3": "Suite Line 3",
      "city": "Waconia",
      "countrySubdivision": "MN",
      "postalCode": "5387.0",
      "country": "US",
      "countryName": "United States",
      "phoneNumber": "099-222-44454",
      "emailAddress": "automatedTester@digitalriver.com",
      "countyName": "Hennepin",
      "phoneticFirstName": "クリス",
      "phoneticLastName": "ミラー",
      "division": "製品開発",
      "title": "M"
    },
    "shippingAddress": {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/address/47278020023",
      "relation": "https://developers.digitalriver.com/v1/shoppers/AddressesResource",
      "id": "shippingAddress",
      "firstName": "Automation",
      "lastName": "Tester",
      "companyName": "Digital River",
      "line1": "PO BOX 6930",
      "line2": "123",
      "line3": "Suite Line 3",
      "city": "Waconia",
      "countrySubdivision": "MN",
      "postalCode": "5387.0",
      "country": "US",
      "countryName": "United States",
      "phoneNumber": "099-222-44454",
      "countyName": "Hennepin",
      "emailAddress": "automatedTester@digitalriver.com",
      "phoneticFirstName": "クリス",
      "phoneticLastName": "ミラー",
      "division": "製品開発"
    },
    "termsOfSalesAcceptance": "true",
    "chargeType": "moto",
    "organizationId": "digitalriver12345"
  }
}'
{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active",
  "paymentMethods": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/payment-methods"
  },
  "applyPaymentMethod": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/apply-payment-method"
  },
  "submitCart": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/submit-cart"
  },
  "webCheckout": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/web-checkout"
  },
  "id": "47278010023",
  "lineItems": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items",
    "lineItem": [
      {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items/488822300023",
        "id": "488822300023",
        "quantity": "1",
        "product": {
          "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500",
          "parentProduct": {
            "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64358200"
          },
          "id": "64578500",
          "name": "Class I",
          "displayName": "Class I",
          "shortDescription": "Class I is the perfect GPS waypoint and route manager for the beginning or occasional GPS user.",
          "longDescription": "Class I is the fast and easy way to create, edit, and transfer waypoints and routes between your computer and your Garmin, Magellan, or Lowrance GPS. Using Class I, you can manage all of your waypoints and routes, and display them in lists sorted by name, elevation, or distance. Class I connects your GPS to the best mapping and information sites on the Internet, giving you one-click access to street and topo maps, aerial photos, weather forecasts, and nearby attractions.",
          "productType": "DOWNLOAD",
          "sku": "Class I",
          "externalReferenceId": "Test External Reference Number",
          "companyId": "demosft1",
          "displayableProduct": "true",
          "purchasable": "true",
          "manufacturerName": "Test Manufacturer Name",
          "manufacturerPartNumber": "Test Manufacturer Part Number",
          "thumbnailImage": "https://drh-int-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/thumbnail/classIThumb.jpg",
          "productImage": "https://drh-int-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/detail/classIBox.jpg",
          "keywords": "testKeyword",
          "customAttributes": {
            "attribute": [
              {
                "name": "name",
                "value": "string",
                "type": "string"
              }
            ]
          }
        },
        "pricing": {
          "listPrice": {
            "currency": "USD",
            "value": 101
          },
          "listPriceWithQuantity": {
            "currency": "USD",
            "value": 1010
          },
          "salePriceWithQuantity": {
            "currency": "USD",
            "value": 959.5
          },
          "formattedListPrice": "101.00USD",
          "formattedListPriceWithQuantity": "1010.00USD",
          "formattedSalePriceWithQuantity": "959.50USD",
          "formattedCommitmentPrice": "$240.00",
          "commitmentPrice": {
            "currency": "USD",
            "value": "240.00"
          },
          "productTax": {
            "currency": "USD",
            "value": "1.35"
          },
          "shippingTax": {
            "currency": "USD",
            "value": "0.65"
          },
          "feeTax": {
            "currency": "USD",
            "value": "2.00"
          },
          "taxRate": "0.1111",
          "importTax": {
            "currency": "USD",
            "value": 0
          },
          "formattedImportTax": "0.00USD",
          "importDuty": {
            "currency": "USD",
            "value": 0
          },
          "formattedImportDuty": "0.00USD"
        },
        "components": {
          "lineItem": [
            {
              "id": "488822390023",
              "quantity": "1",
              "product": {
                "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500",
                "displayName": "Combination product - Component-1",
                "thumbnailImage": "https://drh-int-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/thumbnail/classIThumb.jpg"
              },
              "pricing": {
                "listPrice": {
                  "currency": "USD",
                  "value": 101
                },
                "listPriceWithQuantity": {
                  "currency": "USD",
                  "value": 1010
                },
                "salePrice": {
                  "currency": "USD",
                  "value": 95.95
                },
                "salePriceWithQuantity": {
                  "currency": "USD",
                  "value": 959.5
                },
                "formattedListPrice": "101.00USD",
                "formattedListPriceWithQuantity": "1010.00USD",
                "formattedSalePrice": "95.95USD",
                "formattedSalePriceWithQuantity": "959.50USD",
                "totalDiscountWithQuantity": {
                  "currency": "USD",
                  "value": 50.5
                },
                "formattedTotalDiscountWithQuantity": "50.50USD",
                "formattedCommitmentPrice": "$240.00",
                "commitmentPrice": {
                  "currency": "USD",
                  "value": "240.00"
                },
                "productTax": {
                  "currency": "USD",
                  "value": "158.33"
                },
                "shippingTax": {
                  "currency": "USD",
                  "value": "1.91"
                },
                "feeTax": {
                  "currency": "USD",
                  "value": "18.25"
                },
                "taxRate": "0.1111",
                "discountDescription": "$10.00",
                "importTax": {
                  "currency": "USD",
                  "value": 0
                },
                "formattedImportTax": "0.00USD",
                "importDuty": {
                  "currency": "USD",
                  "value": 0
                },
                "formattedImportDuty": "0.00USD",
                "feePricing": {
                  "fee": [
                    null
                  ]
                }
              }
            }
          ]
        },
        "groups": [
          {
            "group": [
              {
                "id": "100100100",
                "relationType": "child",
                "offer": {
                  "uri": "https://api.digitalriver.com/v1/shoppers/me/offers/63018095810"
                }
              }
            ]
          }
        ]
      }
    ]
  },
  "totalItemsInCart": "1",
  "businessEntityCode": "DR_INC-ENTITY",
  "billingAddress": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/billing-address"
  },
  "shippingAddress": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-address"
  },
  "paymentMethod": {
    "type": "creditCard",
    "sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
    "sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
    "creditCard": {
      "expirationYear": "2030",
      "lastFourDigits": "0000",
      "clientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
      "expirationMonth": "08",
      "fundingSource": "debit",
      "brand": "Visa",
      "reusable": "true"
    },
    "amountContributed": {
      "currency": "USD",
      "value": 1059.5
    },
    "charges": [
      {
        "chargeId": "1cac37c0-98a7-46b2-b9ed-fbc615c9f18a",
        "amount": {
          "currency": "USD",
          "value": 1059.5
        },
        "status": "failed",
        "createdTime": "2021-12-06T09:03:46.877Z",
        "updatedTime": "2021-12-06T09:03:46.877Z"
      }
    ],
    "supplementaryPaymentMethods": [
      {
        "type": "customerCredit",
        "sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
        "sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
        "customerCredit": {
          "flow": "standard",
          "reusable": "true"
        },
        "charges": [
          {
            "chargeId": "cf57f9c9-8b0d-4e64-998a-816499fefa01",
            "amount": {
              "currency": "USD",
              "value": 1059.5
            },
            "status": "failed",
            "createdTime": "2021-12-06T09:03:46.877Z",
            "updatedTime": "2021-12-06T09:03:46.877Z"
          }
        ],
        "amountContributed": {
          "currency": "USD",
          "value": 1059.5
        }
      }
    ]
  },
  "payment": {
    "name": "Discover",
    "displayableNumber": "************4321",
    "expirationMonth": 0,
    "expirationYear": 2030
  },
  "paymentSession": {
    "id": "string",
    "status": "string",
    "clientSecret": "string",
    "redirectUrl": "https://api.digitalriver.com:80/payments/redirects/12759bb0-xxxx-4bdb-bfeb-9095ba8059fc?apiKey=a88fxxxx1eef47eb95bc609c22e593c8",
    "amountContributed": {
      "currency": "USD",
      "value": 1059.5
    },
    "amountRemainingToBeContributed": {
      "currency": "USD",
      "value": 1059.5
    }
  },
  "shippingOptions": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options"
  },
  "taxInclusive": true,
  "landedCostState": "NOT_ELIGIBLE",
  "pricing": {
    "subtotal": {
      "currency": "USD",
      "value": 1059.5
    },
    "discount": {
      "currency": "USD",
      "value": 0
    },
    "shippingAndHandling": {
      "currency": "USD",
      "value": 11.47
    },
    "importTaxAndDuty": {
      "currency": "USD",
      "value": 0
    },
    "tax": {
      "currency": "USD",
      "value": 178.49
    },
    "orderTotal": {
      "currency": "USD",
      "value": 1070.97
    },
    "formattedSubtotal": "1,059.50GBP",
    "formattedDiscount": "0.00USB",
    "formattedShippingAndHandling": "11.47USD",
    "formattedImportTaxAndDuty": "0.00USD",
    "formattedTax": "178.49USD",
    "formattedOrderTotal": "1,070.97USD"
  },
  "termsOfSalesAcceptance": "true",
  "chargeType": "moto",
  "customerType": "B",
  "taxRegistrations": [
    {
      "key": "UK_VAT",
      "value": "GB698588737"
    }
  ],
  "organizationId": "digitalriver12345",
  "warnings": {
    "errors": {
      "warning": [
        {
          "code": "couponcode_not_eligible",
          "description": "The relevant discount triggered by {coupon code} will be applied to the cart once it meets the offer criteria..."
        }
      ]
    }
  }
}

A successful request returns a 200 OK response, confirming the updated cart details, including line items, pricing, addresses, etc.

Additional information

For additional information on updating a cart, see the following topics:

Ensure you obtain your access token during cart creation. For instructions on generating the access token, refer to .

Send a request. Replace {Your_API_Key} with your actual API key. Include the necessary data parameters to modify the cart's contents as required. This allows you to add products, coupon codes, billing/shipping addresses and offers to a customer's cart.

Adding a product to a cart
Capturing the customer's IP address
Providing address information
Managing the shipping or billing address
Providing subscription information
Managing payment methods
Capturing the Terms of Sale (TOS) acceptance
Managing offers in a cart
Creating a cart
Gifting
POST /oauth20/token
GET /v1/shoppers/me/carts/active
POST /v1/shoppers/me/carts/active
POST /v1/shoppers/me/carts/active