Naar de inhoud
Open Nexym

Set a variant's stock at a location

PUT
/api/connect/stock
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.

Media typeapplication/json

The write payload for a stock level. Only these three keys are read; anything else in the body is ignored.

object
variant_reference
required

The variant’s universal reference. It must already exist in this project — an unknown reference is a 404, never a created variant.

string
location_reference

Defaults to the literal default when omitted or null.

string | null
qty
required

Written to both qty and qty_available.

integer

The stored stock row.

Media typeapplication/json

Quantity of one variant at one location.

object
id
integer
project_id
integer
variant_id
integer
location_reference

The warehouse or shop this quantity is held at. Rows written through this API without a location use the literal default.

string | null
qty
integer | null
qty_available

Free to sell — qty minus whatever the source reports as reserved.

integer | null
qty_reserved
integer | null
meta

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.

object | null
synced_at
string | null format: date-time
created_at
string | null format: date-time
updated_at
string | null format: date-time
variant

The variant a stock row belongs to, as the stock listing returns it.

object
id
integer
reference
string
sku
string | null

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.

Media typeapplication/json

Every error this API returns carries a single human-readable message.

object
message
required
string

Examples

No bearer token, or one too short to hold a prefix

{
"message": "Missing or invalid API key."
}

The key is valid but its abilities do not cover this resource at this right.

Media typeapplication/json

Every error this API returns carries a single human-readable message.

object
message
required
string

Examples

{
"message": "This API key lacks read access to orders."
}

A referenced record does not exist inside the key’s project.

Media typeapplication/json

Every error this API returns carries a single human-readable message.

object
message
required
string

Examples

Examplevariant
{
"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.

Media typeapplication/json
object
message
required
string
errors
required

Field name to the list of messages that field failed on.

object
key
additional properties
Array<string>

Examples

Exampleproduct
{
"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.

Media typeapplication/json

Every error this API returns carries a single human-readable message.

object
message
required
string

Examples

Examplelimited
{
"message": "Too many requests — slow down."
}
Retry-After
integer

Seconds until the limit resets.

X-RateLimit-Limit
integer

Requests allowed per minute.

X-RateLimit-Remaining
integer

Requests left in the current window.