Create variant
post
/v1/products/{product_id}/variantsAdd a new variant to an existing product.
Exemplo
curl -X POST "https://api.ya.onl/v1/products/{product_id}/variants" \
-H "X-API-Key: yv_live_v1_…" \
-H "Content-Type: application/json" \
-d '{"name":"…","base_price":"…","currency":"…","option_values":"…"}'Parâmetros
product_idintegerpathProduct identifier
Corpo da requisição
namestringVariant display name
skustring | nullProduct variant SKU code
base_pricenumber | stringOriginal price before discounts
currencySupportedCurrencyCurrency code (ISO 4217)
statusVariantStatuspadrão: "available"Variant availability status
option_valuesinteger[]List of option value IDs to associate with this variant. These IDs are returned when creating options via POST /products/{product_id}/options. At least one option value is required.
Respostas
201Successful Response
401Invalid or missing API key
403API key lacks the
products:write scope404Product not found
422Validation Error
429Rate limit exceeded
