latestOpenAPI 3.0.02026-08-101013821017.9 KB

4b69392f93b9

Carts

Update the current cart

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.

post/v1/shoppers/me/carts/active

Query parameters

tokenstring

Provide the authorized or anonymous token for a shopper.

externalReferenceIdstring

Provide the external reference identifier for your product. The externalReferenceId is your company's internal identifier or stock keeping unit (SKU) for a product.

offerIdstring

Provide the offer identifier associated with the cart. You must pass the offerId in conjunction with the productId or externalReferenceId.

productIdstring

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.

parentLineItemIdstring

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.

promoCodestring

Provide the promotional code to apply to the cart.

quantitystring

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.

termIdstring

Provide the finance term ID associated with the cart. You must pass the termId in conjunction with the productId or externalReferenceId.

expandstring

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.

fieldsstring

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.

suppressorderconfirmationemailboolean

When set to true, this parameter suppresses an order's confirmation email. To use this feature, contact Customer Success.

Request body

Example request

{
  "cart": {
    "ipAddress": "10.24.2.28",
    "customAttributes": {
      "attribute": [
        {
          "name": "name",
          "value": "string",
          "type": "string"
        }
      ]
    },
    "suppressOrderConfirmationEmail": true,
    "lineItems": {
      "lineItem": [
        {
          "quantity": "1",
          "product": {
            "id": 1234
          },
          "customAttributes": {
            "attribute": [
              {
                "name": "name",
                "value": "string",
                "type": "string"
              }
            ]
          }
        }
      ]
    },
    "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"
  }
}

Response

Successful response.

OR