Describing line items
Understand how to describe a checkout's products or services
Last updated
Understand how to describe a checkout's products or services
Last updated
You use a items[]
array to pass data on products and/or services in a customer's cart. The elements of items[]
allow you to:
After you , 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 an .
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.
In a , you must provide Digital River with basic and compliance data on the products in a customer's cart. You have three options for passing this data. You can:
Whichever option you select, Digital River always returns productDetails
.
For more information, refer to the Product basics and Managing SKUs pages.
Once you submit this request, Digital River retrieves all the product data we need from the referenced SKU.
This option requires you to keep the product catalog in your system synchronized with your SKUs in our system.
For more information, refer to:
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.
Harmonized system code
Export control classification number
Tax code
For more details, refer to Migrating to SKU groups on the Grouping SKUs page.
In this option, you don't store basic product data in Digital River's system.
The id
in productDetails
should be the same as the identifier of the product in your system.
The productDetails
object must also contain a skuGroupId
that references the SKU group that holds the product's compliance data.
Digital River then accesses basic product data from productDetails
and compliance data from the referenced SKU group.
However, prior to deployment, you 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.
productDetails
and SKUsThe key exceptions are taxCode
, eccn
, and hsCode
. These attributes exist in SKUs but not in productDetails
. This is because all of these attributes contain compliance data saved in the associated SKU group.
If you pass productDetails
, we give you back that same data.
This feature is especially useful if you employ a third-party service that sends emails and other notifications to customers. These services can configure a webhook to listen for events such as order.fulfilled
, order.cancelled
, and order.complete
, and then handle these events by retrieving data from productDetails
and passing it in the notification.
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.
For more information, refer to the product discounts section on the Applying a discount page.
For more information, refer to the ship from address section on the Providing address information page.
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
:
In this option, before checking out customers, you must define and create a for each of the product's in your catalog. Each SKU needs to contain both basic and compliance data on that product.
In this option, each items[]
in a must contain a skuId
.
In this option, before checking out customers, you must define and create a for each product in your catalog. The SKUs only need to contain basic product data.
Before , you must also associate a SKU group with each of your SKUs by setting the SKU's skuGroupId
. The holds the product's compliance data.
In this option, each items[]
in a must contain a skuId
.
If you decide to use this option, you should be aware that the following attributes are common to both and :
In , a SKU group's data precedes 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.
Instead, you retrieve this data from your system and, for each items[]
in a , use it to define productDetails
.
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 in our system.
If your integration currently uses , and you're considering a migration to this option, you should be aware that the attributes in SKUs and productDetails
are nearly identical.
Whether you send productDetails
or skuId
in , the 201 Created
response always contains productDetails
.
But if your integration sends skuId
, Digital River retrieves basic product data from the referenced (along with that object's identifier) and uses it to populate the productDetails
. If you convert the checkout to an order, productDetails
is also passed through to that object.
As a result, in both and , as well as their associated events, such as checkout.updated
, order.complete
, and subscription.reminder
, you can easily access product data without making another .
For each element in a 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
.
In , you set subscriptionInfo
at the line-item level. For more information, refer to:
For each element in a items[]
array, you can set a product-level discount
.
If a products are shipping from multiple locations, you can specify each location using items[].shipFrom
.
When updating products or services in a request, you must provide the line item identifier returned in the .