Update a Cart Item
PUThttps://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID
You can easily update a cart item. A successful update returns the cart items.
Request
Path Parameters
cartID stringrequired
A unique identifier of the cart that you created.
cartitemID stringrequired
A unique identifier of the cart item.
- application/json
Body
data object
Responses
- 200
- 401
Response Headers
- application/json
- Schema
- Example (from schema)
Schema
data object[]
meta object
{
"data": [
{}
],
"meta": {
"display_price": {
"with_tax": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"without_tax": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"tax": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"discount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"without_discount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"discounts": {}
},
"timestamps": {
"created_at": "string"
}
}
}
Unauthorized
- application/json
- Schema
- Example (from schema)
- Example
Schema
detail string
status string
title string
[
null
]
{
"errors": {
"status": 401,
"title": "Unauthorized"
}
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L -X PUT 'https://useast.api.elasticpath.com/v2/carts/:cartID/items/:cartitemID' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
--data-raw '{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"quantity": 0,
"custom_inputs": {},
"shipping_group_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}'
ResponseClear