Apply Payment Method

Prerequisite: The Apply Payment Method API requires Service Profile Level 3. See Rate Limiting for more information.

Use the Apply Payment Method API to apply a payment method to 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)
			
					{
	"paymentMethod":{
		"name":"NCLCreditDirect",
		"paymentToken":"your_payment_token",
		"customerFirstName":"John",
		"customerMiddleName":"Allen",
		"customerLastName":"Doe",
		"customerEmail":"jdoe@acme.com"
	}
}
			
					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": 9999999999999,
		"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 III",
					"thumbnailImage": "https://dc2appdev10.dc2.digitalriver.com/DRHM/Storefront/Company/demosft1/images/product/thumbnail/classIIIThumb_v2.jpg"
				},
				"pricing": {
					"formattedListPrice": "$39.99",
					"formattedListPriceWithQuantity": "$39.99",
					"formattedSalePriceWithQuantity": "$39.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": {
			"name": "NCL Credit with no Application",
			"displayableNumber": "************4650",
			"customerFirstName": "John",
			"customerMiddleName": "Allen",
			"customerLastName": "Doe"
		},
		"shippingMethod": {},
		"shippingOptions": {
			"uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options"
		},
		"pricing": {
			"formattedSubtotal": "$39.99",
			"formattedDiscount": "$5.00",
			"formattedShippingAndHandling": "$0.00",
			"formattedTax": "$2.55",
			"formattedOrderTotal": "$37.54"
		}
	}
}
			

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
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.customerFirstName string default The customer's first name. See Fields Used as Keys for more information. 
payment.customerLastName string default The customer's last name. See Fields Used as Keys for more information. 
payment.customerMiddleName string defaut The customer's middle name. See Fields Used as Keys for more information. 
payment.displayableNumber
string
default
The credit card number of the payment. This number is safely displayed to the shopper (such as ************1111).
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).
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.
shippingAddress
link
default
The carts shipping address. See the Addresses API and Fields Used as Keys for more information.
shippingMethod
structured
default
The shipping method information for the cart.
shippingOptions
link
default
The shipping options available to apply to a cart. See the Shipping Options API for more information.
submitCart
link default A link to the Submit Cart API.
totalItemsInCart
int
default
The total number of line items in the cart.
webCheckout
link
default
A link to the Web Checkout API.