POST /carts/{cartId}/items
Adds line item to the Cart.
Usage Notes
To add a custom item use custom_items.
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.
If a product has modifiers, omit the variant_id and instead use the option_selections array to describe both the variant and the modifier selections.
To prevent lost updates due to concurrent requests overriding changes made by others, it is recommended to enable optimistic concurrency control by including the version field in the request payload. If the provided version does not match the version on the server, a conflict error will be returned, which the client can handle accordingly.
Servers
- https://api.bigcommerce.com/stores/{store_hash}/v3
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
cartId |
String | Yes |
The identifier of a specific cart. |
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 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 | |
line_items |
No | ||
version |
Integer | No |
The cart version that you expect to apply the updates. If the provided version doesn't match the current cart version, you will receive a conflict error. This field is optional; if not provided, optimistic concurrency control will not apply. |
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 |
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.