Submit Cart

Use the Submit Cart API to submit a cart. A cart cannot be submitted until the following items have been added or applied to the cart:

  • One or more products
  • Shipping option (if the product is a physical product)
  • Shipping address
  • Billing address 
  • Payment option

Submitting a cart creates an order and builds a thank you page. If the purchased product is a digital product, download links are presented to the customer. If the selected payment is a check, delayed payment instructions are provided. If the payment option is a payment service provider, links to sites such as PayPal are provided.

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
			
					{
    "submitCart": {
        "order": {
            "uri": "https://api.digitalriver.com/v1-ci/shoppers/me/orders/order_ID",
            "id": order_ID
        },
        "lineItems": {
            "lineItem": [
                {
                    "id": order_ID,
                    "quantity": 1,
                    "product": {
                        "uri": "https://api.digitalriver.com/v1-ci/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",
                        "totalDiscountWithQuantity": {},
                        "discountDescription": "empty"
                    },
                    "downloads": {
                        "downloadUri": [
                            "http://domain_ID.digitalriver.com/path/WaterLilies.jpg"
                        ]
                    },
                    "digitalRights": {
                        "serialNumber": serial_number
                    }
                }
            ]
        },
        "billingAddress": {
            "id": "billingAddress",
            "firstName": "John",
            "lastName": "Doe",
            "companyName": null,
            "line1": "PO BOX 3940",
            "line2": 123,
            "line3": null,
            "city": "Waconia",
            "countrySubdivision": "MN",
            "postalCode": "55387",
            "country": "US",
            "countryName": "United States",
            "phoneNumber": null,
            "emailAddress": "jdoe@gmail.com"
        },
        "shippingAddress": {
            "id": "shippingAddress",
            "firstName": "John",
            "lastName": "Doe",
            "companyName": null,
            "line1": "PO BOX 3940",
            "line2": 123,
            "line3": null,
            "city": "v",
            "countrySubdivision": "MN",
            "postalCode": "55387",
            "country": "US",
            "countryName": "United States",
            "phoneNumber": null,
            "emailAddress": "jdoe@gmail.com"
        },
        "shippingMethod": {
            "code": null,
            "description": null
        },
        "pricing": {
            "formattedSubtotal": "$39.99",
            "formattedSubtotalWithDiscount": "$34.99",
            "formattedDiscount": "$5.00",
            "formattedShippingAndHandling": "$0.00",
            "formattedTax": "$2.55",
            "formattedOrderTotal": "$37.54"
        },
        "payment": {
            "name": "NCL Credit with no Application",
            "displayableNumber": "************4650",
            "customerFirstName": "Jane",
            "customerMiddleName": "Something",
            "customerLastName": "Doe"
        },
        "paymentCompletionResources": {},
        "delayedPaymentInstructions": {}
    }
}
			

Response Body Parameters

Field
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.
delayedPaymentInstructions
link
default
If the shopper selects physical check or a bill later option as their payment option, delayed payment instructions appear. This field is empty when the shopper selects payment by credit card.
digitalRights
structured
default
Digital rights manage the serial numbers and unlock codes that controla  shopper's access to purchased software and other digital products.
digitalRights.serialNumber
string
default
The serial number of the purchased product. The maximum number of characters is 255. See Fields Used as Keys for more information.
digitalRights.unlockCode
string
default
The unlock code of the purchased product. The maximum number of characters is 2000. See Fields Used as Keys for more information.
downloads
structured
default
Contains the download information for purchased digital products in a submitted cart.
downloads.download
link
default
Contains links for an app to follow so a customer can download purchased digital products.
lineItems
collection
default
A collection of line items. See the Line Items API for more information.
order
link
default
The order information for the submitted cart. See the Orders API for more information.
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.customerMiddleName
string
default
The customer's middle name.
payment.customerLastName
string
default
The customer's last 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.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. 
paymentCompletionResources
link
default
Provides links to payment sites, such as Visa.
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 for more infomation.
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.
testOrder Boolean hidden When true, the order is a test order. Visibility must be set to true for non-test orders.