cart.add
Adds one unit of a store product to the cart.
POST
/api/v1/{locale}/cart/itemsAPI scope cart.add
Request
Send Authorization: Bearer <key> with each request.
Preserve the same session cookie across the steps in this flow.
Path parameters
| Field | Type | Requirement | Description |
|---|---|---|---|
locale | tr or en | Required | Request locale. |
Request body
| Field | Type | Requirement | Description |
|---|---|---|---|
product | string | Required | Product 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
| Field | Type | Requirement | Description |
|---|---|---|---|
count | integer | Required | Total 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"
}