Updating cart quantities
How to update the quantity of an item in your shopping cart
Problem

Solution
Example
Mapping

More to read
Last updated
How to update the quantity of an item in your shopping cart


Last updated
curl -g -X PATCH \
'http://yourdomain.commercelayer.io/api/line_items/aBmNkPQRst' \
-H 'Accept: application/vnd.api+json' \
-H 'Authorization: Bearer your-access-token' \
-d '{
"data": {
"id": "aBmNkPQRst",
"type": "line_items",
"attributes": {
"quantity": 6
}
}
}'{
"data": {
"id": "aBmNkPQRst",
"type": "line_items",
"links": {
"self": "https://yourdomain.commercelayer.io/api/line_items/aBmNkPQRst"
},
"attributes": {
"sku_code": "TSHIRTB5B5B5XL",
"quantity": 6,
"currency_code": "EUR",
"unit_amount_cents": 12900,
"unit_amount_float": 129.0,
"formatted_unit_amount": "129,00€",
"options_amount_cents": 0,
"options_amount_float": 0.0,
"formatted_options_amount": "$0.00",
"total_amount_cents": 77400,
"total_amount_float": 774.0,
"formatted_total_amount": "774,00€",
"name": "Grey T-Shirt XL",
"image_url": "https://img.yourdomain.com/skus/TSHIRTB5B5B5XL.png",
"tax_rate": null,
"tax_breakdown": {},
"item_type": "skus",
"created_at": "2018-01-01T12:00:00.000Z",
"updated_at": "2018-01-01T12:00:00.000Z",
"reference": null,
"metadata": {}
},
"relationships": {
"order": {
"links": {...}
},
"item": {
"links": {...}
},
"line_item_options": {
"links": {...}
}
},
"meta": {
"mode": "test"
}
}
}