LogoLogo
Shopper APIs reference
Shopper APIs reference
  • Shopper APIs reference
  • OAuth
    • Tokens
    • Access tokens
  • Shoppers
    • Shoppers
    • Addresses
    • Payment options
  • Browse (product discovery)
    • Categories
    • Products
    • Product variations
    • Pricing
    • Inventory status
    • Financing
    • Offers
    • Purchase plan
    • Find a purchase plan
    • Authorize a purchase plan
  • Cart
    • Apply a shopper to a cart
    • Line items
    • Billing address
    • Shipping address
    • Payment methods
    • Shipping options
    • Web checkout
    • Submit a cart
    • Apply or detach payment methods
    • Apply a shipping option
    • Carts
    • Cart offers
    • API trigger offer
    • Resume cart
    • Third-party subscription engine
    • Tax registration
    • Price override
  • Orders
    • Orders
    • Order lookup
    • Order address
    • Returns
  • Subscriptions
    • Manage a subscription
    • Manage the subscription's renewal plan
    • Immediate midterm change
    • Payment
    • Address
    • Orders
    • Pending actions
    • Retrieve subscriptions
    • Subscription billing and shipping addresses
Powered by GitBook
On this page
  1. Cart

Line items

PreviousApply a shopper to a cartNextBilling address

Last updated 10 months ago

Delete line items in a cart

delete

Use this method to remove multiple or all line items from your cart with just one request. Note that this method requires an authentication token.

Query parameters
tokenstringOptional

Provide the authorized or anonymous token for a shopper.

lineItemIdstringOptional

Provide a comma-separated list of one or more line item identifiers.

Responses
204
No content.
401
* Invalid Token
application/json
409
* Payment Unexpected Error
application/json
delete
DELETE /v1/shoppers/me/carts/active/line-items HTTP/1.1
Host: api.digitalriver.com
Accept: */*

No content

Get line items for an order line

get

To get all line items for an order, specify the order ID in the {id} URI path parameter.

Path parameters
orderIdstringRequired

Provide the order's identifier.

Query parameters
tokenstringOptional

Provide the authorized token for a shopper.

expandstringOptional

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.

fieldsstringOptional

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.

Responses
200
Successful response.
application/json
Responseone of
or
401
* Invalid Token
application/json
get
GET /v1/shoppers/me/orders/{orderId}/line-items HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/orders/47276010023/line-items",
  "lineItem": [
    {
      "uri": "https://api.digitalriver.com/v1/shoppers/me/orders/47276010023/line-items/488822300023",
      "id": "488822300023",
      "quantity": 1,
      "product": {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/products/5112133200",
        "displayName": "Good Product",
        "thumbnailImage": "text"
      },
      "lineItemState": "Complete",
      "lineItemStateDetails": {
        "description": "Downloadable - 1",
        "backOrdered": 0,
        "shipped": 0,
        "returned": 0,
        "pendingReturn": 0
      },
      "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",
          "value": 0
        },
        "formattedImportTax": "0.00USD",
        "importDuty": {
          "currency": "USD",
          "value": 0
        },
        "formattedImportDuty": "0.00USD"
      },
      "downloads": {
        "downloadUri": [
          "https://wgtsysot12.digitalriver.com/wgt/9B5A4FCEF11DA80C/171F14235882A3D349C4DF3E9F68F51B28573D6CB50E888238DC305C96D769176F6A4F895B77C58CF0F67A3572E1FE49934F924414F2486E45C01D39B94ADFA2E0920C4390CBA6042FE0C88CD46AAEA99C060E2044E521050A7DE0793B014624647C638FDE4F6D4D/demosft1/WaterLilies.jpg"
        ]
      },
      "digitalRights": {
        "serialNumber": {}
      },
      "billingAgreementId": "fc86a666-9f2f-4294-b591-468ae34122ff",
      "subscriptionIds": [
        "[15564325189,15564325289]"
      ]
    }
  ]
}

Get a line item from a cart

get

To retrieve a specific line item, provide its ID in the {id} URI path parameter. Note that this method requires an authentication token.

Path parameters
lineItemsIdstringRequired

Provide the line item identifier.

Query parameters
tokenstringOptional

Provide the authorized or anonymous token for a shopper.

expandstringOptional

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.

fieldsstringOptional

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.

Responses
200
Successful response.
application/json
Responseone of
or
401
* Invalid Token
application/json
404
* resource-not-found
application/json
get
GET /v1/shoppers/me/carts/active/line-items/{lineItemsId} HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "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",
      "value": 0
    },
    "formattedImportTax": "0.00USD",
    "importDuty": {
      "currency": "USD",
      "value": 0
    },
    "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",
            "value": 0
          },
          "formattedImportTax": "0.00USD",
          "importDuty": {
            "currency": "USD",
            "value": 0
          },
          "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"
          }
        }
      ]
    }
  ]
}

Update a line item for a cart

post

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.

Path parameters
lineItemsIdstringRequired

Provide the line item identifier.

Query parameters
tokenstringOptional

Provide the authorized or anonymous token for a shopper.

actionstringOptional

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.

quantitystringOptional

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.

expandstringOptional

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.

fieldsstringOptional

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.

Responses
200
Successful response.
application/json
Responseone of
or
400
* Invalid Request
application/json
401
* Invalid Token
application/json
409
* Restricted IP address * Line Item creation failure * Line Item update failure * Offer already used * Offer Inactive * Offer not applicable * Offer not deployed * Offer unavailable * Offer limit restrictions * Private store restrictions * Payment unexpected error
application/json
post
POST /v1/shoppers/me/carts/active/line-items/{lineItemsId} HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "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",
      "value": 0
    },
    "formattedImportTax": "0.00USD",
    "importDuty": {
      "currency": "USD",
      "value": 0
    },
    "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",
            "value": 0
          },
          "formattedImportTax": "0.00USD",
          "importDuty": {
            "currency": "USD",
            "value": 0
          },
          "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"
          }
        }
      ]
    }
  ]
}

Delete a line item in a cart

delete

To delete a particular line item for a product, you need to provide the ID of the line item in the {id} URI path parameter. Note that this method requires an authentication token.

Path parameters
lineItemsIdstringRequired

Provide the line item identifier.

Query parameters
tokenstringOptional

Provide the authorized or anonymous token for a shopper.

Responses
204
No content.
401
* Invalid Token
application/json
409
* Payment Unexpected Error
application/json
delete
DELETE /v1/shoppers/me/carts/active/line-items/{lineItemsId} HTTP/1.1
Host: api.digitalriver.com
Accept: */*

No content

Get the line item for an order

get

To get a line item for an order, specify the order ID in the first {id} uri path parameter. Specify the line item ID in the second {id} URI path parameter.

Path parameters
orderIdstringRequired

Provide the order's identifier.

lineItemIdstringRequired

Provide the line item identifier.

Query parameters
tokenstringOptional

Provide the authorized token for a shopper.

expandstringOptional

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.

fieldsstringOptional

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.

Responses
200
Successful response.
application/json
Responseone of
or
404
* Invalid Token * resource-not-found
application/json
get
GET /v1/shoppers/me/orders/{orderId}/line-items/{lineItemId} HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "uri": "https://api.digitalriver.com/v1/shoppers/me/orders/47276010023/line-items/488822300023",
  "id": "488822300023",
  "quantity": 1,
  "product": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/products/5112133200",
    "displayName": "Good Product",
    "thumbnailImage": "text"
  },
  "lineItemState": "Complete",
  "lineItemStateDetails": {
    "description": "Downloadable - 1",
    "backOrdered": 0,
    "shipped": 0,
    "returned": 0,
    "pendingReturn": 0
  },
  "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",
      "value": 0
    },
    "formattedImportTax": "0.00USD",
    "importDuty": {
      "currency": "USD",
      "value": 0
    },
    "formattedImportDuty": "0.00USD"
  },
  "downloads": {
    "downloadUri": [
      "https://wgtsysot12.digitalriver.com/wgt/9B5A4FCEF11DA80C/171F14235882A3D349C4DF3E9F68F51B28573D6CB50E888238DC305C96D769176F6A4F895B77C58CF0F67A3572E1FE49934F924414F2486E45C01D39B94ADFA2E0920C4390CBA6042FE0C88CD46AAEA99C060E2044E521050A7DE0793B014624647C638FDE4F6D4D/demosft1/WaterLilies.jpg"
    ]
  },
  "digitalRights": {
    "serialNumber": {}
  },
  "billingAgreementId": "fc86a666-9f2f-4294-b591-468ae34122ff",
  "subscriptionIds": [
    "[15564325189,15564325289]"
  ]
}
  • GETGet line items from a cart line
  • POSTAdd line items to a cart
  • DELETEDelete line items in a cart
  • GETGet line items for an order line
  • GETGet a line item from a cart
  • POSTUpdate a line item for a cart
  • DELETEDelete a line item in a cart
  • GETGet the line item for an order

Get line items from a cart line

get

Use this method to obtain the prices and details of all products added to the cart. Note that this operation requires an authentication token.

Query parameters
tokenstringOptional

Provide the authorized or anonymous token for a shopper.

expandstringOptional

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.

fieldsstringOptional

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.

Responses
200
Successful response.
application/json
Responseone of
or
400
* invalid-request
application/json
401
* invalid_token
application/json
404
* resource-not-found
application/json
409
* ip-address-restriction-error * invalid-ip-address
application/json
get
GET /v1/shoppers/me/carts/active/line-items HTTP/1.1
Host: api.digitalriver.com
Accept: */*
{
  "lineItems": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items",
    "lineItems": [
      {
        "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",
            "value": 0
          },
          "formattedImportTax": "0.00USD",
          "importDuty": {
            "currency": "USD",
            "value": 0
          },
          "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",
                  "value": 0
                },
                "formattedImportTax": "0.00USD",
                "importDuty": {
                  "currency": "USD",
                  "value": 0
                },
                "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"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Add line items to a cart

post

Use this method to add or update one or more products in 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.

Query parameters
tokenstringOptional

Provide the authorized or anonymous token for a shopper.

companyIdstringOptional

Provide the identifier for the company that owns the product. If you do not provide the companyId, the call will use the default company associated with the API key.

externalReferenceIdstringOptional

Provide a comma-separated list of one or more external reference identifiers. The externalReferenceId is your company's internal identifier or stock keeping unit (SKU) for a product used when creating a line item with companyId. If you do not explicitly provide the companyId when creating a line item using the externalReferenceId, the system will use the companyId associated with the API key.

offerIdstringOptional

Provide the offer's identifier.

productIdstringOptional

Provide a comma-separated list of one or more product IDs. A product identifier is a product's unique stock keeping unit (SKU). Use this product ID when adding a product to a cart and creating a line item.

parentLineItemIdstringOptional

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.

quantitystringOptional

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.

suppressorderconfirmationemailbooleanOptional

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

Body
Responses
200
Successful response.
application/json
Responseone of
or
201
Created
400
* invalid-request
application/json
401
* invalid_token
application/json
404
* resource-not-found * invalid-offer-id
application/json
409
* ip-address-restriction-error * invalid-ip-address * concurrent-cart-modification-failure * operation-failed * invalid-bill-to-country * restricted-bill-to-country * line-item-update-failure * line-item-creation-failure * inventory-unavailable-error * over-private-store-shopper-restriction * private-store-remaining-quantity-under-line-item-restriction * invalid-product-id * add-base-product-cart-error * under-private-store-line-item-restriction * payment-unexpected-error
application/json
413
* custom_description_exceeds_limitation
application/json
post
POST /v1/shoppers/me/carts/active/line-items HTTP/1.1
Host: api.digitalriver.com
Content-Type: application/json
Accept: */*
Content-Length: 225

{
  "lineItems": {
    "lineItem": {
      "id": "991101014",
      "quantity": "1",
      "product": {
        "id": 1234
      },
      "pricing": {
        "salePrice": {
          "currency": "USD",
          "value": "10.99"
        }
      },
      "customAttributes": {
        "attribute": [
          {
            "name": "name",
            "value": "string",
            "type": "string"
          }
        ]
      }
    }
  }
}
{
  "lineItems": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items",
    "lineItems": [
      {
        "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",
            "value": 0
          },
          "formattedImportTax": "0.00USD",
          "importDuty": {
            "currency": "USD",
            "value": 0
          },
          "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",
                  "value": 0
                },
                "formattedImportTax": "0.00USD",
                "importDuty": {
                  "currency": "USD",
                  "value": 0
                },
                "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"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}