Commerce
Put v1publicstorefronts cart
PUT
/
v1
/
public
/
storefronts
/
{slug}
/
cart
cURL
curl --request PUT \
--url https://api.wazapin.com/v1/public/storefronts/{slug}/cart \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"items": [
{
"product_slug": "<string>",
"quantity": 123,
"selected_options": {},
"variant_id": "<string>"
}
],
"customer_phone": "<string>"
}
'const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
product_slug: '<string>',
quantity: 123,
selected_options: {},
variant_id: '<string>'
}
],
customer_phone: '<string>'
})
};
fetch('https://api.wazapin.com/v1/public/storefronts/{slug}/cart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wazapin.com/v1/public/storefronts/{slug}/cart"
payload = {
"items": [
{
"product_slug": "<string>",
"quantity": 123,
"selected_options": {},
"variant_id": "<string>"
}
],
"customer_phone": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"cart_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"items": [
{
"item_key": "<string>",
"line_subtotal_amount": 123,
"price_amount": 123,
"product_id": "<string>",
"product_slug": "<string>",
"quantity": 123,
"title": "<string>",
"image_url": "<string>",
"selected_option_labels": [
"<string>"
],
"selected_options": {},
"variant_id": "<string>",
"variant_title": "<string>"
}
],
"subtotal_amount": 123,
"total_quantity": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}Authorizations
Path Parameters
Query Parameters
Optional existing cart id; omit to create
⌘I
cURL
curl --request PUT \
--url https://api.wazapin.com/v1/public/storefronts/{slug}/cart \
--header 'Content-Type: application/json' \
--header 'X-Api-Key: <api-key>' \
--data '
{
"items": [
{
"product_slug": "<string>",
"quantity": 123,
"selected_options": {},
"variant_id": "<string>"
}
],
"customer_phone": "<string>"
}
'const options = {
method: 'PUT',
headers: {'X-Api-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
items: [
{
product_slug: '<string>',
quantity: 123,
selected_options: {},
variant_id: '<string>'
}
],
customer_phone: '<string>'
})
};
fetch('https://api.wazapin.com/v1/public/storefronts/{slug}/cart', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.wazapin.com/v1/public/storefronts/{slug}/cart"
payload = {
"items": [
{
"product_slug": "<string>",
"quantity": 123,
"selected_options": {},
"variant_id": "<string>"
}
],
"customer_phone": "<string>"
}
headers = {
"X-Api-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"cart_id": "<string>",
"expires_at": "2023-11-07T05:31:56Z",
"items": [
{
"item_key": "<string>",
"line_subtotal_amount": 123,
"price_amount": 123,
"product_id": "<string>",
"product_slug": "<string>",
"quantity": 123,
"title": "<string>",
"image_url": "<string>",
"selected_option_labels": [
"<string>"
],
"selected_options": {},
"variant_id": "<string>",
"variant_title": "<string>"
}
],
"subtotal_amount": 123,
"total_quantity": 123
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": [
{
"message": "<string>",
"code": "<string>",
"field": "<string>",
"location": "<string>"
}
],
"request_id": "<string>"
}
}