Managing line items

Learn how to manage line items.

Getting all line items from a cart

You can use the Line Items resource to get all line items from a cart, including products, pricing, and tax information.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items' \
--header 'authorization: Basic ***\
...

See Line items query parameters for more information.

Getting a specific line item from a cart

You can use the Line Items resource to get all line items from a cart, including products, pricing, and tax information.

See Line items query parameters for more information.

Getting line items for an order

You can get all line items for an order when you specify the orderId.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/orders/{orderId}/line-items' \
--header 'authorization: Basic ***\
...

See Line items for more information.

Getting a specific line item for an order

You can get a specific line item for an order when you specify the orderId.

curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/orders/{orderId}/line-items/[lineItemId]' \
--header 'authorization: Basic ***\
...

See Line items for more information.

Adding line items to a cart

You can add one or more line items to a cart.'

curl --location --request POST 'https://api.digitalriver.com/shoppers/v1/shoppers/me/carts/active/line-items' \
--header 'authorization: Basic ***\
...
--data-raw '{
  "lineItems": {
    "lineItem": {
      "id": "991101014",
      "quantity": "1",
      "product": {
        "id": 1234
      },
      "pricing": {
        "salePrice": {
          "currency": "USD",
          "value": "10.99"
        }
      },
      "customAttributes": {
        "attribute": [
          {
            "name": "name",
            "value": "string",
            "type": "string"
          }
        ]
      }
    }
  }
}'

See Line items query parameters for more information.

Updating one or more line items to a cart

You can update one or more line items to a cart. If the product is a product combination, the combined product information appears under the lineItem object, and component information appears under the component object.

curl --location --request POST 'https://api.digitalriver.com/shoppers/v1/shoppers/me/carts/active/line-items/{lineItemId}?format=json*action=add&=quantity=2' \
--header 'authorization: Basic  ***\
...

See Line items for more information.

Deleting all line items from a cart

You can clear a cart by deleting all line items from a cart.

curl --location --request DELETE 'https://api.digitalriver.com/shoppers/v1/shoppers/me/carts/active/line-items' \
--header 'authorization: Basic ***\
...

You will get a 204 No Content response.

Deleting a specific line item from a cart

You can delete a specific line item from a cart.

curl --location --request DELETE 'https://api.digitalriver.com/shoppers/v1/shoppers/me/carts/active/line-items/{lineItemId}' \
--header 'authorization: Basic ***\
...

You will get a 204 No Content response. See Line items for more information.

Last updated