# Grouping SKUs

A [SKU group](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/sku-groups) represents a collection of products with similar compliance requirements. SKU groups store [product compliance data](#product-compliance-data-in-sku-groups) to use when calculating taxes, determining landed cost, identifying goods at international borders, creating invoices, and numerous other downstream operations.

## Product compliance data in SKU groups

Tax codes, export control classification numbers, dangerous goods handling requirements, and delivery confirmation requirements are just some of the [product compliance data](https://docs.digitalriver.com/digital-river-api/skus#basic-versus-compliance-product-data) held in SKU groups.

## Why use SKU groups?

You can use SKU groups to:

* [Reduce your product compliance burdens](#reduce-compliance-burdens)
* [Simplify catalog management](#simplify-catalog-management)
* [Open new markets](#open-new-markets)

### Reduce compliance burdens

SKU groups minimize the complexity of product compliance. You're no longer solely responsible for researching and defining product data with SKU groups.

When you use this resource, you don't have to know your product's tax code, country-specific tariff codes, or other arcane data. Digital River uses its product classification services to help you identify these values.

### Simplify catalog management

SKU groups can also simplify the process of managing product data.

If you [use product details](https://docs.digitalriver.com/digital-river-api/product-management/using-product-details) and SKU groups in [checkouts ](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/checkouts)or [checkout-sessions](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/drop-in-checkout-sessions), you don't have to persist any [basic product data](https://docs.digitalriver.com/digital-river-api/skus#basic-versus-compliance-product-data) in Digital River's system.

Instead, at run-time, you simply retrieve this basic product data from your system and send it to us. This means you're not required to keep product catalogs in your system synchronized with [SKU](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus) data in our system.

### Open new markets

SKU groups allow you to open new markets with less effort.

As Digital River adds [product compliance fields](https://docs.digitalriver.com/digital-river-api/skus#basic-versus-compliance-product-data) to the SKU group resource, you can use the data in these fields to access new markets. In other words, your application sends the same [basic product data](https://docs.digitalriver.com/digital-river-api/skus#basic-versus-compliance-product-data) in [checkouts ](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/checkouts)or [checkout-sessions](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/drop-in-checkout-sessions). However, due to internal modifications made to the SKU group by Digital River, your products become compliant in new markets.

Similarly, new data added to existing SKU group fields can also be used to open markets.

#### Example one

At some point, Digital River will identify [product compliance data](https://docs.digitalriver.com/digital-river-api/skus#basic-versus-compliance-product-data) needed to ship goods into Indonesia. We can add this data to your SKU groups if you're interested in pursuing this market opportunity.

After that, whenever a customer in Indonesia purchases on your site, this new compliance data is passed downstream to the appropriate logistics services.

#### Example two

Your [SKU groups](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/sku-groups) may currently configure your products for sale in ten countries. At some point, however, you may identify another country where you'd like to export your products.

In this case, Digital River only needs to add product tariff codes specific to that country to your SKU groups (along with any other required compliance data) to make your products eligible for export to this country.

## Defining and managing SKU groups

Before launch, Digital River works with you to analyze your product catalog and understand your trading patterns (i.e., what products you're selling, where you're shipping these products from, and where you're shipping them, too).

We then help classify your products and determine the [compliance requirements](#product-compliance-data-in-sku-groups) for each category. That information is used to define and create your SKU groups.

Once created, you can access each SKU group's unique identifier and alias.

### The SKU group

Digital River exposes a SKU group's unique identifier and alias.

#### Unique identifier

A SKU group's unique `id` reflects the products that are associated with it. For example, if your site sells computer accessories, your SKU groups might have some of the following `id` values:

* `wireless-keyboards`
* `wireless-mice`
* `memory-cards`
* `docking-stations`

You can use this identifier to (1) [associate SKU groups with products](#using-sku-groups-in-transactions) and (2) [list SKU groups](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus#skus).

#### Alias

A SKU group's `alias` is meant to provide a more detailed description of the SKU group. For example, a SKU group with an `id` of `wireless-keyboards` might have an `alias` of `wireless keyboards with lithium-ion batteries`.

### **Managing SKU groups**

Digital River and you are responsible for:

* Defining [product compliance data](#product-compliance-data-in-sku-groups) in your SKU groups
* Ensuring that the compliance data in your SKU groups remains up to date

Digital River is responsible for:

* Creating SKU groups
* Updating SKU groups
* Deleting SKU groups

You are responsible for:

* [Associating SKU groups with your products](#using-sku-groups-in-transactions)
* Dissociating SKU groups from your products
* Informing Digital River of changes to your SKU group requirements

## Associating SKU groups <a href="#using-sku-groups-in-transactions" id="using-sku-groups-in-transactions"></a>

Depending on how you send product data in [create checkout](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/describing-the-items#sending-product-data) or [create checkout session](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout#product-data) requests, you need to either (1) associate your SKU groups with SKUs or (2) associate your SKU groups with products in your system.

{% hint style="info" %}
You can associate SKU Groups with SKUs by specifying `skuGroupId` in the body of a [`POST /skus`](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus#skus-1), [`POST/skus/{id}`](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus#skus-id-1), or [`PUT/skus/{id}`](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus#skus-id-2) request.
{% endhint %}

A [`GET /sku-groups`](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus#skus) request provides a menu of your available SKU groups:

```javascript
{
    "hasMore": false,
    "data": [
        {
            "id": "wireless-keyboards",
            "alias": "Wireless keyboards with lithium-ion batteries"
        },
        {
            "id": "wireless-mice",
            "alias": "Wireless mice with lithium-ion batteries"
        },
        {
            "id": "memory-cards",
            "alias": "Compact flash memory cards"
        },
        {
            "id": "docking-stations",
            "alias": "Port replicator/hub docking stations"
        }
    ]
}
```

You could use this returned data to run a job that associates each SKU group with the appropriate SKUs in our system or products in your system. (e.g., For each of your SKUs that describe a wireless keyboard, set its `skuGroupId` to `wireless-keyboards`).

You could also use a `GET/sku-groups` to help you build a GUI widget in your admin portal that allows users to associate and disassociate SKU groups with SKUs and products.

## Migrating to SKU groups

If you’re currently using [SKUs ](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/skus)and are considering a migration to SKU groups (or are in the process of doing so already), then you should be aware that for every `items[]` you add to a checkout or a [checkout-session](https://app.gitbook.com/s/x8fSFzVR3sg0TsNWwwVz/drop-in-checkout-sessions), SKU group data takes precedence over SKU data.

This prioritization logic applies to any differing [tax codes](https://docs.digitalriver.com/digital-river-api/creating-and-updating-skus#tax-code), [harmonized system codes](https://docs.digitalriver.com/digital-river-api/creating-and-updating-skus#harmonized-system-code), and [export control classification numbers](https://docs.digitalriver.com/digital-river-api/creating-and-updating-skus#eccn) in the SKU and its associated SKU group.

For example, let’s say an `items[]` in a checkout contains a reference to a SKU whose [`taxCode`](https://docs.digitalriver.com/digital-river-api/creating-and-updating-skus#tax-code) is `4323.310_A` and that same SKU is associated with a SKU group that stores a different tax code.

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

```javascript
{
    "id": "7ce5a1a4-9b2b-419c-b6d0-4be836c273f9",
    ...
    "items": [
        {
            "id": "f131a7b3-c1bb-4c83-bd8a-c0ba2bcc3b0f",
            "skuId": "13e038fe-0b23-4502-86c5-ab4496a9674d",
            ...
            "tax": {
                "rate": 0.07525,
                "amount": 1.51
            },
            ...
        }
    ],
    ...
}
```

{% endtab %}

{% tab title="SKU" %}

```javascript
{
    "id": "13e038fe-0b23-4502-86c5-ab4496a9674d",
    "createdTime": "2022-05-20T16:33:51Z",
    "name": "Widget",
    "eccn": "EAR99",
    "updatedTime": "2022-05-20T17:04:40Z",
    "taxCode": "4323.310_A",
    "countryOfOrigin": "US",
    "fulfill": false,
    "hsCode": "1006.20.4025",
    "liveMode": false,
    "physical": true,
    "skuGroupId": "ae38fd2b-2ab1-4218-9e3c-bc9881eb19f0"
}
```

{% endtab %}
{% endtabs %}

In this case, Digital River’s tax service uses the SKU group’s tax code when computing that line item's taxes. The service also uses that same tax code to determine whether the item’s products should be treated as [physical or digital goods](https://docs.digitalriver.com/digital-river-api/skus#how-products-are-classified-as-physical-or-digital).

For more details, refer to:

* [Sending product data in checkouts](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/describing-the-items#send-basic-data-in-skus-and-compliance-data-in-sku-groups)
* [Basic versus compliance product data](https://docs.digitalriver.com/digital-river-api/skus#basic-versus-compliance-product-data)
* [Product compliance data in SKU groups](#product-compliance-data-in-sku-groups)
