Skip to Content
MinexonMinexon

cart.update

Sets a cart line quantity or removes it by setting zero.

POST/api/v1/{locale}/cart/items/update

API scope cart.update

Request

Send Authorization: Bearer <key> with each request.

Preserve the same session cookie across the steps in this flow.

Path parameters

FieldTypeRequirementDescription
localetr or enRequiredRequest locale.

Request body

FieldTypeRequirementDescription
productstringRequiredProduct slug.
set_quantityintegerOptionalNew quantity. Takes precedence over quantity when supplied.
quantityintegerOptionalNew quantity when set_quantity is absent. Send one of the two fields.

Run samples from your application server. See Quickstart for variables and sessions.

curl --fail-with-body --request POST \
  -H "Authorization: Bearer $MINEXON_API_KEY" \
  -b "$MINEXON_COOKIE_JAR" -c "$MINEXON_COOKIE_JAR" \
  -H 'Content-Type: application/json' \
  --data '{
  "product": "example-product",
  "set_quantity": 1
}' \
  "${MINEXON_BASE_URL}/api/v1/en/cart/items/update"

Response

HTTP 200 · application/json

FieldTypeRequirementDescription
dataobjectRequiredOperation result.
data.countintegerRequiredTotal remaining quantity in the cart.
data.noticestring | nullRequiredChange notification.
{
  "data": {
    "count": 1,
    "notice": "updated"
  }
}

Flow and error cases

HTTP 422 · application/json

{
  "error": "invalid"
}

HTTP 409 · application/json

{
  "error": "stock_exceeded"
}

Shared error and authentication contract