> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Create Cart

POST https://api.bigcommerce.com/stores/{store_hash}/v3/carts
Content-Type: application/json

Creates a **Cart**. 

**Required Fields**

|Field|Details|
|-|-|
|`line_item`|Specifies a line item.| 
|`custom_items`|Specifies a custom item. Only required if adding a custom item to the cart.|
|`gift_certificates`|Specifies a gift certificate. Only required if adding a gift certificate to the cart.|

**Usage Notes**

* A **cart** `id` (UUID) is returned in the response.
* A **cart** `id` is the same as a **checkout** `id`.
* A cart can be created by adding an existing **catalog item** or a **custom item**.
* Images are not supported for custom items. The `image_url` field is accepted but does not render on the storefront.
* Carts are valid for **30 days** from the **last modification** (this includes creating the cart or editing the cart).
* If a product has modifiers, use the `option_selections` array to describe the **modifier** selection(s).
* The format and data type of a cart’s `option_value` are defined by the `value_data` object of a product’s [variant option value](/developer/api-reference/rest/admin/catalog/product-variant-options/values), [modifier value](/developer/api-reference/rest/admin/catalog/product-modifiers/values), or a combination of both.
* Redirect URLs can only be generated from carts that were created using the **REST Management API**. 
* To get cart `redirect_urls` in the response, append the following query parameter to the request URL: `include=redirect_urls`. Redirect URLs point to either a shared checkout domain or a channel-specific domain, depending on the storefront configuration.
* To restore a cart that was created by a shopper or through a Storefront API, first recreate the cart using the **REST Management API**.
* To get cart `promotions` in the response, append the following query parameter to the request URL: `include=promotions.banners`.

**Overridable fields**

When creating a cart, you can override the following catalog values on each line item:

| Field | Description |
|-|-|
| `list_price` | Override the product's price. By default, overriding a product's `list_price` makes it ineligible for V3 product-level promotions. In **Store Settings** under **Promotions and Coupons** in the control panel, you can change this behavior to allow promotions on overridden prices. |
| `name` | Override the product name. Useful for locale-specific product names. |
| `option_selections.name` | Override the name of an option or modifier selection. Useful for locale-specific option labels. |
| `option_selections.value` | Override the value of an option or modifier selection. Useful for locale-specific option values. |

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/admin/management/carts/carts-single/create-cart

## Authentication

- `X-Auth-Token` header (required) — ### OAuth scopes | UI Name | Permission | Parameter | |:--------|:-----------|:----------| |Carts|modify|`store_cart`| |Carts |read-only|`store_cart_read_only`| |Information & Settings | modify | `store_v2_information`| |Information & Settings | read-only| `store_v2_information`| ### Authentication header | Header | Argument | Description | |:-------|:---------|:------------| | `X-Auth-Token` | `access_token` | For more about API accounts that generate `access_token`s, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#api-accounts). | ### Further reading For example requests and more information about authenticating BigCommerce APIs, see [Authentication and Example Requests](/developer/docs/overview/api-fundamentals/api-accounts#x-auth-token-header-example-requests). For more about BigCommerce OAuth scopes, see our [Guide to API Accounts](/developer/docs/overview/api-fundamentals/api-accounts#oauth-scopes). For a list of API status codes, see [API Status Codes](/developer/api-reference/rest/overview#rest-http-status-codes).

## Request

### Path parameters

- `store_hash` (string, required) — Permanent ID of the BigCommerce store.

### Query parameters

- `include` (list of enum, optional) — * `redirect_urls`: Create a direct link to a cart. This can be used for the /POST request for carts. * `line_items.physical_items.options`: The cart returns an abbreviated result. Use this to return physical items product options. To return the extended cart object, use in a /POST request. * `line_items.digital_items.options`: The cart returns an abbreviated result. Use this to return digital items product options. To return the extended cart object, use in a /POST request. * `line_items.physical_items.stock_position`: Returns backorder and stock availability details for physical items. * `line_items.digital_items.stock_position`: Returns backorder and stock availability details for digital items. Since digital products cannot be backordered, backorder values are always zero. * `promotions.banners`: Returns a list of eligible banners.
  - Allowed values: `redirect_urls`, `line_items.physical_items.options`, `line_items.digital_items.options`, `line_items.physical_items.stock_position`, `line_items.digital_items.stock_position`, `promotions.banners`

### Headers

- `Accept` (string, required, default: application/json) — The [MIME type](https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types) of the response body.

### Body (application/json)

This endpoint expects a CartCreatePostData.

- `customer_id` (integer, optional)
- `line_items` (list of CartCreatePostDataLineItemsItems, optional)
- `custom_items` (list of CartPostCustomItemItems, optional)
- `gift_certificates` (list of CartCreatePostDataGiftCertificatesItems, optional)
- `channel_id` (integer, optional) — The Channel ID. If no channel is specified, defaults to 1.
- `currency` (CartCreatePostDataCurrency, optional)
- `locale` (string, optional) — The locale of the cart. Accepts strings of format `xx` or `xx-YY`. Uses the [ISO-639 standard](https://www.iso.org/iso-639-language-codes.html) format.

## Response

### 201

The requested cart.

- `data` (Cart_Full, optional) — A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.
- `meta` (metaCollection_open, optional) — Response metadata.

## Types

### CartCreatePostDataLineItemsItems

### CartPostCustomItemItems

- `sku` (string, required)
- `name` (string, required)
- `quantity` (double, required)
- `list_price` (double, required)
- `image_url` (string, optional) — Not supported for custom items. Although the API accepts this field, the image does not display on the storefront.

### CartCreatePostDataGiftCertificatesItems

- `name` (string, required) — Given name for the gift certificate line item.
- `theme` (enum, required) — The theme of the gift certificate.
  - Allowed values: `Birthday`, `Boy`, `Celebration`, `Christmas`, `General`, `Girl`
- `amount` (double, required)
- `quantity` (integer, required)
- `sender` (CartCreatePostDataGiftCertificatesItemsSender, required)
- `recipient` (CartCreatePostDataGiftCertificatesItemsRecipient, required)
- `message` (string, optional) — Message shown to recipient, as provided by sender.

### CartCreatePostDataCurrency

- `code` (string, optional) — The [transactional currency](/developer/api-reference/rest/admin/management/currencies#definitions) code for the cart, formatted as an [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) string. This field is optional; if omitted, the cart uses the store's default currency. The currency must be enabled for the store and be a transactional currency. Passing a code that is not enabled or does not exist returns a `400` error (`Currency not found`), and passing a non-transactional display currency returns a `400` error (`Currency must be transactional`). A code that is not a valid ISO-4217 string returns a `422` error.

### Cart_Full

A cart contains a collection of items, prices, discounts, etc. It does not contain customer-related data.

- `id` (string, optional) — Cart ID, provided after creating a cart with a POST request.
- `customer_id` (integer, optional) — ID of the customer to which the cart belongs.
- `channel_id` (integer, optional) — The channel ID. If no channel is specified, defaults to 1.
- `email` (string, optional) — The cart’s email. This is the same email that is used in the billing address.
- `currency` (CartFullCurrency, optional) — The currency. This is the same for both the cart and its subsequent checkout.
- `tax_included` (boolean, optional)
- `base_amount` (double, optional) — Sum of cart line-item amounts before cart-level discounts, coupons, or taxes.
- `discount_amount` (double, optional) — Order-based discounted amount only - Excludes coupon discounts and product-based discounts.
- `manual_discount_amount` (double, optional) — The entered value represents the order level manual discount.
- `cart_amount` (double, optional) — Sum of cart line-item amounts minus cart-level discounts and coupons. This amount includes taxes (where applicable).
- `coupons` (list of AppliedCoupon, optional)
- `discounts` (list of CartFullDiscountsItems, optional)
- `line_items` (LineItemsGet, optional) — `GET`
- `created_time` (string, optional) — Time when the cart was created.
- `updated_time` (string, optional) — Time when the cart was last updated.
- `locale` (string, optional) — Locale of the cart. Accepts strings of format `xx` or `xx-YY`. Uses the [ISO-639 standard](https://www.iso.org/iso-639-language-codes.html) format.
- `promotions` (CartFullPromotions, optional) — This is available only when "include=promotions.banners" is presented in the URL.
- `version` (integer, optional) — The current version of the cart increments with each successful update. You can use it to enable optimistic concurrency control for subsequent updates.

### metaCollection_open

Response metadata.

### cart_PostVariant

Product with a variant.

- `quantity` (double, optional)
- `product_id` (double, optional)
- `list_price` (double, optional) — Optional price override.
- `variant_id` (double, optional) — Variant ID. Exists only in Catalog V3.
- `name` (string, optional) — Optionally, provide a value to override the product name.
- `gift_wrapping` (CartPostVariantGiftWrapping, optional)

### cart_PostModifier

Product with a modifier.

- `quantity` (double, required)
- `product_id` (double, required)
- `list_price` (double, optional) — Optional price override.
- `name` (string, optional) — Optionally, provide a value to override the product name.
- `option_selections` (list of CartPostModifierOptionSelectionsItems, optional) — Needed for Catalog V2.

### CartCreatePostDataGiftCertificatesItemsSender

- `name` (string, optional)
- `email` (string, optional)

### CartCreatePostDataGiftCertificatesItemsRecipient

- `name` (string, optional)
- `email` (string, optional)

### CartFullCurrency

The currency. This is the same for both the cart and its subsequent checkout.

- `code` (string, optional) — The [transactional currency](/developer/api-reference/rest/admin/management/currencies#definitions) code for the cart, formatted as an [ISO-4217](https://www.iso.org/iso-4217-currency-codes.html) string.

### AppliedCoupon

|Type `int`|Type Name| |-|-| |`0`|`per_item_discount`| |`1`|`percentage_discount`| |`2`|`per_total_discount`| |`3`|`shipping_discount`| |`4`|`free_shipping`| |`5`|`promotion`|

- `code` (string, required) — The coupon code.
- `id` (string, optional) — The coupon ID. (read-only)
- `coupon_type` (enum, optional) — Key name to identify the type of coupon. type 0: per_item_discount type 1: percentage_discount type 2: per_total_discount type 3: shipping_discount type 4: free_shipping type 5: promotion
  - Allowed values: `0`, `1`, `2`, `3`, `4`, `5`
- `discounted_amount` (double, optional) — The discounted amount applied within a given context.
- `display_name` (string, optional) — Display name of the coupon.

### CartFullDiscountsItems

Example as part of a cart response: ``` "discounts": [ { "id": 2, "discounted_amount": 2 }, { "id": "coupon", "discounted_amount": 0.42 } ] ```

- `id` (string, optional) — ID of the applied discount.
- `discounted_amount` (double, optional) — The discounted amount.

### LineItemsGet

`GET`

- `physical_items` (list of ItemPhysicalGet, optional)
- `digital_items` (list of ItemDigitalGet, optional)
- `gift_certificates` (list of ItemGiftCertificateGet, optional)
- `custom_items` (list of ItemCustomGet, optional)

### CartFullPromotions

This is available only when "include=promotions.banners" is presented in the URL.

- `banners` (CartFullPromotionsBanners, optional)

### CartPostVariantGiftWrapping

- `wrap_together` (boolean, optional) — Boolean value that specifies whether items whether items should be wrapped together or wrapped individually.
- `wrap_details` (list of CartPostVariantGiftWrappingWrapDetailsItems, optional) — Details for the gift wrapping option selected. This can be specified for each line item.

### CartPostModifierOptionSelectionsItems

- `option_id` (integer, optional)
- `option_value` (integer, optional)
- `name` (string, optional) — Override for the selected option or modifier name.
- `value` (string, optional) — Override for the selected option value.
- `nameId` (integer, optional)
- `valueId` (integer, optional)

### ItemPhysicalGet

- `variant_id` (double, required) — The ID of the variant. Required in the /PUT or /POST request if the product has variants.
- `product_id` (double, required) — The ID of the product. Required in a /POST request.
- `quantity` (double, required) — Quantity of this item in the cart.
- `id` (string, optional) — The line-item ID.
- `parent_id` (string, optional) — Bundled items will have the ID of their parent item.
- `added_by_attribute_id` (string, optional, nullable) — For a bundled item added via a B2B quote, the ID of the quote-item attribute that added it. Null otherwise.
- `sku` (string, optional) — SKU of the variant.
- `name` (string, optional) — The item’s product name.
- `url` (string, optional) — The product URL.
- `taxable` (boolean, optional) — Boolean value that specifies whether the item is taxable.
- `image_url` (string, optional) — Image of the product or variant.
- `discounts` (list of ItemPhysicalGetDiscountsItems, optional)
- `coupons` (ItemPhysicalGetCoupons, optional)
- `discount_amount` (double, optional) — The total value of all discounts applied to this item. This includes coupons and cart-level discounts.
- `coupon_amount` (double, optional) — The total value of all coupons applied to this item.
- `original_price` (double, optional) — An item’s original price is the same as the product default price in the admin panel.
- `list_price` (double, optional) — The net item price before discounts and coupons are applied. BigCommerce derives an item’s list price from the product default price or, if applicable, the sale price configured in the admin panel. To enable v3 promotions at the product level, you must update the [promotion](https://support.bigcommerce.com/s/article/Store-Settings?language=en_US#promotion) settings in the control panel.
- `sale_price` (double, optional) — Price of the item after all discounts are applied. (The final price before tax calculation.)
- `extended_list_price` (double, optional) — List price of the item multiplied by the quantity.
- `extended_sale_price` (double, optional) — Sale price of the item multiplied by the quantity.
- `is_require_shipping` (boolean, optional) — Whether or not a physical product requires shipping.
- `is_mutable` (boolean, optional) — Whether or not you can change or remove the item from the cart. Items that are immutable include those added automatically by promotions.
- `added_by_promotion` (boolean, optional) — Whether or not a promotion added an additional item.
- `is_custom_price` (boolean, optional) — Whether or not the item's price was overridden with a custom value using the `list_price` field.
- `gift_wrapping` (ItemPhysicalGetGiftWrapping, optional) — The gift wrapping details for this item.
- `stock_position` (ItemPhysicalGetStockPosition, optional) — Backorder and stock availability details for this line item. Only returned when explicitly requested via `include=line_items.physical_items.stock_position` (or the `digital_items` equivalent) — not included by default.

### ItemDigitalGet

- `id` (string, optional) — The line-item ID.
- `parent_id` (string, optional) — Bundled items will have the ID of their parent item.
- `variant_id` (double, optional) — The ID of the variant. Required in the /PUT or /POST request if the product has variants.
- `product_id` (double, optional) — The ID of the product. Required in a /POST request.
- `added_by_attribute_id` (string, optional, nullable) — For a bundled item added via a B2B quote, the ID of the quote-item attribute that added it. Null otherwise.
- `sku` (string, optional) — SKU of the variant.
- `name` (string, optional) — The item’s product name.
- `url` (string, optional) — The product URL.
- `quantity` (double, optional) — Quantity of this item in the cart.
- `taxable` (boolean, optional) — Boolean value that specifies whether the item is taxable.
- `image_url` (string, optional) — Image of the product or variant.
- `discounts` (list of ItemDigitalGetDiscountsItems, optional)
- `coupons` (ItemDigitalGetCoupons, optional)
- `discount_amount` (double, optional) — The total value of all discounts applied to this item. This includes coupons and cart-level discounts.
- `coupon_amount` (double, optional) — The total value of all coupons applied to this item.
- `original_price` (double, optional) — An item’s original price is the same as the product default price in the admin panel.
- `list_price` (double, optional) — The net item price before discounts and coupons. BigCommerce derives an item’s list price from the product default price or, if applicable, the sale price configured in the admin panel.
- `sale_price` (double, optional) — Item’s price after all discounts are applied. (The final price before tax calculation.)
- `extended_list_price` (double, optional) — List price of the item multiplied by the quantity.
- `extended_sale_price` (double, optional) — Sale price of the item multiplied by the quantity.
- `is_require_shipping` (boolean, optional) — Whether or not a physical product requires shipping.
- `is_mutable` (boolean, optional) — Whether or not you can change or remove the item from the cart. Items that are immutable include those added automatically by promotions.
- `added_by_promotion` (boolean, optional) — Whether or not a promotion added an additional item.
- `is_custom_price` (boolean, optional) — Whether or not the item's price was overridden with a custom value using the `list_price` field.
- `download_file_urls` (list of string, optional) — URLs to download all product files.
- `download_page_url` (string, optional) — The URL for the combined downloads page.
- `download_size` (string, optional) — Specifies the combined download size of all files in human-readable style; for example, `30MB`.

### ItemGiftCertificateGet

- `id` (string, optional)
- `name` (string, optional) — Name provided for the gift certificate that will appear in the control panel.
- `theme` (string, optional) — The theme of the gift certificate. The following options are available:`Birthday`, `Boy`, `Celebration`, `Christmas`, `General`, and `Girl`.
- `amount` (double, optional) — Value must be between 1.00 and 1,000.00 in the store’s default currency.
- `taxable` (boolean, optional)
- `sender` (ItemGiftCertificateGetSender, optional)
- `recipient` (ItemGiftCertificateGetRecipient, optional)
- `message` (string, optional) — The message included in the gift certificate is limited to 200 characters.

### ItemCustomGet

Add a custom item to the shopperʼs cart. * Custom items are not added to the catalog. * The price should be set to match the store settings for taxes. * Images are not supported for custom items. The `image_url` field is not rendered on the storefront.

- `id` (string, optional) — ID of the custom item.
- `sku` (string, optional) — SKU of the custom item.
- `name` (string, optional) — Name of the item.
- `quantity` (string, optional)
- `list_price` (string, optional) — Specifies the price of the item. This value can include or exclude tax, depending on the store setup.
- `extended_list_price` (double, optional) — List price of the item multiplied by the quantity.
- `image_url` (string, optional) — Not rendered on the storefront. Although the API accepts and returns this field for custom items, the image does not display in the cart or at checkout.

### CartFullPromotionsBanners

- `id` (string, optional) — ID of the promotion.
- `type` (string, optional) — Type of the banner.
- `page` (list of string, optional) — An array of the locations where the banner will display.
- `text` (string, optional) — Text of the banner.

### CartPostVariantGiftWrappingWrapDetailsItems

- `id` (double, optional) — Identifier of the gift wrapping option selected.
- `message` (string, optional) — Custom gift message.

### ItemPhysicalGetDiscountsItems

Example as part of a cart response: ``` "discounts": [ { "id": 2, "discounted_amount": 2 }, { "id": "coupon", "discounted_amount": 0.42 } ] ```

- `id` (ItemPhysicalGetDiscountsItemsId, optional)
- `discounted_amount` (double, optional) — The discounted amount.

### ItemPhysicalGetCoupons

### ItemPhysicalGetGiftWrapping

The gift wrapping details for this item.

- `name` (string, optional)
- `message` (string, optional)
- `amount` (float, optional)

### ItemPhysicalGetStockPosition

Backorder and stock availability details for this line item. Only returned when explicitly requested via `include=line_items.physical_items.stock_position` (or the `digital_items` equivalent) — not included by default.

- `quantity_on_hand` (integer, optional) — Number of units currently in stock and available to fulfill this line item without backordering.
- `quantity_backordered` (integer, optional) — Number of units from this line item that are fulfilled via backorder.
- `quantity_out_of_stock` (integer, optional) — Number of units from this line item that are out of stock and unavailable for backorder.
- `backorder_message` (string, optional, nullable) — Backorder messaging shown to the customer for this line item. `null` if no backorder message applies.

### ItemDigitalGetDiscountsItems

Example as part of a cart response: ``` "discounts": [ { "id": 2, "discounted_amount": 2 }, { "id": "coupon", "discounted_amount": 0.42 } ] ```

- `id` (ItemDigitalGetDiscountsItemsId, optional)
- `discounted_amount` (double, optional) — The discounted amount.

### ItemDigitalGetCoupons

### ItemGiftCertificateGetSender

- `name` (string, optional)
- `email` (string, optional)

### ItemGiftCertificateGetRecipient

- `name` (string, optional)
- `email` (string, optional)

### ItemPhysicalGetDiscountsItemsId

### ItemDigitalGetDiscountsItemsId

## Examples

### Creating a cart by adding a simple product without option selections.

**Request**

```json
{
  "customer_id": 0,
  "line_items": [
    {
      "list_price": 5,
      "name": "calendar",
      "product_id": 126,
      "quantity": 2
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "USD"
  },
  "locale": "en-US"
}
```

**Response**

```json
{
  "data": {
    "id": "string",
    "customer_id": 1,
    "channel_id": 1,
    "email": "string",
    "currency": {
      "code": "usd"
    },
    "tax_included": true,
    "base_amount": 1.1,
    "discount_amount": 1.1,
    "manual_discount_amount": 1.1,
    "cart_amount": 1.1,
    "coupons": [
      {
        "code": "string",
        "id": "string",
        "coupon_type": "0",
        "discounted_amount": 1.1,
        "display_name": "20% Off"
      }
    ],
    "discounts": [
      {
        "id": "coupon",
        "discounted_amount": 1.1
      }
    ],
    "line_items": {
      "physical_items": [
        {
          "variant_id": 358,
          "product_id": 12,
          "quantity": 5,
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "gift_wrapping": {
            "name": "Gift Wrap 1",
            "message": "Happy Birthday!",
            "amount": 1.99
          },
          "stock_position": {
            "quantity_on_hand": 1,
            "quantity_backordered": 1,
            "quantity_out_of_stock": 1,
            "backorder_message": "string"
          }
        }
      ],
      "digital_items": [
        {
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "variant_id": 358,
          "product_id": 12,
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "quantity": 5,
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "download_file_urls": [
            "string"
          ],
          "download_page_url": "string",
          "download_size": "string"
        }
      ],
      "gift_certificates": [
        {
          "id": "string",
          "name": "string",
          "theme": "string",
          "amount": 1.1,
          "taxable": true,
          "sender": {
            "name": "string",
            "email": "string"
          },
          "recipient": {
            "name": "string",
            "email": "string"
          },
          "message": "string"
        }
      ],
      "custom_items": [
        {
          "id": "string",
          "sku": "string",
          "name": "string",
          "quantity": "string",
          "list_price": "string",
          "extended_list_price": 1.1,
          "image_url": "https://pathtoproductimage/ProductDefault.png"
        }
      ]
    },
    "created_time": "string",
    "updated_time": "string",
    "locale": "string",
    "promotions": {
      "banners": {
        "id": "string",
        "type": "string",
        "page": [
          "string"
        ],
        "text": "string"
      }
    },
    "version": 1
  },
  "meta": {}
}
```

**SDK Code**

```python Creating a cart by adding a simple product without option selections.
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/carts"

payload = {
    "customer_id": 0,
    "line_items": [
        {
            "list_price": 5,
            "name": "calendar",
            "product_id": 126,
            "quantity": 2
        }
    ],
    "channel_id": 1,
    "currency": { "code": "USD" },
    "locale": "en-US"
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Creating a cart by adding a simple product without option selections.
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/carts';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"customer_id":0,"line_items":[{"list_price":5,"name":"calendar","product_id":126,"quantity":2}],"channel_id":1,"currency":{"code":"USD"},"locale":"en-US"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Creating a cart by adding a simple product without option selections.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/carts"

	payload := strings.NewReader("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 5,\n      \"name\": \"calendar\",\n      \"product_id\": 126,\n      \"quantity\": 2\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Creating a cart by adding a simple product without option selections.
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/carts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 5,\n      \"name\": \"calendar\",\n      \"product_id\": 126,\n      \"quantity\": 2\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}"

response = http.request(request)
puts response.read_body
```

```java Creating a cart by adding a simple product without option selections.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/carts")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 5,\n      \"name\": \"calendar\",\n      \"product_id\": 126,\n      \"quantity\": 2\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}")
  .asString();
```

```php Creating a cart by adding a simple product without option selections.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/carts', [
  'body' => '{
  "customer_id": 0,
  "line_items": [
    {
      "list_price": 5,
      "name": "calendar",
      "product_id": 126,
      "quantity": 2
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "USD"
  },
  "locale": "en-US"
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Creating a cart by adding a simple product without option selections.
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/carts");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 5,\n      \"name\": \"calendar\",\n      \"product_id\": 126,\n      \"quantity\": 2\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Creating a cart by adding a simple product without option selections.
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": 0,
  "line_items": [
    [
      "list_price": 5,
      "name": "calendar",
      "product_id": 126,
      "quantity": 2
    ]
  ],
  "channel_id": 1,
  "currency": ["code": "USD"],
  "locale": "en-US"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/carts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Creating a cart with a product that can be specified purely by variant, without any other required options.

**Request**

```json
{
  "customer_id": 0,
  "line_items": [
    {
      "list_price": 25,
      "name": "قميص",
      "option_selections": [
        {
          "name": "بحجم",
          "option_id": 125,
          "option_value": 127,
          "value": "صغير"
        }
      ],
      "product_id": 118,
      "quantity": 2,
      "variant_id": 140
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "JOD"
  },
  "locale": "ar-JO"
}
```

**Response**

```json
{
  "data": {
    "id": "string",
    "customer_id": 1,
    "channel_id": 1,
    "email": "string",
    "currency": {
      "code": "usd"
    },
    "tax_included": true,
    "base_amount": 1.1,
    "discount_amount": 1.1,
    "manual_discount_amount": 1.1,
    "cart_amount": 1.1,
    "coupons": [
      {
        "code": "string",
        "id": "string",
        "coupon_type": "0",
        "discounted_amount": 1.1,
        "display_name": "20% Off"
      }
    ],
    "discounts": [
      {
        "id": "coupon",
        "discounted_amount": 1.1
      }
    ],
    "line_items": {
      "physical_items": [
        {
          "variant_id": 358,
          "product_id": 12,
          "quantity": 5,
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "gift_wrapping": {
            "name": "Gift Wrap 1",
            "message": "Happy Birthday!",
            "amount": 1.99
          },
          "stock_position": {
            "quantity_on_hand": 1,
            "quantity_backordered": 1,
            "quantity_out_of_stock": 1,
            "backorder_message": "string"
          }
        }
      ],
      "digital_items": [
        {
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "variant_id": 358,
          "product_id": 12,
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "quantity": 5,
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "download_file_urls": [
            "string"
          ],
          "download_page_url": "string",
          "download_size": "string"
        }
      ],
      "gift_certificates": [
        {
          "id": "string",
          "name": "string",
          "theme": "string",
          "amount": 1.1,
          "taxable": true,
          "sender": {
            "name": "string",
            "email": "string"
          },
          "recipient": {
            "name": "string",
            "email": "string"
          },
          "message": "string"
        }
      ],
      "custom_items": [
        {
          "id": "string",
          "sku": "string",
          "name": "string",
          "quantity": "string",
          "list_price": "string",
          "extended_list_price": 1.1,
          "image_url": "https://pathtoproductimage/ProductDefault.png"
        }
      ]
    },
    "created_time": "string",
    "updated_time": "string",
    "locale": "string",
    "promotions": {
      "banners": {
        "id": "string",
        "type": "string",
        "page": [
          "string"
        ],
        "text": "string"
      }
    },
    "version": 1
  },
  "meta": {}
}
```

**SDK Code**

```python Creating a cart with a product that can be specified purely by variant, without any other required options.
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/carts"

payload = {
    "customer_id": 0,
    "line_items": [
        {
            "list_price": 25,
            "name": "قميص",
            "option_selections": [
                {
                    "name": "بحجم",
                    "option_id": 125,
                    "option_value": 127,
                    "value": "صغير"
                }
            ],
            "product_id": 118,
            "quantity": 2,
            "variant_id": 140
        }
    ],
    "channel_id": 1,
    "currency": { "code": "JOD" },
    "locale": "ar-JO"
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Creating a cart with a product that can be specified purely by variant, without any other required options.
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/carts';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"customer_id":0,"line_items":[{"list_price":25,"name":"قميص","option_selections":[{"name":"بحجم","option_id":125,"option_value":127,"value":"صغير"}],"product_id":118,"quantity":2,"variant_id":140}],"channel_id":1,"currency":{"code":"JOD"},"locale":"ar-JO"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Creating a cart with a product that can be specified purely by variant, without any other required options.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/carts"

	payload := strings.NewReader("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 25,\n      \"name\": \"قميص\",\n      \"option_selections\": [\n        {\n          \"name\": \"بحجم\",\n          \"option_id\": 125,\n          \"option_value\": 127,\n          \"value\": \"صغير\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 2,\n      \"variant_id\": 140\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"JOD\"\n  },\n  \"locale\": \"ar-JO\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Creating a cart with a product that can be specified purely by variant, without any other required options.
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/carts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 25,\n      \"name\": \"قميص\",\n      \"option_selections\": [\n        {\n          \"name\": \"بحجم\",\n          \"option_id\": 125,\n          \"option_value\": 127,\n          \"value\": \"صغير\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 2,\n      \"variant_id\": 140\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"JOD\"\n  },\n  \"locale\": \"ar-JO\"\n}"

response = http.request(request)
puts response.read_body
```

```java Creating a cart with a product that can be specified purely by variant, without any other required options.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/carts")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 25,\n      \"name\": \"قميص\",\n      \"option_selections\": [\n        {\n          \"name\": \"بحجم\",\n          \"option_id\": 125,\n          \"option_value\": 127,\n          \"value\": \"صغير\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 2,\n      \"variant_id\": 140\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"JOD\"\n  },\n  \"locale\": \"ar-JO\"\n}")
  .asString();
```

```php Creating a cart with a product that can be specified purely by variant, without any other required options.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/carts', [
  'body' => '{
  "customer_id": 0,
  "line_items": [
    {
      "list_price": 25,
      "name": "قميص",
      "option_selections": [
        {
          "name": "بحجم",
          "option_id": 125,
          "option_value": 127,
          "value": "صغير"
        }
      ],
      "product_id": 118,
      "quantity": 2,
      "variant_id": 140
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "JOD"
  },
  "locale": "ar-JO"
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Creating a cart with a product that can be specified purely by variant, without any other required options.
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/carts");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 25,\n      \"name\": \"قميص\",\n      \"option_selections\": [\n        {\n          \"name\": \"بحجم\",\n          \"option_id\": 125,\n          \"option_value\": 127,\n          \"value\": \"صغير\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 2,\n      \"variant_id\": 140\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"JOD\"\n  },\n  \"locale\": \"ar-JO\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Creating a cart with a product that can be specified purely by variant, without any other required options.
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": 0,
  "line_items": [
    [
      "list_price": 25,
      "name": "قميص",
      "option_selections": [
        [
          "name": "بحجم",
          "option_id": 125,
          "option_value": 127,
          "value": "صغير"
        ]
      ],
      "product_id": 118,
      "quantity": 2,
      "variant_id": 140
    ]
  ],
  "channel_id": 1,
  "currency": ["code": "JOD"],
  "locale": "ar-JO"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/carts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Creating a cart using a date option.

**Request**

```json
{
  "line_items": [
    {
      "option_selections": [
        {
          "name": "calendario",
          "option_id": 147,
          "option_value": 147,
          "value": "“2023”"
        }
      ],
      "product_id": 128,
      "quantity": 1,
      "variant_id": 144
    }
  ],
  "currency": {
    "code": "MXN"
  },
  "locale": "es-MX"
}
```

**Response**

```json
{
  "data": {
    "id": "string",
    "customer_id": 1,
    "channel_id": 1,
    "email": "string",
    "currency": {
      "code": "usd"
    },
    "tax_included": true,
    "base_amount": 1.1,
    "discount_amount": 1.1,
    "manual_discount_amount": 1.1,
    "cart_amount": 1.1,
    "coupons": [
      {
        "code": "string",
        "id": "string",
        "coupon_type": "0",
        "discounted_amount": 1.1,
        "display_name": "20% Off"
      }
    ],
    "discounts": [
      {
        "id": "coupon",
        "discounted_amount": 1.1
      }
    ],
    "line_items": {
      "physical_items": [
        {
          "variant_id": 358,
          "product_id": 12,
          "quantity": 5,
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "gift_wrapping": {
            "name": "Gift Wrap 1",
            "message": "Happy Birthday!",
            "amount": 1.99
          },
          "stock_position": {
            "quantity_on_hand": 1,
            "quantity_backordered": 1,
            "quantity_out_of_stock": 1,
            "backorder_message": "string"
          }
        }
      ],
      "digital_items": [
        {
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "variant_id": 358,
          "product_id": 12,
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "quantity": 5,
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "download_file_urls": [
            "string"
          ],
          "download_page_url": "string",
          "download_size": "string"
        }
      ],
      "gift_certificates": [
        {
          "id": "string",
          "name": "string",
          "theme": "string",
          "amount": 1.1,
          "taxable": true,
          "sender": {
            "name": "string",
            "email": "string"
          },
          "recipient": {
            "name": "string",
            "email": "string"
          },
          "message": "string"
        }
      ],
      "custom_items": [
        {
          "id": "string",
          "sku": "string",
          "name": "string",
          "quantity": "string",
          "list_price": "string",
          "extended_list_price": 1.1,
          "image_url": "https://pathtoproductimage/ProductDefault.png"
        }
      ]
    },
    "created_time": "string",
    "updated_time": "string",
    "locale": "string",
    "promotions": {
      "banners": {
        "id": "string",
        "type": "string",
        "page": [
          "string"
        ],
        "text": "string"
      }
    },
    "version": 1
  },
  "meta": {}
}
```

**SDK Code**

```python Creating a cart using a date option.
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/carts"

payload = {
    "line_items": [
        {
            "option_selections": [
                {
                    "name": "calendario",
                    "option_id": 147,
                    "option_value": 147,
                    "value": "“2023”"
                }
            ],
            "product_id": 128,
            "quantity": 1,
            "variant_id": 144
        }
    ],
    "currency": { "code": "MXN" },
    "locale": "es-MX"
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Creating a cart using a date option.
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/carts';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"line_items":[{"option_selections":[{"name":"calendario","option_id":147,"option_value":147,"value":"“2023”"}],"product_id":128,"quantity":1,"variant_id":144}],"currency":{"code":"MXN"},"locale":"es-MX"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Creating a cart using a date option.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/carts"

	payload := strings.NewReader("{\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"name\": \"calendario\",\n          \"option_id\": 147,\n          \"option_value\": 147,\n          \"value\": \"“2023”\"\n        }\n      ],\n      \"product_id\": 128,\n      \"quantity\": 1,\n      \"variant_id\": 144\n    }\n  ],\n  \"currency\": {\n    \"code\": \"MXN\"\n  },\n  \"locale\": \"es-MX\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Creating a cart using a date option.
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/carts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"name\": \"calendario\",\n          \"option_id\": 147,\n          \"option_value\": 147,\n          \"value\": \"“2023”\"\n        }\n      ],\n      \"product_id\": 128,\n      \"quantity\": 1,\n      \"variant_id\": 144\n    }\n  ],\n  \"currency\": {\n    \"code\": \"MXN\"\n  },\n  \"locale\": \"es-MX\"\n}"

response = http.request(request)
puts response.read_body
```

```java Creating a cart using a date option.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/carts")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"name\": \"calendario\",\n          \"option_id\": 147,\n          \"option_value\": 147,\n          \"value\": \"“2023”\"\n        }\n      ],\n      \"product_id\": 128,\n      \"quantity\": 1,\n      \"variant_id\": 144\n    }\n  ],\n  \"currency\": {\n    \"code\": \"MXN\"\n  },\n  \"locale\": \"es-MX\"\n}")
  .asString();
```

```php Creating a cart using a date option.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/carts', [
  'body' => '{
  "line_items": [
    {
      "option_selections": [
        {
          "name": "calendario",
          "option_id": 147,
          "option_value": 147,
          "value": "“2023”"
        }
      ],
      "product_id": 128,
      "quantity": 1,
      "variant_id": 144
    }
  ],
  "currency": {
    "code": "MXN"
  },
  "locale": "es-MX"
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Creating a cart using a date option.
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/carts");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"name\": \"calendario\",\n          \"option_id\": 147,\n          \"option_value\": 147,\n          \"value\": \"“2023”\"\n        }\n      ],\n      \"product_id\": 128,\n      \"quantity\": 1,\n      \"variant_id\": 144\n    }\n  ],\n  \"currency\": {\n    \"code\": \"MXN\"\n  },\n  \"locale\": \"es-MX\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Creating a cart using a date option.
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "line_items": [
    [
      "option_selections": [
        [
          "name": "calendario",
          "option_id": 147,
          "option_value": 147,
          "value": "“2023”"
        ]
      ],
      "product_id": 128,
      "quantity": 1,
      "variant_id": 144
    ]
  ],
  "currency": ["code": "MXN"],
  "locale": "es-MX"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/carts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Creating a cart with a variant, a checkbox, and an added picklist modifier.

**Request**

```json
{
  "customer_id": 0,
  "line_items": [
    {
      "list_price": 30,
      "name": "shirt",
      "option_selections": [
        {
          "name": "Color",
          "option_id": 133,
          "option_value": 149,
          "value": "Red"
        },
        {
          "name": "Add a $5 Donation",
          "option_id": 126,
          "option_value": 129,
          "value": "No"
        }
      ],
      "product_id": 118,
      "quantity": 1,
      "variant_id": 141
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "AUD"
  },
  "locale": "en-AU"
}
```

**Response**

```json
{
  "data": {
    "id": "string",
    "customer_id": 1,
    "channel_id": 1,
    "email": "string",
    "currency": {
      "code": "usd"
    },
    "tax_included": true,
    "base_amount": 1.1,
    "discount_amount": 1.1,
    "manual_discount_amount": 1.1,
    "cart_amount": 1.1,
    "coupons": [
      {
        "code": "string",
        "id": "string",
        "coupon_type": "0",
        "discounted_amount": 1.1,
        "display_name": "20% Off"
      }
    ],
    "discounts": [
      {
        "id": "coupon",
        "discounted_amount": 1.1
      }
    ],
    "line_items": {
      "physical_items": [
        {
          "variant_id": 358,
          "product_id": 12,
          "quantity": 5,
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "gift_wrapping": {
            "name": "Gift Wrap 1",
            "message": "Happy Birthday!",
            "amount": 1.99
          },
          "stock_position": {
            "quantity_on_hand": 1,
            "quantity_backordered": 1,
            "quantity_out_of_stock": 1,
            "backorder_message": "string"
          }
        }
      ],
      "digital_items": [
        {
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "variant_id": 358,
          "product_id": 12,
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "quantity": 5,
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "download_file_urls": [
            "string"
          ],
          "download_page_url": "string",
          "download_size": "string"
        }
      ],
      "gift_certificates": [
        {
          "id": "string",
          "name": "string",
          "theme": "string",
          "amount": 1.1,
          "taxable": true,
          "sender": {
            "name": "string",
            "email": "string"
          },
          "recipient": {
            "name": "string",
            "email": "string"
          },
          "message": "string"
        }
      ],
      "custom_items": [
        {
          "id": "string",
          "sku": "string",
          "name": "string",
          "quantity": "string",
          "list_price": "string",
          "extended_list_price": 1.1,
          "image_url": "https://pathtoproductimage/ProductDefault.png"
        }
      ]
    },
    "created_time": "string",
    "updated_time": "string",
    "locale": "string",
    "promotions": {
      "banners": {
        "id": "string",
        "type": "string",
        "page": [
          "string"
        ],
        "text": "string"
      }
    },
    "version": 1
  },
  "meta": {}
}
```

**SDK Code**

```python Creating a cart with a variant, a checkbox, and an added picklist modifier.
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/carts"

payload = {
    "customer_id": 0,
    "line_items": [
        {
            "list_price": 30,
            "name": "shirt",
            "option_selections": [
                {
                    "name": "Color",
                    "option_id": 133,
                    "option_value": 149,
                    "value": "Red"
                },
                {
                    "name": "Add a $5 Donation",
                    "option_id": 126,
                    "option_value": 129,
                    "value": "No"
                }
            ],
            "product_id": 118,
            "quantity": 1,
            "variant_id": 141
        }
    ],
    "channel_id": 1,
    "currency": { "code": "AUD" },
    "locale": "en-AU"
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Creating a cart with a variant, a checkbox, and an added picklist modifier.
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/carts';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"customer_id":0,"line_items":[{"list_price":30,"name":"shirt","option_selections":[{"name":"Color","option_id":133,"option_value":149,"value":"Red"},{"name":"Add a $5 Donation","option_id":126,"option_value":129,"value":"No"}],"product_id":118,"quantity":1,"variant_id":141}],"channel_id":1,"currency":{"code":"AUD"},"locale":"en-AU"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Creating a cart with a variant, a checkbox, and an added picklist modifier.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/carts"

	payload := strings.NewReader("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 30,\n      \"name\": \"shirt\",\n      \"option_selections\": [\n        {\n          \"name\": \"Color\",\n          \"option_id\": 133,\n          \"option_value\": 149,\n          \"value\": \"Red\"\n        },\n        {\n          \"name\": \"Add a $5 Donation\",\n          \"option_id\": 126,\n          \"option_value\": 129,\n          \"value\": \"No\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 1,\n      \"variant_id\": 141\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"AUD\"\n  },\n  \"locale\": \"en-AU\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Creating a cart with a variant, a checkbox, and an added picklist modifier.
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/carts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 30,\n      \"name\": \"shirt\",\n      \"option_selections\": [\n        {\n          \"name\": \"Color\",\n          \"option_id\": 133,\n          \"option_value\": 149,\n          \"value\": \"Red\"\n        },\n        {\n          \"name\": \"Add a $5 Donation\",\n          \"option_id\": 126,\n          \"option_value\": 129,\n          \"value\": \"No\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 1,\n      \"variant_id\": 141\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"AUD\"\n  },\n  \"locale\": \"en-AU\"\n}"

response = http.request(request)
puts response.read_body
```

```java Creating a cart with a variant, a checkbox, and an added picklist modifier.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/carts")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 30,\n      \"name\": \"shirt\",\n      \"option_selections\": [\n        {\n          \"name\": \"Color\",\n          \"option_id\": 133,\n          \"option_value\": 149,\n          \"value\": \"Red\"\n        },\n        {\n          \"name\": \"Add a $5 Donation\",\n          \"option_id\": 126,\n          \"option_value\": 129,\n          \"value\": \"No\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 1,\n      \"variant_id\": 141\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"AUD\"\n  },\n  \"locale\": \"en-AU\"\n}")
  .asString();
```

```php Creating a cart with a variant, a checkbox, and an added picklist modifier.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/carts', [
  'body' => '{
  "customer_id": 0,
  "line_items": [
    {
      "list_price": 30,
      "name": "shirt",
      "option_selections": [
        {
          "name": "Color",
          "option_id": 133,
          "option_value": 149,
          "value": "Red"
        },
        {
          "name": "Add a $5 Donation",
          "option_id": 126,
          "option_value": 129,
          "value": "No"
        }
      ],
      "product_id": 118,
      "quantity": 1,
      "variant_id": 141
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "AUD"
  },
  "locale": "en-AU"
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Creating a cart with a variant, a checkbox, and an added picklist modifier.
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/carts");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"list_price\": 30,\n      \"name\": \"shirt\",\n      \"option_selections\": [\n        {\n          \"name\": \"Color\",\n          \"option_id\": 133,\n          \"option_value\": 149,\n          \"value\": \"Red\"\n        },\n        {\n          \"name\": \"Add a $5 Donation\",\n          \"option_id\": 126,\n          \"option_value\": 129,\n          \"value\": \"No\"\n        }\n      ],\n      \"product_id\": 118,\n      \"quantity\": 1,\n      \"variant_id\": 141\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"AUD\"\n  },\n  \"locale\": \"en-AU\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Creating a cart with a variant, a checkbox, and an added picklist modifier.
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": 0,
  "line_items": [
    [
      "list_price": 30,
      "name": "shirt",
      "option_selections": [
        [
          "name": "Color",
          "option_id": 133,
          "option_value": 149,
          "value": "Red"
        ],
        [
          "name": "Add a $5 Donation",
          "option_id": 126,
          "option_value": 129,
          "value": "No"
        ]
      ],
      "product_id": 118,
      "quantity": 1,
      "variant_id": 141
    ]
  ],
  "channel_id": 1,
  "currency": ["code": "AUD"],
  "locale": "en-AU"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/carts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Creating a cart using a custom item.

**Request**

```json
{
  "customer_id": 0,
  "line_items": [],
  "custom_items": [
    {
      "sku": "custom-item-sku",
      "name": "table",
      "quantity": 1,
      "list_price": 30,
      "gift_wrapping": {
        "wrap_details": [
          {
            "id": 0,
            "message": "Happy Birthday"
          }
        ],
        "wrap_together": true
      }
    }
  ],
  "gift_certificates": [
    {
      "name": "Tobi Day",
      "theme": "Birthday",
      "amount": 10,
      "quantity": 1,
      "sender": {
        "name": "Brandi Tyler",
        "email": "Brandi.Tyler@mail.com"
      },
      "recipient": {
        "name": "Tobi Day",
        "email": "Tobi.Day@mail.com"
      },
      "message": "Happy Birthday"
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "USD"
  },
  "locale": "en-US"
}
```

**Response**

```json
{
  "data": {
    "id": "string",
    "customer_id": 1,
    "channel_id": 1,
    "email": "string",
    "currency": {
      "code": "usd"
    },
    "tax_included": true,
    "base_amount": 1.1,
    "discount_amount": 1.1,
    "manual_discount_amount": 1.1,
    "cart_amount": 1.1,
    "coupons": [
      {
        "code": "string",
        "id": "string",
        "coupon_type": "0",
        "discounted_amount": 1.1,
        "display_name": "20% Off"
      }
    ],
    "discounts": [
      {
        "id": "coupon",
        "discounted_amount": 1.1
      }
    ],
    "line_items": {
      "physical_items": [
        {
          "variant_id": 358,
          "product_id": 12,
          "quantity": 5,
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "gift_wrapping": {
            "name": "Gift Wrap 1",
            "message": "Happy Birthday!",
            "amount": 1.99
          },
          "stock_position": {
            "quantity_on_hand": 1,
            "quantity_backordered": 1,
            "quantity_out_of_stock": 1,
            "backorder_message": "string"
          }
        }
      ],
      "digital_items": [
        {
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "variant_id": 358,
          "product_id": 12,
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "quantity": 5,
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "download_file_urls": [
            "string"
          ],
          "download_page_url": "string",
          "download_size": "string"
        }
      ],
      "gift_certificates": [
        {
          "id": "string",
          "name": "string",
          "theme": "string",
          "amount": 1.1,
          "taxable": true,
          "sender": {
            "name": "string",
            "email": "string"
          },
          "recipient": {
            "name": "string",
            "email": "string"
          },
          "message": "string"
        }
      ],
      "custom_items": [
        {
          "id": "string",
          "sku": "string",
          "name": "string",
          "quantity": "string",
          "list_price": "string",
          "extended_list_price": 1.1,
          "image_url": "https://pathtoproductimage/ProductDefault.png"
        }
      ]
    },
    "created_time": "string",
    "updated_time": "string",
    "locale": "string",
    "promotions": {
      "banners": {
        "id": "string",
        "type": "string",
        "page": [
          "string"
        ],
        "text": "string"
      }
    },
    "version": 1
  },
  "meta": {}
}
```

**SDK Code**

```python Creating a cart using a custom item.
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/carts"

payload = {
    "customer_id": 0,
    "line_items": [],
    "custom_items": [
        {
            "sku": "custom-item-sku",
            "name": "table",
            "quantity": 1,
            "list_price": 30,
            "gift_wrapping": {
                "wrap_details": [
                    {
                        "id": 0,
                        "message": "Happy Birthday"
                    }
                ],
                "wrap_together": True
            }
        }
    ],
    "gift_certificates": [
        {
            "name": "Tobi Day",
            "theme": "Birthday",
            "amount": 10,
            "quantity": 1,
            "sender": {
                "name": "Brandi Tyler",
                "email": "Brandi.Tyler@mail.com"
            },
            "recipient": {
                "name": "Tobi Day",
                "email": "Tobi.Day@mail.com"
            },
            "message": "Happy Birthday"
        }
    ],
    "channel_id": 1,
    "currency": { "code": "USD" },
    "locale": "en-US"
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Creating a cart using a custom item.
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/carts';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"customer_id":0,"line_items":[],"custom_items":[{"sku":"custom-item-sku","name":"table","quantity":1,"list_price":30,"gift_wrapping":{"wrap_details":[{"id":0,"message":"Happy Birthday"}],"wrap_together":true}}],"gift_certificates":[{"name":"Tobi Day","theme":"Birthday","amount":10,"quantity":1,"sender":{"name":"Brandi Tyler","email":"Brandi.Tyler@mail.com"},"recipient":{"name":"Tobi Day","email":"Tobi.Day@mail.com"},"message":"Happy Birthday"}],"channel_id":1,"currency":{"code":"USD"},"locale":"en-US"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Creating a cart using a custom item.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/carts"

	payload := strings.NewReader("{\n  \"customer_id\": 0,\n  \"line_items\": [],\n  \"custom_items\": [\n    {\n      \"sku\": \"custom-item-sku\",\n      \"name\": \"table\",\n      \"quantity\": 1,\n      \"list_price\": 30,\n      \"gift_wrapping\": {\n        \"wrap_details\": [\n          {\n            \"id\": 0,\n            \"message\": \"Happy Birthday\"\n          }\n        ],\n        \"wrap_together\": true\n      }\n    }\n  ],\n  \"gift_certificates\": [\n    {\n      \"name\": \"Tobi Day\",\n      \"theme\": \"Birthday\",\n      \"amount\": 10,\n      \"quantity\": 1,\n      \"sender\": {\n        \"name\": \"Brandi Tyler\",\n        \"email\": \"Brandi.Tyler@mail.com\"\n      },\n      \"recipient\": {\n        \"name\": \"Tobi Day\",\n        \"email\": \"Tobi.Day@mail.com\"\n      },\n      \"message\": \"Happy Birthday\"\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Creating a cart using a custom item.
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/carts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": 0,\n  \"line_items\": [],\n  \"custom_items\": [\n    {\n      \"sku\": \"custom-item-sku\",\n      \"name\": \"table\",\n      \"quantity\": 1,\n      \"list_price\": 30,\n      \"gift_wrapping\": {\n        \"wrap_details\": [\n          {\n            \"id\": 0,\n            \"message\": \"Happy Birthday\"\n          }\n        ],\n        \"wrap_together\": true\n      }\n    }\n  ],\n  \"gift_certificates\": [\n    {\n      \"name\": \"Tobi Day\",\n      \"theme\": \"Birthday\",\n      \"amount\": 10,\n      \"quantity\": 1,\n      \"sender\": {\n        \"name\": \"Brandi Tyler\",\n        \"email\": \"Brandi.Tyler@mail.com\"\n      },\n      \"recipient\": {\n        \"name\": \"Tobi Day\",\n        \"email\": \"Tobi.Day@mail.com\"\n      },\n      \"message\": \"Happy Birthday\"\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}"

response = http.request(request)
puts response.read_body
```

```java Creating a cart using a custom item.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/carts")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": 0,\n  \"line_items\": [],\n  \"custom_items\": [\n    {\n      \"sku\": \"custom-item-sku\",\n      \"name\": \"table\",\n      \"quantity\": 1,\n      \"list_price\": 30,\n      \"gift_wrapping\": {\n        \"wrap_details\": [\n          {\n            \"id\": 0,\n            \"message\": \"Happy Birthday\"\n          }\n        ],\n        \"wrap_together\": true\n      }\n    }\n  ],\n  \"gift_certificates\": [\n    {\n      \"name\": \"Tobi Day\",\n      \"theme\": \"Birthday\",\n      \"amount\": 10,\n      \"quantity\": 1,\n      \"sender\": {\n        \"name\": \"Brandi Tyler\",\n        \"email\": \"Brandi.Tyler@mail.com\"\n      },\n      \"recipient\": {\n        \"name\": \"Tobi Day\",\n        \"email\": \"Tobi.Day@mail.com\"\n      },\n      \"message\": \"Happy Birthday\"\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}")
  .asString();
```

```php Creating a cart using a custom item.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/carts', [
  'body' => '{
  "customer_id": 0,
  "line_items": [],
  "custom_items": [
    {
      "sku": "custom-item-sku",
      "name": "table",
      "quantity": 1,
      "list_price": 30,
      "gift_wrapping": {
        "wrap_details": [
          {
            "id": 0,
            "message": "Happy Birthday"
          }
        ],
        "wrap_together": true
      }
    }
  ],
  "gift_certificates": [
    {
      "name": "Tobi Day",
      "theme": "Birthday",
      "amount": 10,
      "quantity": 1,
      "sender": {
        "name": "Brandi Tyler",
        "email": "Brandi.Tyler@mail.com"
      },
      "recipient": {
        "name": "Tobi Day",
        "email": "Tobi.Day@mail.com"
      },
      "message": "Happy Birthday"
    }
  ],
  "channel_id": 1,
  "currency": {
    "code": "USD"
  },
  "locale": "en-US"
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Creating a cart using a custom item.
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/carts");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": 0,\n  \"line_items\": [],\n  \"custom_items\": [\n    {\n      \"sku\": \"custom-item-sku\",\n      \"name\": \"table\",\n      \"quantity\": 1,\n      \"list_price\": 30,\n      \"gift_wrapping\": {\n        \"wrap_details\": [\n          {\n            \"id\": 0,\n            \"message\": \"Happy Birthday\"\n          }\n        ],\n        \"wrap_together\": true\n      }\n    }\n  ],\n  \"gift_certificates\": [\n    {\n      \"name\": \"Tobi Day\",\n      \"theme\": \"Birthday\",\n      \"amount\": 10,\n      \"quantity\": 1,\n      \"sender\": {\n        \"name\": \"Brandi Tyler\",\n        \"email\": \"Brandi.Tyler@mail.com\"\n      },\n      \"recipient\": {\n        \"name\": \"Tobi Day\",\n        \"email\": \"Tobi.Day@mail.com\"\n      },\n      \"message\": \"Happy Birthday\"\n    }\n  ],\n  \"channel_id\": 1,\n  \"currency\": {\n    \"code\": \"USD\"\n  },\n  \"locale\": \"en-US\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Creating a cart using a custom item.
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": 0,
  "line_items": [],
  "custom_items": [
    [
      "sku": "custom-item-sku",
      "name": "table",
      "quantity": 1,
      "list_price": 30,
      "gift_wrapping": [
        "wrap_details": [
          [
            "id": 0,
            "message": "Happy Birthday"
          ]
        ],
        "wrap_together": true
      ]
    ]
  ],
  "gift_certificates": [
    [
      "name": "Tobi Day",
      "theme": "Birthday",
      "amount": 10,
      "quantity": 1,
      "sender": [
        "name": "Brandi Tyler",
        "email": "Brandi.Tyler@mail.com"
      ],
      "recipient": [
        "name": "Tobi Day",
        "email": "Tobi.Day@mail.com"
      ],
      "message": "Happy Birthday"
    ]
  ],
  "channel_id": 1,
  "currency": ["code": "USD"],
  "locale": "en-US"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/carts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Creating a cart using the file upload option.

**Request**

```json
{
  "customer_id": 0,
  "line_items": [
    {
      "option_selections": [
        {
          "option_id": 116,
          "option_value": 116
        }
      ],
      "product_id": 104,
      "quantity": 1
    }
  ]
}
```

**Response**

```json
{
  "data": {
    "id": "string",
    "customer_id": 1,
    "channel_id": 1,
    "email": "string",
    "currency": {
      "code": "usd"
    },
    "tax_included": true,
    "base_amount": 1.1,
    "discount_amount": 1.1,
    "manual_discount_amount": 1.1,
    "cart_amount": 1.1,
    "coupons": [
      {
        "code": "string",
        "id": "string",
        "coupon_type": "0",
        "discounted_amount": 1.1,
        "display_name": "20% Off"
      }
    ],
    "discounts": [
      {
        "id": "coupon",
        "discounted_amount": 1.1
      }
    ],
    "line_items": {
      "physical_items": [
        {
          "variant_id": 358,
          "product_id": 12,
          "quantity": 5,
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "gift_wrapping": {
            "name": "Gift Wrap 1",
            "message": "Happy Birthday!",
            "amount": 1.99
          },
          "stock_position": {
            "quantity_on_hand": 1,
            "quantity_backordered": 1,
            "quantity_out_of_stock": 1,
            "backorder_message": "string"
          }
        }
      ],
      "digital_items": [
        {
          "id": "6e193ce6-f327-4dcc-b75e-72cf6738525e",
          "parent_id": "string",
          "variant_id": 358,
          "product_id": 12,
          "added_by_attribute_id": "string",
          "sku": "SMGREEN",
          "name": "T-Shirt",
          "url": "http://your-store-url.mybigcommerce.com/your-product/",
          "quantity": 5,
          "taxable": false,
          "image_url": "https://pathtoproductimage/ProductDefault.png",
          "discounts": [
            {
              "id": "string",
              "discounted_amount": 1.1
            }
          ],
          "coupons": 1.1,
          "discount_amount": 4,
          "coupon_amount": 1.1,
          "original_price": 1.1,
          "list_price": 1.1,
          "sale_price": 1.1,
          "extended_list_price": 1.1,
          "extended_sale_price": 1.1,
          "is_require_shipping": false,
          "is_mutable": true,
          "added_by_promotion": false,
          "is_custom_price": false,
          "download_file_urls": [
            "string"
          ],
          "download_page_url": "string",
          "download_size": "string"
        }
      ],
      "gift_certificates": [
        {
          "id": "string",
          "name": "string",
          "theme": "string",
          "amount": 1.1,
          "taxable": true,
          "sender": {
            "name": "string",
            "email": "string"
          },
          "recipient": {
            "name": "string",
            "email": "string"
          },
          "message": "string"
        }
      ],
      "custom_items": [
        {
          "id": "string",
          "sku": "string",
          "name": "string",
          "quantity": "string",
          "list_price": "string",
          "extended_list_price": 1.1,
          "image_url": "https://pathtoproductimage/ProductDefault.png"
        }
      ]
    },
    "created_time": "string",
    "updated_time": "string",
    "locale": "string",
    "promotions": {
      "banners": {
        "id": "string",
        "type": "string",
        "page": [
          "string"
        ],
        "text": "string"
      }
    },
    "version": 1
  },
  "meta": {}
}
```

**SDK Code**

```python Creating a cart using the file upload option.
import requests

url = "https://api.bigcommerce.com/stores/store_hash/v3/carts"

payload = {
    "customer_id": 0,
    "line_items": [
        {
            "option_selections": [
                {
                    "option_id": 116,
                    "option_value": 116
                }
            ],
            "product_id": 104,
            "quantity": 1
        }
    ]
}
headers = {
    "Accept": "application/json",
    "X-Auth-Token": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Creating a cart using the file upload option.
const url = 'https://api.bigcommerce.com/stores/store_hash/v3/carts';
const options = {
  method: 'POST',
  headers: {
    Accept: 'application/json',
    'X-Auth-Token': '<apiKey>',
    'Content-Type': 'application/json'
  },
  body: '{"customer_id":0,"line_items":[{"option_selections":[{"option_id":116,"option_value":116}],"product_id":104,"quantity":1}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Creating a cart using the file upload option.
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.bigcommerce.com/stores/store_hash/v3/carts"

	payload := strings.NewReader("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"option_id\": 116,\n          \"option_value\": 116\n        }\n      ],\n      \"product_id\": 104,\n      \"quantity\": 1\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Accept", "application/json")
	req.Header.Add("X-Auth-Token", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Creating a cart using the file upload option.
require 'uri'
require 'net/http'

url = URI("https://api.bigcommerce.com/stores/store_hash/v3/carts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Accept"] = 'application/json'
request["X-Auth-Token"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"option_id\": 116,\n          \"option_value\": 116\n        }\n      ],\n      \"product_id\": 104,\n      \"quantity\": 1\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java Creating a cart using the file upload option.
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.bigcommerce.com/stores/store_hash/v3/carts")
  .header("Accept", "application/json")
  .header("X-Auth-Token", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"option_id\": 116,\n          \"option_value\": 116\n        }\n      ],\n      \"product_id\": 104,\n      \"quantity\": 1\n    }\n  ]\n}")
  .asString();
```

```php Creating a cart using the file upload option.
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.bigcommerce.com/stores/store_hash/v3/carts', [
  'body' => '{
  "customer_id": 0,
  "line_items": [
    {
      "option_selections": [
        {
          "option_id": 116,
          "option_value": 116
        }
      ],
      "product_id": 104,
      "quantity": 1
    }
  ]
}',
  'headers' => [
    'Accept' => 'application/json',
    'Content-Type' => 'application/json',
    'X-Auth-Token' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Creating a cart using the file upload option.
using RestSharp;

var client = new RestClient("https://api.bigcommerce.com/stores/store_hash/v3/carts");
var request = new RestRequest(Method.POST);
request.AddHeader("Accept", "application/json");
request.AddHeader("X-Auth-Token", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"customer_id\": 0,\n  \"line_items\": [\n    {\n      \"option_selections\": [\n        {\n          \"option_id\": 116,\n          \"option_value\": 116\n        }\n      ],\n      \"product_id\": 104,\n      \"quantity\": 1\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Creating a cart using the file upload option.
import Foundation

let headers = [
  "Accept": "application/json",
  "X-Auth-Token": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "customer_id": 0,
  "line_items": [
    [
      "option_selections": [
        [
          "option_id": 116,
          "option_value": 116
        ]
      ],
      "product_id": 104,
      "quantity": 1
    ]
  ]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.bigcommerce.com/stores/store_hash/v3/carts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```