Describing line items
Understand how to describe a checkout's products or services
You use a checkout's items[] array to pass data on products and/or services in a customer's cart. The elements of items[] allow you to:
After you create a checkout, we return an items[].id that uniquely identifies each of a checkout's line items. This identifier is needed to modify the line item in a update checkout requests.
Since update checkout requests only allow you to modify subscription, ship from and meta data, your create checkout request must include a line item's product data, price, and quantity.
For more information, refer to the sending the create checkout request section on the Building checkouts page.

Sending product data in checkouts

In a create checkout request, you must provide Digital River both basic and compliance data on the products in a customer's cart. You have three options for sending Digital River this product data. You can:
Whichever option you select, Digital River generates a unique identifier for each line item in the checkout and returns these values to you in the response.

Send basic and compliance data in SKUs

In this option, prior to checking out customers, you must define and create a SKU for each of the product's in your catalog. Each SKU needs to contain both basic and compliance product data.
For more information, refer to:
In this option, when you submit a POST/checkouts, each line item needs to contain a skuId.
POST/checkouts
1
curl --location --request POST 'https://api.digitalriver.com/checkouts' \
2
...
3
--data-raw '{
4
...
5
"items": [
6
{
7
"skuId": "d0c6c536-1a5b-4c1d-be86-92e3363a1e1f",
8
"quantity": 2,
9
"price": 10
10
}
11
]
12
}'
Copied!
Once you submit this request, Digital River retrieves all the product data that we need from the referenced SKU.
This option requires that you keep the product catalog in your system synchronized with your SKUs in our system.

Send basic data in SKUs and compliance data in SKU groups

In this option, prior to checking out customers, you must define and create a SKU for each of the product's in your catalog. The SKUs only need to contain basic product data.
Before creating checkouts, you must also associate a SKU group with each of your SKUs by setting the SKU's skuGroupId. The SKU group holds the product's compliance data.
For more information, refer to:
In this option, when you submit a POST/checkouts, each line item needs to contain a skuId.
POST/checkouts
1
curl --location --request POST 'https://api.digitalriver.com/checkouts' \
2
...
3
--data-raw '{
4
...
5
"items": [
6
{
7
"skuId": "d0c6c536-1a5b-4c1d-be86-92e3363a1e1f",
8
"quantity": 2,
9
"price": 10
10
}
11
]
12
}'
Copied!
Once you submit this request, Digital River retrieves basic product data from the referenced SKU and compliance product data from the SKU's SKU group.
This option requires that you keep the product catalog in your system synchronized with your SKUs in our system.

Common attributes and data priority in SKUs and SKU groups

If you decide to use this option, you should be aware of the attributes common to both SKUs and SKU groups:
  • Harmonized system code
  • Export control classification number
  • Tax code
In checkouts, a SKU group's data takes precedence over a SKU's data. If a common attribute is defined in a SKU, but not the SKU group it belongs to, then we use the SKU's data in the checkout.

Send basic data in product details and compliance data in SKU groups

In this option, you're not storing basic product data in Digital River's system.
Instead, during the checkout process, you retrieve basic product data from your system and use it to define productDetails in each checkout's items[].
The id in productDetails should be the same as the identifier of the product in your system..
In the productDetails object, you must reference a SKU group that holds the product's compliance data. You do this by passing a skuGroupId.
Once you submit a POST/checkouts, Digital River accesses basic product data from productDetails and compliance data from the referenced SKU group.
POST/checkouts
1
curl --location --request POST 'https://api.digitalriver.com/checkouts' \
2
...
3
--data-raw '{
4
...
5
"items": [
6
{
7
"productDetails": {
8
"id": "2837a981-9e41-408b-a1b2-ffa3223bc505",
9
"skuGroupId": "wireless-keyboards",
10
"name": "Basic wireless keyboard",
11
"description": "A simple, basic wireless keyboard",
12
"url": "https://www.company.com/basic-wireless-keyboard",
13
"countryOfOrigin": "US",
14
"image": "https://www.company.com/basic-wireless-keyboard/image",
15
"weight": 1,
16
"weightUnit": "kg",
17
"partNumber": "ce1fd95d-b211-47e8-a9b7-9941a4ce9d7a"
18
}
19
"quantity": 2,
20
"price": 10
21
}
22
]
23
}'
Copied!
In this option, since you're not persisting any basic product data in Digital River's system, you're not required to keep the product catalog in your system synchronized with SKUs in our system.
Prior to deployment, however, you do need to work with Digital River to define your SKU groups. Once defined, Digital River is responsible for managing the data in this resource.
For more information, refer to the Grouping SKUs page.

Common attributes in productDetails and SKUs

If your integration currently uses SKUs, and you're considering a migration to this option, you should be aware that the attributes in SKUs and productDetails are nearly identical.
The key exceptions are taxCode, eccn, and hsCode. These attributes exist in SKUs but not in productDetails.
However, all of these attributes contain compliance data which is saved in the associated SKU group.
SKUs also have a manufacturerId and this attribute is not in productDetails.
In Digital River coordinated fulfillments that use the distributed model or the orchestrated model, manufacturerId is used to set up products in warehouses. That process however is handled prior to deployment. So there's no need to set manufacturerId in checkouts.

Setting price and quantity

For each element in a checkout's items[] array, you must specify quantity. This represents the number of items selected by the customer. If you don't specify quantity, then its value defaults to 1.
You must also set the line item's price or aggregatePrice.
For more information on how to do this, refer to the Setting the price of an item page.

Providing subscription information

In checkouts, you set subscriptionInfo at the line-item level. For more information, refer to:

Discounting a product

For each element in a checkout's items[] array, you can set a product-level discount.
For more information, refer to the product discounts section on the Applying a discount page.

Setting a ship from location

If a checkout's products are shipping from multiple locations, you can specify each location using items[].shipFrom.
For more information, refer to the ship from address section on the Providing address information page.

Updating items

When updating products or services in a POST/checkouts/{id} request, you need to provide the line item identifier returned in the checkout.
For each line item in the update checkout request, you're restricted to updating subscription information, a product's ship from address, and metadata.
If you attempt to update any other line item data, you receive a 400 Bad Request:
400 Bad Request
1
{
2
"type": "bad_request",
3
"errors": [
4
{
5
"code": "unknown_parameter",
6
"parameter": "price",
7
"message": "'price' is an unknown parameter."
8
}
9
]
10
}
Copied!
Last modified 20d ago