Skip to content

Update variant

PATCH
/variants/{id}
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.

id
required
integer

Variant’s unique identifier

The variant fields to change. They can also be wrapped in a variant object.

Media typeapplication/json

A version of a listing that differs by size, color or any other characteristic, with its own price, SKU and stock.

object
id

Variant’s unique identifier

integer

Example

432432
object
string
default: Variant

Example

Variant
external_id

Your own reference for the variant

string
nullable

Example

INTERNAL_REF_234324
listing_id

Unique identifier of the listing the variant belongs to

integer

Example

324353
price
number
nullable

Example

123.5
price_unit
integer
nullable

Example

null
quantity

The quantity of the variant that is available for sale

number
nullable

Example

10
sort_priority

Sorts the variants with the lowest number first. Negative numbers are allowed.

number
nullable

Example

10
sku
string
nullable

Example

BASKT-XYZ-BLN-41
title
required
string

Example

Blue Shoes Size 41
weight
number

Example

0.8
cover_id

Unique identifier of the listing image used for this variant

integer
nullable

Example

4242

The variant has been updated

Media typeapplication/json
object
variant

A version of a listing that differs by size, color or any other characteristic, with its own price, SKU and stock.

object
id

Variant’s unique identifier

integer
object
string
default: Variant
external_id

Your own reference for the variant

string
nullable
listing_id

Unique identifier of the listing the variant belongs to

integer
price
number
nullable
price_unit
integer
nullable
quantity

The quantity of the variant that is available for sale

number
nullable
sort_priority

Sorts the variants with the lowest number first. Negative numbers are allowed.

number
nullable
sku
string
nullable
title
required
string
weight
number
cover_id

Unique identifier of the listing image used for this variant

integer
nullable

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

Media typeapplication/json
object
error
object
key
additional properties
any

Example generated

{
"error": {}
}

Missing or wrong API credentials, or variants are not enabled for your marketplace (then the body carries an error message)

Media typeapplication/json
object
error
string

Example generated

{
"error": "example"
}

No variant has this identifier

Media typeapplication/json
object
error
string

Example

{
"error": "Variant with ID 4242 cannot be found"
}