latestOpenAPI 3.0.02026-08-101013821017.9 KB

4b69392f93b9

Line Items

Update a line item for a cart

Use this method to add one or more products to a cart. Adding a product to a cart creates a corresponding line item. You can update one or more line items using the productID or externalReferenceID query parameter. Alternatively, you can post multiple line items with a single request with an XML payload in the request body. The method behavior differs depending on which action query mechanism you use to post line items to a cart. The action query parameter provides flexibility for the update behavior. Add is the default action for this method.

post/v1/shoppers/me/carts/active/line-items/{lineItemsId}

Path parameters

lineItemsIdstring required

Provide the line item identifier.

Query parameters

tokenstring

Provide the authorized or anonymous token for a shopper.

actionstring

Modifies the POST behavior. The action parameter determines the method behavior for handling the quantity associated with a posted line item. The valid values are: add, update, and subtract. Update is the default action for the POST shoppers/me/carts/active/line-items/{lineItemsId} resource method. Add is the default action for the POST shoppers/me/carts/active/line-items resource method. To override the default method behavior for handling quantity, explicitly specify the value of the action query parameter.

quantitystring

Provide a positive integer value (1, 2, 3, etc., excluding zero) for the line item quantity. If the quantity is not explicitly specified, the default is 1. Providing a negative integer or zero value returns an error. The action query parameter determines whether to add, update, or subtract the quantity from existing line item quantities.

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.

Response

Successful response.

OR

Example response

{
  "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",
    "parentProduct": {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64358200"
    },
    "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"
        }
      ]
    }
  },
  "pricing": {
    "listPrice": {
      "currency": "USD",
      "value": 101
    },
    "listPriceWithQuantity": {
      "currency": "USD",
      "value": 1010
    },
    "salePriceWithQuantity": {
      "currency": "USD",
      "value": 959.5
    },
    "formattedListPrice": "101.00USD",
    "formattedListPriceWithQuantity": "1010.00USD",
    "formattedSalePriceWithQuantity": "959.50USD",
    "formattedCommitmentPrice": "$240.00",
    "commitmentPrice": {
      "currency": "USD",
      "value": "240.00"
    },
    "productTax": {
      "currency": "USD",
      "value": "1.35"
    },
    "shippingTax": {
      "currency": "USD",
      "value": "0.65"
    },
    "feeTax": {
      "currency": "USD",
      "value": "2.00"
    },
    "taxRate": "0.1111",
    "importTax": {
      "currency": "USD"
    },
    "formattedImportTax": "0.00USD",
    "importDuty": {
      "currency": "USD"
    },
    "formattedImportDuty": "0.00USD"
  },
  "components": {
    "lineItem": [
      {
        "id": "488822390023",
        "quantity": "1",
        "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"
        },
        "pricing": {
          "listPrice": {
            "currency": "USD",
            "value": 101
          },
          "listPriceWithQuantity": {
            "currency": "USD",
            "value": 1010
          },
          "salePrice": {
            "currency": "USD",
            "value": 95.95
          },
          "salePriceWithQuantity": {
            "currency": "USD",
            "value": 959.5
          },
          "formattedListPrice": "101.00USD",
          "formattedListPriceWithQuantity": "1010.00USD",
          "formattedSalePrice": "95.95USD",
          "formattedSalePriceWithQuantity": "959.50USD",
          "totalDiscountWithQuantity": {
            "currency": "USD",
            "value": 50.5
          },
          "formattedTotalDiscountWithQuantity": "50.50USD",
          "formattedCommitmentPrice": "$240.00",
          "commitmentPrice": {
            "currency": "USD",
            "value": "240.00"
          },
          "productTax": {
            "currency": "USD",
            "value": "158.33"
          },
          "shippingTax": {
            "currency": "USD",
            "value": "1.91"
          },
          "feeTax": {
            "currency": "USD",
            "value": "18.25"
          },
          "taxRate": "0.1111",
          "discountDescription": "$10.00",
          "importTax": {
            "currency": "USD"
          },
          "formattedImportTax": "0.00USD",
          "importDuty": {
            "currency": "USD"
          },
          "formattedImportDuty": "0.00USD",
          "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"
                }
              }
            ]
          }
        }
      }
    ]
  },
  "groups": [
    {
      "group": [
        {
          "id": "100100100",
          "relationType": "child",
          "offer": {
            "uri": "https://api.digitalriver.com/v1/shoppers/me/offers/63018095810"
          }
        }
      ]
    }
  ]
}