Set a variant's stock at a location
const url = 'https://app.nexym.nl/api/connect/stock';const options = { method: 'PUT', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"variant_reference":"ACME-1234-BLK","location_reference":"WH-MAIN","qty":42}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://app.nexym.nl/api/connect/stock \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "variant_reference": "ACME-1234-BLK", "location_reference": "WH-MAIN", "qty": 42 }'Looks the variant up by variant_reference inside the key’s project, then
upserts the stock row for that variant at location_reference (defaulting to the
literal default when omitted). qty is written to both qty and
qty_available; qty_reserved is left as it was, and synced_at is stamped
with the current time.
Unknown variant references produce a 404. The response is always 200, whether
the stock row was created or updated.
Requires stock: write.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”The write payload for a stock level. Only these three keys are read; anything else in the body is ignored.
object
The variant’s universal reference. It must already exist in this project — an unknown reference is a 404, never a created variant.
Defaults to the literal default when omitted or null.
Written to both qty and qty_available.
Responses
Section titled “Responses”The stored stock row.
Quantity of one variant at one location.
object
The warehouse or shop this quantity is held at. Rows written through this API
without a location use the literal default.
Free to sell — qty minus whatever the source reports as reserved.
Free-form store for fields the universal schema does not define for everybody: a connector’s declared extension fields and a project’s own customer fields, each under its own name.
The variant a stock row belongs to, as the stock listing returns it.
object
Example
{ "id": 55102, "project_id": 3, "variant_id": 90412, "location_reference": "default", "qty": 42, "qty_available": 42, "qty_reserved": 0, "meta": { "service_code": "INSTALL-STD" }, "synced_at": "2026-09-19T06:30:02.000000Z", "created_at": "2026-08-01T11:03:29.000000Z", "updated_at": "2026-09-19T06:30:02.000000Z", "variant": { "id": 90412, "reference": "ACME-1234-BLK", "sku": "ACME-1234-BLK" }}No key, a key that does not match, a revoked key, or an expired one. The body says which, and nothing else — an unusable key is never described further.
Every error this API returns carries a single human-readable message.
object
Examples
No bearer token, or one too short to hold a prefix
{ "message": "Missing or invalid API key."}Unknown key, or a failed hash check
{ "message": "Invalid API key."}The key was revoked in the dashboard
{ "message": "API key has been revoked."}The key's expiry has passed
{ "message": "API key has expired."}The key is valid but its abilities do not cover this resource at this right.
Every error this API returns carries a single human-readable message.
object
Examples
{ "message": "This API key lacks read access to orders."}{ "message": "This API key lacks write access to stock."}A referenced record does not exist inside the key’s project.
Every error this API returns carries a single human-readable message.
object
Examples
{ "message": "No query results for model [Wedigify\\Connect\\Models\\ProductVariant]."}The payload failed validation. The framework’s standard shape: a summary
message plus an errors map of field to messages. Requires
Accept: application/json — without it the response is a 302 redirect instead.
object
Field name to the list of messages that field failed on.
object
Examples
{ "message": "The reference field is required. (and 1 more error)", "errors": { "reference": [ "The reference field is required." ], "name": [ "The name field is required." ] }}The per-minute rate limit was exceeded. The limit is 120 requests per minute by
default (CONNECT_API_RATE_PER_MIN), counted per API key — or per IP address for
a request that never authenticated.
Every error this API returns carries a single human-readable message.
object
Examples
{ "message": "Too many requests — slow down."}Headers
Section titled “Headers”Seconds until the limit resets.
Requests allowed per minute.
Requests left in the current window.