extensions / Commerce extension
POST
/__runtime/cart/itemsCreate Cart Item
Adds a product and optional variant to the storefront cart and returns the updated cart.
POST
Authentication
- Requirement
- Required
- Credential type
- API key
- Scopes
- Not specified
Permissions
- Requires an API key with an active connection to the target project.
Headers
| Name | Required | Type | Details |
|---|---|---|---|
Authorization | Yes | Not specified | Description: Bearer credential used to authenticate the request. |
Path Parameters
Query Parameters
| Name | Required | Type | Details |
|---|---|---|---|
project_id | No | integer | Description: Target project identifier. |
Request Body
Schema: CartItemAddRequest
| Field | Required | Type | Details |
|---|---|---|---|
product_id | Yes | integer | Description: Target product identifier. |
variant_id | No | integer | Description: Identifier for variant. |
variant_sku | No | string | Description: Text value. |
variant_label | No | string | Description: Human-readable label. |
variant_attributes | No | JSON | Description: JSON object. |
quantity | No | integer | Description: Integer value. |
Response Body
Example 200 response
json
{
"cart_id": 1,
"currency": "USD",
"currency_symbol": "string",
"subtotal": "string",
"tax": "string",
"total": 1,
"count": 1,
"items": [],
"coupon_discount_total": "string",
"coupons": []
}Errors
500 INTERNAL_SERVER_ERRORAvailability
- Available in
- v0.1.0
- Available since
- v0.1.0
- Implementation
- Available
- Deprecation
- Not specified
- Rate limits
- Not specified

