Pular para o conteúdo

PUT /v1/products/{id}/variants

PUT
/v1/products/{id}/variants
curl --request PUT \
--url https://seu-endereco-da-api/v1/products/example/variants \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "optionNames": [ "example" ], "variants": [ { "options": [ "example" ], "sku": "example", "priceCents": 1, "stock": 1, "active": true } ] }'

Permissão que a Chave de acesso precisa: Gerenciar catálogo (catalog:manage).

id
required
string
Media typeapplication/json
object
optionNames
required
Array<string>
variants
required
Array<object>
object
options
required
Array<string>
sku
string
nullable <= 64 characters
priceCents
number
nullable <= 100000000
stock
number
nullable <= 1000000000
active
boolean

Example generated

{
"optionNames": [
"example"
],
"variants": [
{
"options": [
"example"
],
"sku": "example",
"priceCents": 1,
"stock": 1,
"active": true
}
]
}
Media typeapplication/json
object
productId
required
string
optionNames
required
Array<string>
variants
required
Array<object>
object
id
required
string
options
required

Values aligned with the option group names of the product

Array<string>
sku
required
string
nullable
priceCents
required

Null uses the product price

number
nullable
stock
required

Null means unlimited

number
nullable
active
required
boolean
position
required
number

Example generated

{
"productId": "example",
"optionNames": [
"example"
],
"variants": [
{
"id": "example",
"options": [
"example"
],
"sku": "example",
"priceCents": 1,
"stock": 1,
"active": true,
"position": 1
}
]
}