Cart Operations
Update Item Quantity
Updates the quantity of an item in the cart
PUT
/
api
/
v1
/
domains
/
{domain}
/
cart
/
line-items
/
{sku}
curl --request PUT \
--url https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange \
--header 'x-firmly-authorization: YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"quantity": 2}'
const response = await fetch('https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange', {
method: 'PUT',
headers: {
'x-firmly-authorization': 'YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quantity: 2
})
});
const cart = await response.json();
import requests
response = requests.put(
'https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange',
headers={
'x-firmly-authorization': 'YOUR_TOKEN',
'Content-Type': 'application/json'
},
json={
'quantity': 2
}
)
cart = response.json()
{
"cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
"platform_id": "example",
"shop_id": "staging.luma.gift",
"display_name": "Luma Store",
"line_items": [
{
"line_item_id": "1ee530e1-063d-4e07-afb2-e7e65245977e",
"platform_line_item_id": "4df9941b-bd06-4495-8759-61c6145dc408",
"sku": "WS12-XS-Orange",
"base_sku": "WS12",
"quantity": 2,
"description": "Radiant Tee - Orange XS",
"price": {
"currency": "USD",
"value": 22.00,
"symbol": "$",
"number": 2200
},
"line_price": {
"currency": "USD",
"value": 44.00,
"symbol": "$",
"number": 4400
},
"msrp": {
"currency": "USD",
"value": 22.00,
"symbol": "$",
"number": 2200
},
"image": {
"url": "https://cdn.staging.luma.gift/products/radiant-tee/orange.jpg"
},
"requires_shipping": true
}
],
"sub_total": {
"currency": "USD",
"value": 1739.98,
"symbol": "$",
"number": 173998
},
"shipping_total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"tax": {
"currency": "USD",
"value": 4.40,
"symbol": "$",
"number": 440
},
"fees": [
{
"description": "Recycle fee",
"currency": "USD",
"value": 2.00,
"symbol": "$",
"number": 200
}
],
"fee_total": {
"currency": "USD",
"value": 2.00,
"symbol": "$",
"number": 200
},
"total": {
"currency": "USD",
"value": 50.40,
"symbol": "$",
"number": 5040
},
"payment_method_options": [
{
"type": "CreditCard",
"wallet": "user"
}
]
}
{
"cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
"platform_id": "example",
"shop_id": "staging.luma.gift",
"display_name": "Luma Store",
"line_items": [],
"sub_total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"tax": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"payment_method_options": [
{
"type": "CreditCard",
"wallet": "user"
}
]
}
Overview
Updates the quantity of an existing item in the cart. Set quantity to 0 to remove the item.Authentication
Path Parameters
Request Body
Query Parameters
Response
Returns the updated shopping cart.Response Fields
Same as Get Cart response.curl --request PUT \
--url https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange \
--header 'x-firmly-authorization: YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"quantity": 2}'
const response = await fetch('https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange', {
method: 'PUT',
headers: {
'x-firmly-authorization': 'YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quantity: 2
})
});
const cart = await response.json();
import requests
response = requests.put(
'https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange',
headers={
'x-firmly-authorization': 'YOUR_TOKEN',
'Content-Type': 'application/json'
},
json={
'quantity': 2
}
)
cart = response.json()
{
"cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
"platform_id": "example",
"shop_id": "staging.luma.gift",
"display_name": "Luma Store",
"line_items": [
{
"line_item_id": "1ee530e1-063d-4e07-afb2-e7e65245977e",
"platform_line_item_id": "4df9941b-bd06-4495-8759-61c6145dc408",
"sku": "WS12-XS-Orange",
"base_sku": "WS12",
"quantity": 2,
"description": "Radiant Tee - Orange XS",
"price": {
"currency": "USD",
"value": 22.00,
"symbol": "$",
"number": 2200
},
"line_price": {
"currency": "USD",
"value": 44.00,
"symbol": "$",
"number": 4400
},
"msrp": {
"currency": "USD",
"value": 22.00,
"symbol": "$",
"number": 2200
},
"image": {
"url": "https://cdn.staging.luma.gift/products/radiant-tee/orange.jpg"
},
"requires_shipping": true
}
],
"sub_total": {
"currency": "USD",
"value": 1739.98,
"symbol": "$",
"number": 173998
},
"shipping_total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"tax": {
"currency": "USD",
"value": 4.40,
"symbol": "$",
"number": 440
},
"fees": [
{
"description": "Recycle fee",
"currency": "USD",
"value": 2.00,
"symbol": "$",
"number": 200
}
],
"fee_total": {
"currency": "USD",
"value": 2.00,
"symbol": "$",
"number": 200
},
"total": {
"currency": "USD",
"value": 50.40,
"symbol": "$",
"number": 5040
},
"payment_method_options": [
{
"type": "CreditCard",
"wallet": "user"
}
]
}
{
"cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
"platform_id": "example",
"shop_id": "staging.luma.gift",
"display_name": "Luma Store",
"line_items": [],
"sub_total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"tax": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"payment_method_options": [
{
"type": "CreditCard",
"wallet": "user"
}
]
}
Error Responses
400 Bad Request
Missing or invalid authentication header404 Not Found
Product not found in the cart409 Conflict
Not enough stock available for the requested quantity422 Unprocessable Entity
Invalid request body format⌘I
curl --request PUT \
--url https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange \
--header 'x-firmly-authorization: YOUR_TOKEN' \
--header 'Content-Type: application/json' \
--data '{"quantity": 2}'
const response = await fetch('https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange', {
method: 'PUT',
headers: {
'x-firmly-authorization': 'YOUR_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
quantity: 2
})
});
const cart = await response.json();
import requests
response = requests.put(
'https://api.firmly.work/api/v1/domains/staging.luma.gift/cart/line-items/WS12-XS-Orange',
headers={
'x-firmly-authorization': 'YOUR_TOKEN',
'Content-Type': 'application/json'
},
json={
'quantity': 2
}
)
cart = response.json()
{
"cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
"platform_id": "example",
"shop_id": "staging.luma.gift",
"display_name": "Luma Store",
"line_items": [
{
"line_item_id": "1ee530e1-063d-4e07-afb2-e7e65245977e",
"platform_line_item_id": "4df9941b-bd06-4495-8759-61c6145dc408",
"sku": "WS12-XS-Orange",
"base_sku": "WS12",
"quantity": 2,
"description": "Radiant Tee - Orange XS",
"price": {
"currency": "USD",
"value": 22.00,
"symbol": "$",
"number": 2200
},
"line_price": {
"currency": "USD",
"value": 44.00,
"symbol": "$",
"number": 4400
},
"msrp": {
"currency": "USD",
"value": 22.00,
"symbol": "$",
"number": 2200
},
"image": {
"url": "https://cdn.staging.luma.gift/products/radiant-tee/orange.jpg"
},
"requires_shipping": true
}
],
"sub_total": {
"currency": "USD",
"value": 1739.98,
"symbol": "$",
"number": 173998
},
"shipping_total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"tax": {
"currency": "USD",
"value": 4.40,
"symbol": "$",
"number": 440
},
"fees": [
{
"description": "Recycle fee",
"currency": "USD",
"value": 2.00,
"symbol": "$",
"number": 200
}
],
"fee_total": {
"currency": "USD",
"value": 2.00,
"symbol": "$",
"number": 200
},
"total": {
"currency": "USD",
"value": 50.40,
"symbol": "$",
"number": 5040
},
"payment_method_options": [
{
"type": "CreditCard",
"wallet": "user"
}
]
}
{
"cart_id": "1e43868c-d4a5-418c-bd6b-5fff043550d2",
"platform_id": "example",
"shop_id": "staging.luma.gift",
"display_name": "Luma Store",
"line_items": [],
"sub_total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"tax": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"total": {
"currency": "USD",
"value": 0,
"symbol": "$",
"number": 0
},
"payment_method_options": [
{
"type": "CreditCard",
"wallet": "user"
}
]
}