# Managing items with shared SKU identifiers

In a single Checkout or Invoice, you can add multiple [line items](/digital-river-api/order-management/creating-and-updating-an-order.md#line-items) that share a [SKU identifier](/digital-river-api/product-management/creating-and-updating-skus.md#specifying-a-sku-identifier) but differ in [price](/digital-river-api/integration-options/checkouts/creating-checkouts/describing-the-items/price-of-an-item.md), [discount type](/digital-river-api/integration-options/checkouts/creating-checkouts/applying-a-discount.md), or [subscription details](/digital-river-api/integration-options/checkouts/subscriptions/subscription-information-1.md).‌

The following sections demonstrate how items that share a `skuId` can be differentiated based on [price](#setting-different-prices) and [subscription information](#handling-multiple-subscription-requests) and how each item is assigned a [unique identifier in the Order response](/digital-river-api/order-management/creating-and-updating-an-order.md#line-items).

## Setting different prices

This [create checkout](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/checkouts#checkouts-1) request contains two items with the same `skuId` but different `price` values. In addition, one item has a `discount` applied to it.

{% tabs %}
{% tab title="curl" %}

```
--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
            }
        }
    ]
}'
```

{% endtab %}
{% endtabs %}

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

{% tabs %}
{% tab title="JSON" %}

```javascript
{
    "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
            }
        }
    ],
...
}
```

{% endtab %}
{% endtabs %}

The returned checkout `id` can then be used to [create an order](https://docs.digitalriver.com/digital-river-api-reference/2020-12-17/orders#orders-1). In the response to that [`POST /orders`](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/orders#orders-1) request, each element of the `items` array has been assigned a unique `itemId`.

{% tabs %}
{% tab title="JSON" %}

```javascript
{
    "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
            }
        }
    ],
...
}
```

{% endtab %}
{% endtabs %}

## 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 friend's subscription must be manually renewed.

In the [create checkout](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/checkouts#checkouts-1) or [create invoice](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/invoices#invoices-1) request, assign each item the same `skuId` but different `autoRenewal` and `subscriptionId` values.

{% tabs %}
{% tab title="curl" %}

```
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
        }
    ]
}'
```

{% endtab %}
{% endtabs %}

The returned checkout `id` can then be used to [create an order](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/orders#orders-1). In the response to that [`POST /orders`](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/orders#orders-1) request, each element of the `items` array has been assigned a unique `itemId`. Use these identifiers to [create](/digital-river-api/order-management/informing-digital-river-of-a-fulfillment.md) and [cancel](/digital-river-api/order-management/informing-digital-river-of-a-fulfillment.md) [fulfillments](/digital-river-api/order-management/fulfillments.md) and process [returns ](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/returns)and [refunds](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/refunds).

{% tabs %}
{% tab title="JSON" %}

```javascript
{
    "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
            }
        }
    ],
...
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/describing-the-items/managing-items-with-shared-sku-identifiers.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
