POST /carts
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
idis the same as a checkoutid. - A cart can be created by adding an existing catalog item or a custom item.
- 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_selectionsarray to describe the modifier selection(s). - The format and data type of a cart’s
option_valueare defined by thevalue_dataobject of a product’s variant option value, modifier value, 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_urlsin 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
promotionsin the response, append the following query parameter to the request URL:include=promotions.banners.
Servers
- https://api.bigcommerce.com/stores/{store_hash}/v3
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Accept |
String | Yes |
The MIME type of the response body. Default value: "application/json" |
Content-Type |
String | Yes |
Default value: "application/json" |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
include[] |
Array | No |
|
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
gift_certificates[] |
Array | No | |
gift_certificates[].name |
String | Yes |
Given name for the gift certificate line item. |
gift_certificates[].amount |
Number | Yes | |
gift_certificates[].message |
String | No |
Message shown to recipient, as provided by sender. |
gift_certificates[].quantity |
Integer | Yes | |
gift_certificates[].sender |
Object | Yes | |
gift_certificates[].sender.name |
String | No | |
gift_certificates[].sender.email |
String | No | |
gift_certificates[].theme |
String | Yes |
The theme of the gift certificate. Valid values:
|
gift_certificates[].recipient |
Object | Yes | |
gift_certificates[].recipient.name |
String | No | |
gift_certificates[].recipient.email |
String | No | |
customer_id |
Integer | No | |
line_items[] |
Array | No | |
channel_id |
Integer | No |
The Channel ID. If no channel is specified, defaults to 1. |
locale |
String | No |
The locale of the cart. Accepts strings of format |
custom_items[] |
Array | No | |
custom_items[].sku |
String | No | |
custom_items[].name |
String | No | |
custom_items[].quantity |
Number | No | |
custom_items[].image_url |
String | No |
Image of the product or variant. |
custom_items[].list_price |
Number | No | |
currency |
Object | No | |
currency.code |
String | No |
The transactional currency code for the cart, formatted as an ISO-4217 string. This code is required when multi-currency is enabled. Passing a non-transactional display currency will result in a |
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.