Skip to Content
MinexonMinexon

cart.add

Adds one unit of a store product to the cart.

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

API scope cart.add

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.

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"
}' \
  "${MINEXON_BASE_URL}/api/v1/en/cart/items"

Response

HTTP 200 · application/json

FieldTypeRequirementDescription
countintegerRequiredTotal store product quantity in the cart.
{
  "count": 1
}

Flow and error cases

A product already in the cart keeps its current quantity.

HTTP 404 · application/json

{
  "error": "unavailable"
}

HTTP 409 · application/json

{
  "error": "upgrade_conflict"
}

Shared error and authentication contract