Basket Item Limits by Shop Category
Introduction
A shop category can cap how many items a customer may hold in their basket from that category. When a limit is configured, the basket validates every write against it. The HTTP status code signals the outcome: 206 Partial Content when the requested quantity was capped, 413 Request Entity Too Large when the category is blocked entirely.
This page describes that API behavior. The limit itself is not a Storefront API concept: it is configured as customData on the shop category in the SCAYLE Panel. For the configuration, the country- and shop-level precedence rules, the inheritance across the category tree, and the tenant setting this feature requires, see Shop Categories #Basket Item Limits by Shop Category.
When Validation Runs
The basket validates against the relevant category limits on these actions:
- adding a new item to the basket.
- increasing the quantity of an existing item.
- an unavailable item becoming available again, for example after a restock.
The basket calculates the remaining allowance for a category as the configured limit minus the sum of available items already in the basket from that category and its descendants.
Only available items count toward the limit. Items on the unavailable list (for example, because they went out of stock) are excluded from the sum.
Reducing an existing item's quantity always succeeds, regardless of category limits.
Response Behavior
When a category limit is in effect, a basket write resolves to one of these outcomes:
| Status | Meaning |
|---|---|
201 (add) / 200 (update) | The request was within the remaining allowance. The item was added or updated at the requested quantity. |
206 Partial Content | A category limit capped the quantity. The request was processed, but the resulting basket state differs from what was requested. Inspect the returned basket to see the applied quantity per item. |
413 Request Entity Too Large | The category is blocked, because its limit is set to 0. No items from it can be added, so the request is rejected and the basket is unchanged. |
206 is also returned when the remaining allowance is 0 but the category limit itself is greater than 0. Nothing is added, and the response body reflects the unchanged basket.
413 is not exclusive to category limits. The same status is returned when a request exceeds the maximum allowed quantity for a single item, independently of any category configuration. Do not treat a 413 as proof that a category is blocked.
Examples
- The basket is empty. The category limit is
2. The customer tries to add3items → the basket adds2items and returns206 Partial Content. - The basket already contains
2items from the category. The category limit is2. The customer tries to add1more → no items are added (allowance is0), but because the limit is greater than0, the basket returns206 Partial Content. - The category limit is
0. The customer tries to add1item → no items are added and the basket returns413 Request Entity Too Large.
Affected Endpoints
Both endpoints can return these responses:
POST /v1/baskets/{basketId}/items: add basket item.PATCH /v1/baskets/{basketId}/items/{itemKey}: update basket item.
Frontend Implementation
Treat 206 as a success that needs reconciliation, not as an error. The call went through, so read the returned basket and render the applied quantities instead of the requested ones. Tell the customer their quantity was capped.
Treat 413 as a rejection: the basket is unchanged. The response does not indicate whether a blocked category or the per-item maximum quantity caused it, so show a generic message and do not retry automatically.
Limits are cached by the basket and refreshed on a schedule. A newly configured or changed limit is not reflected in active baskets immediately, so allow up to 15 minutes before testing the API behavior against it.