PUT /v1/public/storefronts/{slug}/cart
PUT
/v1/public/storefronts/{slug}/cartPath parameters
slugstringrequiredQuery parameters
cart_idstringOptional existing cart id; omit to create
Request body
requiredapplication/jsoncustomer_phonestringitemsStorefrontCartStoredLine[] | nullrequiredShow propertiesHide properties
Array of
StorefrontCartStoredLineproduct_slugstringrequiredquantityinteger<int32>requiredselected_optionsobjectvariant_idstringResponses
200OK
cart_idstringrequiredexpires_atstring<date-time>requireditemsStorefrontCartLineView[] | nullrequiredShow propertiesHide properties
Array of
StorefrontCartLineViewimage_urlstringitem_keystringrequiredline_subtotal_amountinteger<int64>requiredprice_amountinteger<int64>requiredproduct_idstringrequiredproduct_slugstringrequiredquantityinteger<int32>requiredselected_option_labelsstring[] | nullselected_optionsobjecttitlestringrequiredvariant_idstringvariant_titlestringsubtotal_amountinteger<int64>requiredtotal_quantityinteger<int32>requireddefaultError
errorErrorBodyrequiredShow propertiesHide properties
codestringrequireddetailsErrorDetail[] | nullShow propertiesHide properties
Array of
ErrorDetailcodestringfieldstringlocationstringmessagestringrequiredmessagestringrequiredrequest_idstringRequest
curl -X PUT "/v1/public/storefronts/string/cart" \
-H "Content-Type: application/json" \
-d '{
"customer_phone": "string",
"items": [
{
"product_slug": "string",
"quantity": 0,
"selected_options": {},
"variant_id": "string"
}
]
}'const response = await fetch("/v1/public/storefronts/string/cart", {
method: "PUT",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"customer_phone": "string",
"items": [
{
"product_slug": "string",
"quantity": 0,
"selected_options": {},
"variant_id": "string"
}
]
})
});import requests
response = requests.put(
"/v1/public/storefronts/string/cart",
headers={
"Content-Type": "application/json"
},
json={
"customer_phone": "string",
"items": [
{
"product_slug": "string",
"quantity": 0,
"selected_options": {},
"variant_id": "string"
}
]
},
)Response
{
"cart_id": "string",
"expires_at": "2024-01-01T00:00:00Z",
"items": [
{
"image_url": "string",
"item_key": "string",
"line_subtotal_amount": 0,
"price_amount": 0,
"product_id": "string",
"product_slug": "string",
"quantity": 0,
"selected_option_labels": [
"string"
],
"selected_options": {},
"title": "string",
"variant_id": "string",
"variant_title": "string"
}
],
"subtotal_amount": 0,
"total_quantity": 0
}{
"error": {
"code": "string",
"details": [
{
"code": "string",
"field": "string",
"location": "string",
"message": "string"
}
],
"message": "string",
"request_id": "string"
}
}