Apply Shopper

Use the Apply Shopper API to select the cart's payment method, shipping address, and billing address from a known shopper payment option and address. If a shopper does not specify an address or payment option to apply to the cart, the shopper’s designated account defaults are used.

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"},
   "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": shopper_ID,
   "lineItems":    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items",
   },
   "totalItemsInCart": 0,
   "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": "Visa",
      "displayableNumber": "************1111",
      "expirationMonth": 5,
      "expirationYear": 2017
   },
   "shippingMethod": {},
   "shippingOptions":    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options",
   },
   "pricing":    {
      "subtotal":       {
         "currency": "USD",
         "value": 0
      },
      "discount":       {
         "currency": "USD",
         "value": 0
      },
      "shippingAndHandling":       {
         "currency": "USD",
         "value": 0
      },
      "tax":       {
         "currency": "USD",
         "value": 0
      },
      "orderTotal":       {
         "currency": "USD",
         "value": 0
      },
      "formattedSubtotal": "$0.00",
      "formattedDiscount": "$0.00",
      "formattedShippingAndHandling": "$0.00",
      "formattedTax": "$0.00",
      "formattedOrderTotal": "$0.00"
   }
}}
			

Response Body Parameters

Fields
Data Type
Visibility
Description
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
id
string
default
The cart ID. The ID is assigned automatically when you create a cart.
lineItems
link default
The line items for the order. 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).
paymentMethods link default A link to the  Apply Payment Method API.
pricing
structured
default
The pricing information for the cart. See the Pricing API for more information.
submitCart link default A link to the Submit Cart API.
shippingAddress
link
default
The shipping address for the order. See the Addresses API and Fields Used as Keys for more information.
shippingOptions
link
default
The shipping options available to apply to a cart.  See the Shipping Options API for more information.
shippingMethod
structured
default
The shipping method information for the cart. 
totalItemsInCart int default The total number of line items in the cart.
webCheckout link default A link to the Web Checkout API.