Managing items with shared SKU identifiers

Learn how to add multiple items that share the same SKU identifier‌ to a Checkout or Invoice.

In a single Checkout or Invoice, you can add multiple line items that share a SKU identifier but differ in price , discount type, or subscription details.‌

The following sections demonstrate how items that share a skuId can be differentiated based on price and subscription information and how each item is assigned a unique identifier in the Order response.

Setting different prices

This create Checkout request contains two items with the same skuId but different price values. In addition, one item has a discount applied to it.

--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_key>' \
--header 'Content-Type: text/plain' \
--data-raw '
{
    "currency": "USD",
    "customerId": "987654321",
    "items": [
        {
            "skuId": "05081978",
            "price": 100.00,
            "quantity": 1
        },
        {
            "skuId": "05081978",
            "price": 90.00,
            "quantity": 1,
            "discount":
            {
                "percentOff": 10
            }
        }
    ]
}'

Even though they share the same skuId, Digital River handles both items separately, returning different amount and tax.amount values for each.

{
    "id": "177406730336",
...
    "items": [
        {
            "skuId": "05081978",
            "amount": 100.0,
            "quantity": 1,
            "tax": {
                "rate": 0.07125,
                "amount": 7.13
            }
        },
        {
            "skuId": "05081978",
            "amount": 81.0,
            "quantity": 1,
            "discount": {
                "percentOff": 10.0,
                "quantity": 1
            },
            "tax": {
                "rate": 0.07125,
                "amount": 5.77
            }
        }
    ],
...
}

The returned checkout id can then be used to create an Order. In the response to that POST/orders request, each element of the items array has been assigned a unique itemId.

{
    "id": "177406750336",
...
    "items": [
        {
            "itemId": "96361160336",
            "skuId": "05081978",
            "amount": 100.0,
            "quantity": 1,
...
            "tax": {
                "rate": 0.07125,
                "amount": 7.13
            }
        },
        {
            "itemId": "96361170336",
            "skuId": "05081978",
            "amount": 81.0,
            "quantity": 1,
            "discount": {
                "percentOff": 10.0,
                "quantity": 1
            },
...
            "tax": {
                "rate": 0.07125,
                "amount": 5.77
            }
        }
    ],
...
}

Handling multiple subscription requests

Perhaps you have a customer who wants to purchase an auto-renew digital magazine subscription for himself and another, nearly identical subscription for a friend. The only difference is that the subscription for the friend must be manually renewed.

In the create Checkout or create Invoice request, assign each item the same skuId but different autoRenewal and subscriptionId values.

curl --location --request POST 'https://api.digitalriver.com/checkouts' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <API_key>' \
--header 'Content-Type: text/plain' \
--data-raw '{
    "currency": "USD",
    "customerId": "987654321",
    "items": [
        {
            "skuId": "08141946",
            "subscriptionInfo": {
                "autoRenewal": true,
                "terms": "Insert terms here",
                "subscriptionId": "123"
            },
            "price": 100,
            "quantity": 1
        },
        {
            "skuId": "08141946",
            "subscriptionInfo": {
                "autoRenewal": false,
                "terms": "Insert terms here",
                "subscriptionId": "321"
            },
            "price": 75,
            "quantity": 1
        }
    ]
}'

The returned checkout id can then be used to create an Order. In the response to that POST/orders request, each element of the items array has been assigned a unique itemId. These identifiers are used to create and cancel fulfillments and process returns and refunds.

{
    "id": "177433630336",
    ...
    "items": [
        {
            "itemId": "96392860336",
            "skuId": "08141946",
            ...
            "subscriptionInfo": {
                "subscriptionId": "123",
                "terms": "Insert terms here",
                "autoRenewal": true,
                "freeTrial": false
            }
        },
        {
            "itemId": "96392870336",
            "skuId": "08141946",
            ...
            "subscriptionInfo": {
                "subscriptionId": "321",
                "terms": "Insert terms here",
                "autoRenewal": false,
                "freeTrial": false
            }
        }
    ],
...
}

Last updated