Update variant
const url = 'https://acme.mykreezalid.com/api/v1/variants/1';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"external_id":"INTERNAL_REF_234324","price":123.5,"price_unit":null,"quantity":10,"sort_priority":10,"sku":"BASKT-XYZ-BLN-41","title":"Blue Shoes Size 41","weight":0.8,"cover_id":4242}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://acme.mykreezalid.com/api/v1/variants/1 \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "external_id": "INTERNAL_REF_234324", "price": 123.5, "price_unit": null, "quantity": 10, "sort_priority": 10, "sku": "BASKT-XYZ-BLN-41", "title": "Blue Shoes Size 41", "weight": 0.8, "cover_id": 4242 }'Changes the fields you send and leaves the others untouched. Returns the updated variant.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Variant’s unique identifier
Request Bodyrequired
Section titled “Request Bodyrequired”The variant fields to change. They can also be wrapped in a variant object.
A version of a listing that differs by size, color or any other characteristic, with its own price, SKU and stock.
object
Variant’s unique identifier
Example
432432Example
VariantYour own reference for the variant
Example
INTERNAL_REF_234324Unique identifier of the listing the variant belongs to
Example
324353Example
123.5Example
nullThe quantity of the variant that is available for sale
Example
10Sorts the variants with the lowest number first. Negative numbers are allowed.
Example
10Example
BASKT-XYZ-BLN-41Example
Blue Shoes Size 41Example
0.8Unique identifier of the listing image used for this variant
Example
4242Responses
Section titled “Responses”The variant has been updated
object
A version of a listing that differs by size, color or any other characteristic, with its own price, SKU and stock.
object
Variant’s unique identifier
Your own reference for the variant
Unique identifier of the listing the variant belongs to
The quantity of the variant that is available for sale
Sorts the variants with the lowest number first. Negative numbers are allowed.
Unique identifier of the listing image used for this variant
Example
{ "variant": { "id": 432432, "object": "Variant", "external_id": "INTERNAL_REF_234324", "listing_id": 324353, "price": 123.5, "price_unit": null, "quantity": 10, "sort_priority": 10, "sku": "BASKT-XYZ-BLN-41", "title": "Blue Shoes Size 41", "weight": 0.8, "cover_id": 4242 }}The variant could not be saved; error lists the invalid fields
object
object
Example generated
{ "error": {}}Missing or wrong API credentials, or variants are not enabled for your marketplace (then the body carries an error message)
object
Example generated
{ "error": "example"}No variant has this identifier
object
Example
{ "error": "Variant with ID 4242 cannot be found"}