Carts
Last updated
Last updated
Retrieve the current active cart for the specified token. This method retrieves the cart along with its line items, and links to subresources such as billing address, shipping address, and shipping options.
/v1/shoppers/me/carts/active
Provide the authorized or anonymous token for a shopper.
Use the expand query parameter when you want additional fields to appear in the response. The expand query parameter provides more fields in the response. Expanding resources reduces the number of API calls required to accomplish a task.
Specify the fields that you want to appear in the response. Filtering the fields returned in the response can conserve bandwidth and accelerate response time.
curl -L \
--url 'https://api.digitalriver.com/v1/shoppers/me/carts/active'
{
"uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active",
"id": "47278010023",
"totalItemsInCart": "1",
"businessEntityCode": "DR_INC-ENTITY",
"paymentMethod": {
"type": "creditCard",
"sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
"sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
"charges": [
{
"chargeId": "1cac37c0-98a7-46b2-b9ed-fbc615c9f18a",
"createdTime": "2021-12-06T09:03:46.877Z",
"updatedTime": "2021-12-06T09:03:46.877Z",
"status": "failed",
"amount": {
"currency": "USD",
"value": 1059.5
}
}
],
"supplementaryPaymentMethods": [
{
"type": "customerCredit",
"sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
"sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
"charges": [
{
"chargeId": "cf57f9c9-8b0d-4e64-998a-816499fefa01",
"createdTime": "2021-12-06T09:03:46.877Z",
"updatedTime": "2021-12-06T09:03:46.877Z",
"status": "failed",
"amount": {
"currency": "USD",
"value": 1059.5
}
}
],
"amountContributed": {
"currency": "USD",
"value": 1059.5
},
"customerCredit": {
"reusable": "true",
"flow": "standard"
}
}
],
"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
}
},
"paymentSession": {
"id": "text",
"status": "text",
"clientSecret": "text",
"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
}
},
"taxInclusive": true,
"landedCostState": "NOT_ELIGIBLE",
"pricing": {
"formattedSubtotal": "1,059.50GBP",
"formattedDiscount": "0.00USB",
"formattedShippingAndHandling": "11.47USD",
"formattedImportTaxAndDuty": "0.00USD",
"formattedTax": "178.49USD",
"formattedOrderTotal": "1,070.97USD",
"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
}
},
"termsOfSalesAcceptance": "true",
"chargeType": "moto",
"customerType": "B",
"taxRegistrations": [
{
"key": "UK_VAT",
"value": "GB698588737"
}
],
"organizationId": "digitalriver12345",
"warnings": {
"errors": {
"warning": []
}
},
"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"
},
"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": 1,
"expirationYear": 2030
},
"shippingOptions": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options"
},
"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",
"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"
}
]
},
"parentProduct": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/products/64358200"
}
},
"pricing": {
"formattedListPrice": "101.00USD",
"formattedListPriceWithQuantity": "1010.00USD",
"formattedSalePriceWithQuantity": "959.50USD",
"formattedCommitmentPrice": "$240.00",
"taxRate": "0.1111",
"formattedImportTax": "0.00USD",
"formattedImportDuty": "0.00USD",
"listPrice": {
"currency": "USD",
"value": 101
},
"listPriceWithQuantity": {
"currency": "USD",
"value": 1010
},
"salePriceWithQuantity": {
"currency": "USD",
"value": 959.5
},
"commitmentPrice": {
"currency": "USD",
"value": "240.00"
},
"productTax": {
"currency": "USD",
"value": "1.35"
},
"shippingTax": {
"currency": "USD",
"value": "0.65"
},
"feeTax": {
"currency": "USD",
"value": "2.00"
},
"importTax": {
"currency": "USD",
"value": 0
},
"importDuty": {
"currency": "USD",
"value": 0
}
},
"components": {
"lineItem": [
{
"id": "488822390023",
"quantity": "1",
"pricing": {
"formattedListPrice": "101.00USD",
"formattedListPriceWithQuantity": "1010.00USD",
"formattedSalePrice": "95.95USD",
"formattedSalePriceWithQuantity": "959.50USD",
"formattedTotalDiscountWithQuantity": "50.50USD",
"formattedCommitmentPrice": "$240.00",
"taxRate": "0.1111",
"discountDescription": "$10.00",
"formattedImportTax": "0.00USD",
"formattedImportDuty": "0.00USD",
"listPrice": {
"currency": "USD",
"value": 101
},
"listPriceWithQuantity": {
"currency": "USD",
"value": 1010
},
"salePrice": {
"currency": "USD",
"value": 95.95
},
"salePriceWithQuantity": {
"currency": "USD",
"value": 959.5
},
"totalDiscountWithQuantity": {
"currency": "USD",
"value": 50.5
},
"commitmentPrice": {
"currency": "USD",
"value": "240.00"
},
"productTax": {
"currency": "USD",
"value": "158.33"
},
"shippingTax": {
"currency": "USD",
"value": "1.91"
},
"feeTax": {
"currency": "USD",
"value": "18.25"
},
"importTax": {
"currency": "USD",
"value": 0
},
"importDuty": {
"currency": "USD",
"value": 0
},
"feePricing": {
"fee": [
{
"name": "WEEE Fee",
"typeCode": "typeCode",
"listPrice": {
"currency": "USD",
"value": "19.99"
},
"listPriceWithQuantity": {
"currency": "USD",
"value": "19.99"
},
"salePriceWithQuantity": {
"currency": "USD",
"value": "19.99"
},
"formattedListPrice": "8.33USD",
"formattedListPriceWithQuantity": "8.33USD",
"formattedSalePriceWithQuantity": "8.33USD",
"tax": {
"currency": "USD",
"value": "1.67"
}
}
]
}
},
"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"
}
}
]
},
"groups": [
{
"group": [
{
"id": "100100100",
"relationType": "child",
"offer": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/offers/63018095810"
}
}
]
}
]
}
]
}
}
Successful response.
Adds a product to a cart on an API consumer-hosted page by product ID or external reference ID. The response returns the contents of the cart. You can also apply a promotional or coupon code to a cart. The promoCode query parameter is required to apply the promotional code. Promotional codes are also called coupon codes or discount codes.
/v1/shoppers/me/carts/active
Provide the authorized or anonymous token for a shopper.
Provide the external reference identifier for your product. The externalReferenceId is your company's internal identifier or stock keeping unit (SKU) for a product.
Provide the offer identifier associated with the cart. You must pass the offerId in conjunction with the productId or externalReferenceId.
Provide a comma-separated list of one or more product identifiers to include in the response. This parameter is required if the inventory status is requested to be included in the response.
Provide the line item ID for the parent product when adding a child product to the cart to ensure the child product is correctly associated with the parent product line item. Remember also to include the offer ID.
Provide the promotional code to apply to the cart.
Provide the number of products added to the cart. The value must be a valid integer. If the quantity is not explicitly specified, the default is 1.
Provide the finance term ID associated with the cart. You must pass the termId in conjunction with the productId or externalReferenceId.
Use the expand query parameter when you want additional fields to appear in the response. The expand query parameter provides more fields in the response. Expanding resources reduces the number of API calls required to accomplish a task.
Specify the fields that you want to appear in the response. Filtering the fields returned in the response can conserve bandwidth and accelerate response time.
When set to true, this parameter suppresses an order's confirmation email. To use this feature, contact Customer Success.
curl -L \
--request POST \
--url 'https://api.digitalriver.com/v1/shoppers/me/carts/active' \
--header 'Content-Type: application/json' \
--data '{"cart":{"ipAddress":"10.24.2.28","customAttributes":{"attribute":[{"name":"name","value":"string","type":"string"}]},"suppressOrderConfirmationEmail":true,"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","testOrder":"false","sendEmail":"true","lineItems":{"lineItem":[]}}}'
{
"uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active",
"id": "47278010023",
"totalItemsInCart": "1",
"businessEntityCode": "DR_INC-ENTITY",
"paymentMethod": {
"type": "creditCard",
"sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
"sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
"charges": [
{
"chargeId": "1cac37c0-98a7-46b2-b9ed-fbc615c9f18a",
"createdTime": "2021-12-06T09:03:46.877Z",
"updatedTime": "2021-12-06T09:03:46.877Z",
"status": "failed",
"amount": {
"currency": "USD",
"value": 1059.5
}
}
],
"supplementaryPaymentMethods": [
{
"type": "customerCredit",
"sourceId": "a231f38d-3a07-4a13-96ed-89693ba7d56c",
"sourceClientSecret": "a231f38d-3a07-4a13-96ed-89693ba7d56c_f6d8c951-59c9-4ef3-ac45-9f33c77d2f46",
"charges": [
{
"chargeId": "cf57f9c9-8b0d-4e64-998a-816499fefa01",
"createdTime": "2021-12-06T09:03:46.877Z",
"updatedTime": "2021-12-06T09:03:46.877Z",
"status": "failed",
"amount": {
"currency": "USD",
"value": 1059.5
}
}
],
"amountContributed": {
"currency": "USD",
"value": 1059.5
},
"customerCredit": {
"reusable": "true",
"flow": "standard"
}
}
],
"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
}
},
"paymentSession": {
"id": "text",
"status": "text",
"clientSecret": "text",
"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
}
},
"taxInclusive": true,
"landedCostState": "NOT_ELIGIBLE",
"pricing": {
"formattedSubtotal": "1,059.50GBP",
"formattedDiscount": "0.00USB",
"formattedShippingAndHandling": "11.47USD",
"formattedImportTaxAndDuty": "0.00USD",
"formattedTax": "178.49USD",
"formattedOrderTotal": "1,070.97USD",
"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
}
},
"termsOfSalesAcceptance": "true",
"chargeType": "moto",
"customerType": "B",
"taxRegistrations": [
{
"key": "UK_VAT",
"value": "GB698588737"
}
],
"organizationId": "digitalriver12345",
"warnings": {
"errors": {
"warning": []
}
},
"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"
},
"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": 1,
"expirationYear": 2030
},
"shippingOptions": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/shipping-options"
},
"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",
"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"
}
]
},
"parentProduct": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/products/64358200"
}
},
"pricing": {
"formattedListPrice": "101.00USD",
"formattedListPriceWithQuantity": "1010.00USD",
"formattedSalePriceWithQuantity": "959.50USD",
"formattedCommitmentPrice": "$240.00",
"taxRate": "0.1111",
"formattedImportTax": "0.00USD",
"formattedImportDuty": "0.00USD",
"listPrice": {
"currency": "USD",
"value": 101
},
"listPriceWithQuantity": {
"currency": "USD",
"value": 1010
},
"salePriceWithQuantity": {
"currency": "USD",
"value": 959.5
},
"commitmentPrice": {
"currency": "USD",
"value": "240.00"
},
"productTax": {
"currency": "USD",
"value": "1.35"
},
"shippingTax": {
"currency": "USD",
"value": "0.65"
},
"feeTax": {
"currency": "USD",
"value": "2.00"
},
"importTax": {
"currency": "USD",
"value": 0
},
"importDuty": {
"currency": "USD",
"value": 0
}
},
"components": {
"lineItem": [
{
"id": "488822390023",
"quantity": "1",
"pricing": {
"formattedListPrice": "101.00USD",
"formattedListPriceWithQuantity": "1010.00USD",
"formattedSalePrice": "95.95USD",
"formattedSalePriceWithQuantity": "959.50USD",
"formattedTotalDiscountWithQuantity": "50.50USD",
"formattedCommitmentPrice": "$240.00",
"taxRate": "0.1111",
"discountDescription": "$10.00",
"formattedImportTax": "0.00USD",
"formattedImportDuty": "0.00USD",
"listPrice": {
"currency": "USD",
"value": 101
},
"listPriceWithQuantity": {
"currency": "USD",
"value": 1010
},
"salePrice": {
"currency": "USD",
"value": 95.95
},
"salePriceWithQuantity": {
"currency": "USD",
"value": 959.5
},
"totalDiscountWithQuantity": {
"currency": "USD",
"value": 50.5
},
"commitmentPrice": {
"currency": "USD",
"value": "240.00"
},
"productTax": {
"currency": "USD",
"value": "158.33"
},
"shippingTax": {
"currency": "USD",
"value": "1.91"
},
"feeTax": {
"currency": "USD",
"value": "18.25"
},
"importTax": {
"currency": "USD",
"value": 0
},
"importDuty": {
"currency": "USD",
"value": 0
},
"feePricing": {
"fee": [
{
"name": "WEEE Fee",
"typeCode": "typeCode",
"listPrice": {
"currency": "USD",
"value": "19.99"
},
"listPriceWithQuantity": {
"currency": "USD",
"value": "19.99"
},
"salePriceWithQuantity": {
"currency": "USD",
"value": "19.99"
},
"formattedListPrice": "8.33USD",
"formattedListPriceWithQuantity": "8.33USD",
"formattedSalePriceWithQuantity": "8.33USD",
"tax": {
"currency": "USD",
"value": "1.67"
}
}
]
}
},
"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"
}
}
]
},
"groups": [
{
"group": [
{
"id": "100100100",
"relationType": "child",
"offer": {
"uri": "https://api.digitalriver.com/v1/shoppers/me/offers/63018095810"
}
}
]
}
]
}
]
}
}
Successful response.