Carts 

The Carts API provides access to a shopper's cart and cart data. Use the Carts API to get, update, or modify a cart. 


Resource URIs

All methods in this API require a full access token.


Methods


					Host: api.digitalriver.com
Accept: application/json
Authorization: bearer your_access_token
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)
			
					The request body should be empty.
			
					HTTP/1.1 200 OK
			
					{"cart": {
   "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"},
   "webCheckout":    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/web-checkout",
   },
   "id": 999999999,
   "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/line_item_ID",
         "id": line_item_ID,
         "quantity": 1,
         "product":          {
            "uri": "https://api.digitalriver.com/v1/shoppers/me/products/product_ID",
            "displayName": "Class V",
            "thumbnailImage": "https://drh-sys-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/thumbnail/classVThumb_v2.jpg"
         },
         "pricing":          {
            "listPrice":             {
               "currency": "USD",
               "value": 59.99
            },
            "listPriceWithQuantity":             {
               "currency": "USD",
               "value": 59.99
            },
            "salePriceWithQuantity":             {
               "currency": "USD",
               "value": 58.99
            },
            "formattedListPrice": "$59.99",
            "formattedListPriceWithQuantity": "$59.99",
            "formattedSalePriceWithQuantity": "$58.99"
         }
      }]
   },
   "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": {},
   "shippingMethod":    {
      "code": 5858800,
      "description": "UPS"
   },
   "shippingOptions":    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options",
   },
   "pricing":    {
      "subtotal":       {
         "currency": "USD",
         "value": 58.99
      },
      "discount":       {
         "currency": "USD",
         "value": 5
      },
      "shippingAndHandling":       {
         "currency": "USD",
         "value": 2
      },
      "tax":       {
         "currency": "USD",
         "value": 2.24
      },
      "orderTotal":       {
         "currency": "USD",
         "value": 58.23
      },
      "formattedSubtotal": "$58.99",
      "formattedDiscount": "$5.00",
      "formattedShippingAndHandling": "$2.00",
      "formattedTax": "$2.24",
      "formattedOrderTotal": "$58.23"
   }
}}
			
					Host: api.digitalriver.com
Accept: application/json
Authorization: bearer your_access_token
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_102)
			
					The request body should be empty.
			
					HTTP/1.1 200 OK
			
					<cart uri="https://api.digitalriver.com/v1/shoppers/me/carts/active">
   <id>13871346482</id>
   <webCheckout uri="https://api.digitalriver.com/v1/shoppers/me/carts/active/web-checkout"/>
   <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/line_item_ID">
         <id>line_item_ID</id>
         <quantity>1</quantity>
         <product uri="https://api.digitalriver.com/v1/shoppers/me/products/product_ID">
            <displayName>Network Pro</displayName>
            <thumbnailImage>http://.../Storefront/Company/aqued/images/product/thumbnail/80x80net.png</thumbnailImage>
         </product>
         <pricing>
            <listPrice currency="USD">2.00</listPrice>
            <listPriceWithQuantity currency="USD">2.00</listPriceWithQuantity>
            <salePriceWithQuantity currency="USD">1.80</salePriceWithQuantity>
            <formattedListPrice>$2.00</formattedListPrice>
            <formattedListPriceWithQuantity>$2.00</formattedListPriceWithQuantity>
            <formattedSalePriceWithQuantity>$1.80</formattedSalePriceWithQuantity>
         </pricing>
      </lineItem>
   </lineItems>
   <totalItemsInCart>1</totalItemsInCart>
   <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/>
   <shippingMethod/>
   <shippingOptions uri="https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options"/>
   <pricing>
      <subtotal currency="USD">1.80</subtotal>
      <discount currency="USD">0.18</discount>
      <shippingAndHandling currency="USD">0.00</shippingAndHandling>
      <tax currency="USD">0.00</tax>
      <orderTotal currency="USD">1.62</orderTotal>
      <formattedSubtotal>$1.80</formattedSubtotal>
      <formattedDiscount>$0.18</formattedDiscount>
      <formattedShippingAndHandling>$0.00</formattedShippingAndHandling>
      <formattedTax>$0.00</formattedTax>
      <formattedOrderTotal>$1.62</formattedOrderTotal>
    </pricing>
</cart>
			

Response Body Parameters

Fields
Data Type
Visibility
Description
applyPaymentMethod
link
default
A link to the Apply Payment Method API.
billingAddress
link
default
The billing address for the order. See the Addresses API and Fields Used as Keys for more information.
businessEntityCode
string
default
The code for the business entity.
customAttributes
collection
default
A collection of the custom attributes configured for the cart. Custom attributes are not included with the resource by default. Expanding the customAttributes returns all of the configured attributes for the cart.
id
string
default
The cart ID. The ID is assigned automatically when you create a cart.
lineItems
collection
default
A collection of line items. For more information, see the Line Items API.
payment
structured
default
The payment information for the cart.
payment.displayableNumber
string
default
The credit card number of the payment. This number is safely displayed to the shopper (such as ************1111).
payment.expirationMonth
string
default
The month when a credit card expires. A numeric value that represents the month. Possible values: 1 = January, .... 12 = December.
payment.expirationYear
string
default
The four-digit year when a credit card expires (for example, 201).
payment.name
string
default
The type of payment to display to the shopper, such as the name of the credit card used (Visa, Mastercard, and so forth).
payment.softDescriptor
string
default
Describes how the charge will appear on the credit card statement. Only applicable for credit card payments.
paymentMethod
structured
default
The payment method information for this cart.
paymentMethods
link
default
A link to the Apply Payment Method API.
paymentMethod.type
string
default
The type of payment method for this cart.
paymentMethod.displayName
string
default
The name of the payment method.
paymentMethod.description
string
default
A description of the payment method.
pricing
structured
default
The pricing information for the cart. See the Pricing API for more information.
sendEmail Boolean expand Indicates whether the shopper would like to receive promotional emails.
shippingAddress
link
default
The cart's shipping address. See the Addresses API and Fields Used as Keys for more information.
shippingMethod
structured
default
The shipping method information for the cart.
shippingMethod.code
string
default
The code of the shipping method.
shippingMethod.description
string
default
The description of the shipping method.
shippingOptions
link
default
The shipping options available to apply to a cart. See the Shipping Options API for more information.
testOrder Boolean hidden When true, the order is a test order. Visibility must be set to true for non-test orders.  
totalItemsInCart
int
default
The total number of line items in the cart.
webCheckout
link
default
A link to the Web Checkout API.

Related APIs

The following table lists methods for related APIs that provide cart information.

Related APIs
Methods
Billing and Shipping Address
GET /shoppers/me/carts/active/billing-address
GET /shoppers/me/carts/active/shipping-address
POST /shoppers/me/carts/active/apply-billing-address
POST /shoppers/me/carts/active/apply-shipping-address
PUT /shoppers/me/carts/active/billing-address
PUT /shoppers/me/carts/active/billing-address
Carts
Delete /shoppers/me/carts/active/line-items
Delete /shoppers/me/carts/active/line-it4ems/{id}
GET /shoppers/me/carts/active/line-items
GET /shoppers/me/carts/active/line-items/{id}
POST /shoppers/me/carts/active/line-items
POST /shoppers/me/carts/active/line-items/{id}
Payment Methods GET /shoppers/me/carts/active/payment-methods
Point-of-Promotions GET /shoppers/me/carts/point-of-promotions
GET /shoppers/me/carts/active/pint-of-promotions/{popName}
Shipping Options GET /shoppers/me/carts/active/shipping-options
GET /shoppers/me/carts/active/shipping-options/{id}
Submit Cart GET /shoppers/me/carts/active/submit-cart
Suggestions GET /shoppers/me/carts/active/billing-address/suggestions
GET /shoppers/me/carts/active/billing-address/suggesstions/{id}
GET /shoppers/me/carts/active/shipping-address/suggestions
GET /shoppers/me/carts/active/shipping-address/suggestions/{id}
Web Checkout GET /shoppers/me/carts/active/web-checkout
POST /shoppers/me/carts/active/web-checkout