# Checkout-sessions basics

A [checkout-session](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) determines what information and options are presented to customers in [low-code checkouts](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts).

At a minimum, your [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) needs to contain [currency](#currency) and [product data](#product-data).

You can also tell us whether your prices are [tax-inclusive](#tax-inclusive).

If the customer’s cart contains [physical products](https://docs.digitalriver.com/digital-river-api/product-management/skus#how-products-are-classified-as-physical-or-digital), provide [shipping method options](#shipping-methods) for customers to select from.

When checking out [registered customers](#registered-customers), you can send their [unique identifiers](#customer-identifier) and [saved addresses](#saved-addresses).

For complete specifications, refer to the [checkout-sessions API](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions/checkout-sessions-basics.md) reference docs.

## Upstream identifier

In `upstreamId`, you can pass the unique identifier of the order in your system. If `upstreamId` is not `null`, [Prebuilt Checkout](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout) displays its value as the order number during the [thank you stage](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout#order-confirmation).

<figure><img src="/files/8CPi2R2S8EtFQAfyGu8o" alt=""><figcaption></figcaption></figure>

## Currency

You need to pass `currency` in your [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions). This value determines how amounts are denominated in the checkout experience.

## Language

To control how the checkout experience, purchase invoices, and credit memos are localized, you can pass `language` in the create checkout-session request.

For a list of accepted values, refer to [Supported languages](/digital-river-api-reference/digital-river-api-reference-guide/supported-languages.md).

{% hint style="info" %}
If you define [`options.language`](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object/configuring-prebuilt-checkout#customize-order-confirmation) in the [Prebuilt Checkout's configuration object](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object/configuring-prebuilt-checkout), that value gets assigned to the [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `language`.
{% endhint %}

Digital River uses the [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `language` to set the [checkout's ](/digital-river-api-reference/2021-12-13/checkouts.md)`language`, determining [how purchase invoices and credit memos are localized](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/designating-a-locale) once the [order](/digital-river-api-reference/2021-12-13/orders.md) is successfully created.

## Product data

For each product in the customer’s cart, you'll need to use `items[]` to send the:

* `skuId` or `productDetails`. For details, refer to [Product basics](https://docs.digitalriver.com/digital-river-api/product-management/skus).
* `price` or `aggregatePrice`. For details, refer to [Setting product price](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/describing-the-items#setting-price-and-quantity).
* `quantity`

```json
{
  "currency": "USD",
  "items": [
    {
      "skuId": "3ea112ec-83b6-45c7-8e22-e2114e903745",
      "quantity": 1,
      "price": 300
    }
  ],
  ...
}
```

You can also use `items[]` to provide:

* [`subscriptionInfo`](#subscription-information).
* a [`shipFrom`](#ship-from) location.
* a `discount` on the product
* a [`strikeThroughPrice`](#strike-through-price) that highlights how much customers are saving

### Subscription information

If you're using an external subscription service and would like the billing frequency of the subscription that the customer is acquiring to be displayed in the checkout experience, then specify a `plan.interval` and `plan.intervalCount` in `items[].subscriptionInfo` of your create[ checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions).

{% hint style="success" %}
For details on configuring a [checkout-session](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) for use with [Digital River's subscription service](https://docs.digitalriver.com/digital-river-api/using-our-services/subscriptions), refer to [Processing subscription acquisitions](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/processing-subscription-acquisitions).
{% endhint %}

```
curl --location 'https://api.digitalriver.com/drop-in/checkout-sessions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Your secret API key>' \
--header 'Cookie: incap_ses_1534_1638494=XqzQWfBdTnr/Iulkbd1JFRgmMGUAAAAATAFsJGY9H4p0aPzzfZ+ABg==; nlbi_1638494_1914372=rwWKAgHbKVXvxmI9vwbRrQAAAADFueEsAnIupi3c6RgUhNET; visid_incap_1638494=ZgPNr8DiSPety37xbpnVqijUnmQAAAAAQUIPAAAAAAC6uhinP72rh9xkXa7aYFH+' \
--data-raw '{
    ...
    "items": [
        {
            ...
            "subscriptionInfo": {
                "plan": {
                    "interval": "month",
                    "intervalCount": 1
                }
            }
        }
    ],
    ...
}'
```

Digital River reads those values and displays them in the order summary section of [Prebuilt Checkout](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout).

{% hint style="warning" %}
This feature is not yet supported in [Components](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/implementing-a-components-checkout).
{% endhint %}

<figure><img src="/files/dzUzLdZLOjLPUExdaMwT" alt=""><figcaption></figcaption></figure>

Additionally, if you need this data to populate [email notifications](https://docs.digitalriver.com/digital-river-api/order-management/customer-notifications) or some other potential use case, then we also add these key-value pairs to the [`event` ](#events)with a [`type` ](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/events-1#event-types)of [`checkout_session.order.created`](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions/spaces/-LqH4RJfLVLuHPXuJyTZ/pages/okHqAQ9d1PaLPLjq6nZF#checkout_session.order.created).

### Strike through price

To highlight how much customers are saving when purchasing a product, you can send `items[].strikeThroughPrice`. The value you assign this parameter in a [create checkout-session](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) request typically represents the original, pre-discounted price of an `items[]`, which Digital River then crosses out and displays next to the discounted `price`.

{% tabs %}
{% tab title="Create checkout-sessions request" %}

```
curl --location 'https://api.digitalriver.com/drop-in/checkout-sessions' \
...
--data-raw '{
  ...
  "items": [
    {
      ...
      "quantity": 1,
      "price": 100,
      "strikeThroughPrice": 125
    }
  ],
  ...
}
```

{% endtab %}

{% tab title="Prebuilt Checkout" %}

<figure><img src="/files/hKMz16SA6knmxHOBFrFw" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Components" %}
{% hint style="info" %}
The [order summary component](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object/components/order-summary-component) currently doesn't support this feature.
{% endhint %}
{% endtab %}
{% endtabs %}

Other parameters in the request don't affect how `strikeThroughPrice` is rendered in the checkout experience. Digital River displays its value *as is*. For example, we don't adjust it depending on the [`taxInclusive`](#tax-inclusive) setting.

So, if an `items[]` has a `quantity` that's greater than `1`, and you're trying to communicate a discount, make sure you implement pre-request logic that ensures `strikeThroughPrice` is less than `price` multiplied by `quantity`. Otherwise, the product's price will appear to be marked up instead of discounted.

The parameter is not intended for use with either `discount` or `items[].discount` since this might result in conflicting information being displayed in the experience.

If you're using the [local pricing service](https://docs.digitalriver.com/digital-river-api/using-our-services/local-pricing), then we perform a currency conversion on `strikeThroughPrice`, just like we do with `price`, based on what [users have selected](https://docs.digitalriver.com/digital-river-api/using-our-services/local-pricing#local-pricing-selector) when they initiate checkout.

## Shopping country

A [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `shoppingCountry` represents the country in which a customer is based.

If you send a `shoppingCountry` that's not `null`, Digital River uses that value to populate the [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `shipTo.address.country`. This is true whether [`items[]`](#product-data) represents [physical, digital, or mixed goods](https://docs.digitalriver.com/digital-river-api/product-management/skus#how-products-are-classified-as-physical-or-digital).

{% hint style="success" %}
You can also [save a default shopping country in Digital River Dashboard](https://docs.digitalriver.com/digital-river-api/administration/dashboard/settings/prebuilt-checkout#create-a-prebuilt-checkout). If you do so, `shoppingCountry` in a [`POST /drop-in/checkout-sessions`](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) overrides (but doesn't overwrite) the value saved in the Digital River Dashboard.
{% endhint %}

Additionally, `shoppingCountry` prompts Digital River to disable the shipping country drop-down menu and blocks customers from selecting any [`options.addresses[]`](#saved-addresses) whose `country` doesn't match `shoppingCountry`.

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

<div align="left"><figure><img src="/files/xrKpOAdnVxByey4qGi68" alt="" width="563"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Components" %}

<div align="left"><figure><img src="/files/quvbsnqi8wiXQZsCnOdF" alt="" width="563"><figcaption></figcaption></figure></div>
{% endtab %}
{% endtabs %}

However, a [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `shoppingCountry` and `billTo.address.country` don't need to match. As a result, the bill to country drop-down menu remains operable, and customers can choose from any [`options.addresses[]`](#saved-addresses).

{% tabs %}
{% tab title="POST  /drop-in/checkout-sessions" %}
The following [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) passes `shoppingCountry` , and its single [`items[].skuId`](#product-data) reference a [digital product](https://docs.digitalriver.com/digital-river-api/product-management/skus#how-products-are-classified-as-physical-or-digital).

```
curl --location --request POST 'https://api.digitalriver.com/drop-in/checkout-sessions' I am running a few minutes late; my previous meeting is running over.
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <secret API key>' \
....
    "currency": "JPY",
    ...
    "items": [
        {
            "skuId": "sku-dig-subscription-01",
            "quantity": 1,
            "price": 459
        }
    ],
    "shoppingCountry": "JP",
    ...
    "options": {
        ...
        "addresses": [
            {
                "address": {
                    "line1": "10380 Bren Rd W",
                    "line2": "line 2",
                    "city": "Minnetonka",
                    "postalCode": "55129",
                    "state": "MN",
                    "country": "US"
                },
                "name": "John Smith",
                "phone": "952-111-1111",
                "email": "jsmith@digitalriver.com",
                "organization": "Digital River"
            },
            {
                "address": {
                    "line1": "62 Trinity Crescent",
                    "line2": "",
                    "city": "WHITCHURCH",
                    "postalCode": "CF4 9ZB",
                    "country": "GB"
                },
                "name": "Brenna Brawner",
                "phone": "07854319925",
                "email": "anna@dr.com",
                "organization": "Digital River"
            }
        ]
    }
}'
```

{% endtab %}

{% tab title="Delivery information" %}
As a result, the country drop-down menu in the delivery information stage is locked.

<div align="left"><figure><img src="/files/vK4GdUBlWjk6wBOr06iA" alt=""><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Billing information" %}
In the billing information stage, however, the country selector remains operational.

**Prebuilt Checkout**

<div align="left"><figure><img src="/files/lmxh26GXhdb9wOmCZmVE" alt=""><figcaption></figcaption></figure></div>

**Components**

<div align="left"><figure><img src="/files/biErBymSWHDK3rzRf4i1" alt="" width="563"><figcaption></figcaption></figure></div>
{% endtab %}

{% tab title="Events" %}
And even though [`items[]`](#product-data) only references [digital products](https://docs.digitalriver.com/digital-river-api/product-management/skus#how-products-are-classified-as-physical-or-digital), the [`checkout_session.order.created`](https://docs.digitalriver.com/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions/spaces/-LqH4RJfLVLuHPXuJyTZ/pages/okHqAQ9d1PaLPLjq6nZF#checkout_session.order.created) and `order.*` [events ](https://docs.digitalriver.com/digital-river-api/order-management/events-and-webhooks-1/events-1)contain `shipTo.address.country`.

{% code title="order.accepted" %}

```json
{
    "id": "6ea4f842-0da7-488b-a078-50444df607b6",
    "type": "order.accepted",
    "data": {
        "object": {
            "id": "246318070336",
            ...
            "shipTo": {
                "address": {
                    "country": "JP"
                }
            },
            ...
            "billTo": {
                "address": {
                    "line1": "123 My St",
                    "city": "Tokyo",
                    "postalCode": "100-0013",
                    "country": "JP"
                },
                ...
            },
            ...
            "items": [
                {
                    "id": "175174880336",
                    "skuId": "sku-dig-subscription-01",
                    ...
                }
            ],
            ...
        }
    },
    ...
}
```

{% endcode %}
{% endtab %}
{% endtabs %}

The `shoppingCountry` also plays a role in determining:

* What [address validations](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/providing-address-information#address-requirements-and-validations) a customer's inputs are subjected to.
* Whether customers are shown a form that collects their tax identification number and whether they have the option to enter a value or are required to do so.
* The options are displayed in the payment collection stage.
* The designated [selling entity](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/selling-entities) affects what compliance disclosures are displayed and whether a [purchase invoice](https://docs.digitalriver.com/digital-river-api/order-management/accessing-invoices-and-credit-memos) is eventually generated.

## Ship from

If [`items[]`](#product-data) contains [physical products](https://docs.digitalriver.com/digital-river-api/product-management/skus#how-products-are-classified-as-physical-or-digital), then your [checkout-session](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) needs to meet certain `shipFrom.address` requirements.

Refer to [Ship from requirements](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/providing-address-information#ship-from-requirements) on the [Providing address information](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/providing-address-information) page for details. There, you will find [checkout ](/digital-river-api-reference/2021-12-13/checkouts.md)requirements, which the checkout-session wraps.

To get this data added to the checkout-session, you can:

* Send `shipFrom` in a [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions).
* [Save a default ship-from address in the Digital River Dashboard](https://docs.digitalriver.com/digital-river-api/administration/dashboard/settings/prebuilt-checkout#create-the-prebuilt-checkout-configuration). If you do this, then any `shipFrom` values sent in a [`POST /drop-in/checkout-sessions`](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) override (but don't overwrite) those saved in the Digital River Dashboard.
* [Use a shipping endpoint](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/using-a-shipping-endpoint) to dynamically provide Digital River with one or more `shipFrom` locations during the checkout process.

## Customer type

The [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `customerType` indicates whether customers are purchasing an `individual` or on behalf of a `business`.

If `customerType` is `business`, customers must enter their company's name in the shipping and billing information collection forms.

In many cases, a value of `business` is required to activate the tax identifier collection form. For details, refer to [Supported tax identifiers](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/tax-identifiers#supported-tax-identifiers).

### Auto collect customer type

You can pass [`customerType`](#customer-type) in a [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions). But to do so, you'll need to have this information before initiating checkout.

If you'd like Digital River to ask customers during the checkout process whether they're purchasing on behalf of a business, then you'll need to [turn on this feature in Digital River Dashboard](https://docs.digitalriver.com/digital-river-api/administration/dashboard/settings/prebuilt-checkout), and your [`POST /drop-in/checkout-sessions`](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) must (1) omit `customerType` (2) or assign a value of `individual` or `null` to this parameter.

For details, refer to:

* [B2B transactions](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout#business-to-business-transactions) in the [Name and address stage](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout#name-and-address) on the [Prebuilt Checkout](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout) page
* [Business to business transactions](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object/components/address-component#business-to-business-transactions) on the [Address Component](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object/components/address-component) page.

## Tax-inclusive

The `taxInclusive` boolean determines how we treat product prices when calculating tax.

It also dictates how prices are displayed in the checkout experience. The default value is `false`. If you set `taxInclusive` to `true`, then the experience indicates that the total amount includes VAT.

## Registered customers

For checkouts initiated by a registered customer, your [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) can include the following:

* [A customer identifier](#customer-identifier)
* [Saved addresses](#saved-addresses)

### Customer identifier

To check out customers registered in your system, send their `customerId`.

```json
{
  ...
  "customerId": "230f61be-8822-4325-9926-e9d0731691b4"
  ...
}
```

Digital River uses this value to determine whether a [customer](/digital-river-api-reference/2021-12-13/customers.md) with that identifier exists in our system.

If it does, we retrieve that [customer's ](/digital-river-api-reference/2021-12-13/customers.md)transaction-applicable [`taxIdentifiers`](https://docs.digitalriver.com/digital-river-api/integration-options/checkouts/creating-checkouts/tax-identifiers)`[]` and payment [`sources[]`](https://docs.digitalriver.com/digital-river-api/payments/payment-sources) and, for convenience purposes, present them as options in the tax identifier and payment collection forms.

If the [customer](/digital-river-api-reference/2021-12-13/customers.md) doesn’t yet exist in our system, we create a new object and assign it the `customerId` you provided.

In either case, as registered customers progress through a [Prebuilt Checkout](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout), they can save their shipping information, tax identifiers, and billing information for future transactions. They can also do the same for their selected payment method in [Prebuilt Checkout](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout) and [Components](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/implementing-a-components-checkout).

### Saved addresses

If you persist registered customers’ addresses, and the customer checking out has one or more saved values in your system, you can use `options.addresses[]` to send Digital River this data.

```json
{
  ...
  ...
  "options": {
  ...
    "addresses": [
      {
        "address": {
          "line1": "10380 Bren Rd W",
          "city": "Minnetonka",
          "postalCode": "55129",
          "state": "MN",
          "country": "US"
        },
        "name": "John Smith",
        "phone": "952-111-1111",
        "email": "jsmith@digitalriver.com",
        "organization": "Digital River",
        "additionalAddressInfo": {
          "neighborhood": "Centro",
          "division": "営業部",
          "phoneticName": "ヤマダ タロ"
        }
      },
      {
        "address": {
          "line1": "62 Trinity Crescent",
          "city": "WHITCHURCH",
          "postalCode": "CF4 9ZB",
          "country": "GB"
        },
        "name": "Anna Brawner",
        "phone": "07854319925",
        "email": "anna@dr.com",
        "organization": "Digital River",
        "additionalAddressInfo": {
          "neighborhood": "Centro",
          "division": "営業部",
          "phoneticName": "ヤマダ タロ"
        }
      }
    ]
  },
  ...
}
```

In the address collection stage, we present these saved values to customers for convenience.

{% hint style="info" %}
For each `options.addresses[]`, Digital River only displays its `name` and `address`.
{% endhint %}

## Shipping methods

If [`items[]`](#product-data) contain [physical products](https://docs.digitalriver.com/digital-river-api/product-management/skus#how-products-are-classified-as-physical-or-digital), you must provide Digital River shipping options for customers to select from. You can do this in one of the following ways:

First, you can send `options.shippingMethods[]` in the [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions).

Alternatively, you can [save default shipping methods in the Digital River Dashboard](https://docs.digitalriver.com/digital-river-api/administration/dashboard/settings/prebuilt-checkout#create-the-prebuilt-checkout-configuration). These represent static options (i.e., ones whose `amount` and `serviceLevel` are not dependent on where the products are being shipped or how much they weigh). If you use this approach, `options.shippingMethods[]` sent in the [create checkout-session request](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout#creating-a-checkout-session) overrides your saved values in the Digital River Dashboard.

Finally, you can [set up a shipping endpoint that Digital](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/using-a-shipping-endpoint) River calls at checkout time. This lets you offer your customers dynamic options in the shipping method selection stage. The data returned by this endpoint overrides any `options.shippingMethods[]` sent in your request or saved in the Digital River Dashboard.

For each of the [checkout-session's](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md) `options.shippingMethods[]`, the user is displayed its `amount`, `description`, and [`shippingTerms`](/digital-river-api-reference/digital-river-api-reference-guide/glossary.md#shipping-terms), as well as `businessDaysInTransit`, `estimatedArrival.date`, and `estimatedArrival.dayOfWeek` in `deliveryInformation`.

<pre class="language-json"><code class="lang-json">{
  ...
<strong>    "options": {
</strong>            "shippingMethods": [
                {
                    "amount": 5,
                    "description": "standard",
                    "serviceLevel": "SG",
                    "deliveryInformation": {
                        "businessDaysInTransit": "3 Business Days",
                        "estimatedArrival": {
                            "date": "2024-05-18T12:00:00",
                            "dayOfWeek": "Saturday"
                        },
                        "pickupDate": "2024-05-16T17:30:00",
                        "weekendService": {
                            "saturdayDelivery": true
                        },
                        "supportCutoffTime": "15:30:00"
                    }
                },
                {
                    "amount": 15,
                    "description": "next day",
                    "serviceLevel": "ND",
                    "deliveryInformation": {
                        "businessDaysInTransit": "1 Business Day",
                        "estimatedArrival": {
                            "date": "2024-05-15T12:00:00",
                            "dayOfWeek": "Thursday"
                        },
                        "pickupDate": "2024-05-16T17:30:00",
                        "weekendService": {
                            "saturdayDelivery": false
                        },
                        "supportCutoffTime": "15:30:00"
                    }
                }
            ]
        ...
      },
      ...
}
</code></pre>

{% hint style="success" %}
Each `options.shippingMethods[]` requires an `amount` but not a `serviceLevel`. However, this data helps Digital River detect fraud, so we highly encourage you to pass it.
{% endhint %}

If you submit a [`POST /drop-in/checkout-sessions`](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) with physical [`items[]`](#product-data) but without `options.shippingMethods[]`, and you don't have [default shipping methods](https://docs.digitalriver.com/digital-river-api/administration/dashboard/settings/prebuilt-checkout) or a shipping[ callout endpoint](https://docs.digitalriver.com/digital-river-api/administration/dashboard/settings/prebuilt-checkout#configure-a-shipping-callout) saved in Digital River Dashboard, then the request returns the following error:

{% code title="400 Bad Request" %}

```json
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_request",
            "message": "Shipping methods are required with physical items"
        }
    ]
}
```

{% endcode %}

## Store credits

The [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions) `options` allows you to pass one or more `storeCredits[]`. Each element in this array can be defined by an [`amount`](#amount), [`name`](#name), [`upstreamId`](#upstreamid), [`iconUrl`](#iconurl), and [`lastFour`](#lastfour).

{% hint style="info" %}
In the payment collection forms, we display `amount`, `name`, `iconUrl` and `lastFour` to customers.
{% endhint %}

For more details, refer to [Offering store credit](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/offering-store-credit).

```
curl --location --request POST 'https://api.digitalriver.com/drop-in/checkout-sessions' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Secret API key>' \
....
--data-raw '{
    ...
    "options": {
        ...
        "storeCredits": [
            {
                "amount": 5,
                "name": "Acme Inc.",
                "upstreamId": "7654-2345-0987-123456",
                "iconUrl": "https://acme-inc.com/store-credit-log.png",
                "lastFour": "7831"
            }
        ]
    }
}'
```

#### `amount`

This required parameter represents how much credit you’re offering the customer.

#### `name`

The name of the store credit offer. Omitting `name` or passing a `null` value doesn't throw an [error](/digital-river-api-reference/digital-river-api-reference.md#error-types), but it does mean that that particular `storeCredits[]` won't be displayed in the payment collection form.

#### `upstreamId`

This required parameter uniquely identifies the line of credit in your system. Passing multiple `storeCredits[]` that share the same `upstreamId` is not allowed.

{% code title="400 Bad Request" %}

```json
{
    "type": "bad_request",
    "errors": [
        {
            "code": "invalid_parameter",
            "parameter": "options.storeCredits",
            "message": "Unique value required for upstreamId."
        }
    ]
}
```

{% endcode %}

#### `iconUrl`

The web address of your store credit logo.

#### `lastFour`

The last four digits of the customer's store credit card.

## Style

You can control the appearance and visual behavior of a [Prebuilt Checkout](https://docs.digitalriver.com/digital-river-api/integration-options/low-code-checkouts/drop-in-checkout#drop-in-checkout-modal-window) by defining `style` in a [create checkout-session request](/digital-river-api-reference/2021-12-13/drop-in-checkout-sessions.md#drop-in-checkout-sessions).

For details, refer to [Defining experience](https://docs.digitalriver.com/digital-river-api/developer-resources/digitalrivercheckout.js-reference/digitalrivercheckout-object/configuring-prebuilt-checkout/defining-experience).


---

# 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-reference/2021-12-13/drop-in-checkout-sessions/checkout-sessions-basics.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.
