Update a variant

Updates the specified variant by setting the values of the parameters passed.
Any parameters not provided will be left unchanged.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
integer
required

Variant id

Body Params

Variant details

string
number | null
0 to 100000000000
number | null
0 to 100000000000
integer
≤ 2147483647
supplier_item_codes
array of strings
length ≥ 1
supplier_item_codes
string
length between 3 and 40
string
length ≤ 120
integer
≤ 2147483647
integer | null
≤ 999
number | null
0 to 999999999
config_attributes
array of objects
length ≥ 1
config_attributes
string
required

If a matching config name is not found, an error is returned.
Use the product/material endpoint to update the configs.

string
required

If a matching config name is not found,
the product/material config list of values is updated, and a new value is added.

custom_fields

Custom field values on the variant, in whichever representation applies to the account — see the X-Custom-Fields-Format header.

In the object representation the values are merged, not replaced: omit a key to leave it unchanged, and send null to clear one. Values already snapshotted onto existing sales order rows, purchase order rows, or manufacturing orders are not touched — those records keep what they were created with.

Headers
string
enum

Selects the representation of custom_fields on items, for both the request body and the response.

  • default — object keyed by custom field definition id (UUID).
  • legacy — the {field_name, field_value} array tied to custom fields collections.

Most accounts do not need this header: an account that has not moved to item custom fields always gets legacy, and an account that has moved and no longer uses collections always gets the object representation. The header matters only while both are available for the account, where legacy is the default and default opts into the object representation.

Requesting a representation the account does not have returns 422, as does sending a custom_fields body whose shape does not match the representation in force, mixing both shapes in one request, or combining custom_field_collection_id with the object representation — that field belongs to the legacy representation and is left out of responses entirely under the object one. Responses vary on this header.

Allowed:
Responses

Language
Credentials
Bearer
LoadingLoading…
Response
Choose an example:
application/json