Locations
Update location stock
Sets the stock state of up to 500 items, variations or modifier options in one call: `out_of_stock` to 86 one, `in_stock` to bring it back.
https://api.maple.inc/v1/locations/{locationId}/catalog/stock API keyEach is named by object_type and external_id. All-or-nothing: if any object is not in the published catalog, the call answers 404 stock_object_not_found, names every missing one and changes nothing. The phone agent sees the change at once; you need not republish. Returns the changed objects. Requires catalog:write and an active connection to the location.
Authorization
Send your API key as Authorization: Bearer <key>: mpk_test_… for test mode, mpk_live_… for live mode. Both use https://api.maple.inc/v1. See Authentication. The samples read the key from MAPLE_KEY and the base URL from MAPLE_BASE, as set up in the Quickstart.
Parameters
-
locationIdstring required -
Idempotency-KeystringYour unique key for this request, such as a UUID. A retry with the same key and the same body within 24 hours returns the first response, with
Idempotent-Replayed: true, and does not run again. See https://docs.maple.inc/developer-api/concepts/idempotency Up to 255 characters. -
Maple-VersionstringThe API version your code expects. A version Maple does not serve answers 400
invalid_requestwithparamMaple-Version. See https://docs.maple.inc/developer-api/concepts/versioning Always2026-11-27.
Request body
application/json, required.
-
updatesobject[] requiredUp to 500 items.
-
updates[].object_typestring requiredOne of
item,variation,modifier_option. -
updates[].external_idstring required -
updates[].stock_statusstring requiredOne of
in_stock,out_of_stock,low_stock.
Responses
200 OK
-
objectstring requiredAlways
list. -
dataobject[] required -
data[].objectstring requiredAlways
stock_status. -
data[].livemodeboolean required -
data[].idstring requiredMaple’s id for the object, as the catalog returns it in
id. Use it asstarting_after. -
data[].external_idstring requiredThe
external_idyou published the object under. -
data[].object_typestring requiredOne of
item,variation,modifier_option. -
data[].namestring required -
data[].stock_statusstring requiredOne of
in_stock,out_of_stock,low_stock. -
has_moreboolean required
Errors
-
400Bad request -
401Unauthorized -
403Forbidden -
404Not found -
409Conflict -
415 -
429Too many requests -
500Server error
Every error body is one error object: branch on its type and code; message is for people, param names the field at fault, and doc_url links the code on Errors.
A 429 also sends Retry-After: Seconds to wait before retrying; also returned as error.retry_after in the body.