Admin API
Variants
Per-product variants — size, colour, etc.
A variant represents a sellable SKU of a product. A product with no variants
has its own stock / sku / price. A product with variants delegates
those to the variant rows — the parent product's stock becomes a roll-up.
Variant object
{
"id": "v9d8c7b6-...",
"productId": "f3a7e9b8-...",
"name": "Medium / Emerald",
"sku": "KRT-EM-M",
"price": "1490.00",
"comparePrice": "1990.00",
"stock": 4,
"optionValues": {
"size": "M",
"color": "Emerald"
},
"isActive": true,
"createdAt": "2026-05-20T08:30:00.000Z"
}Create a variant
POST /api/v1/admin/products/{id}/variantsScope: products:write
Request body
{
"name": "Medium / Emerald",
"sku": "KRT-EM-M",
"price": "1490.00",
"comparePrice": "1990.00",
"stock": 4,
"optionValues": { "size": "M", "color": "Emerald" }
}| Field | Required | Notes |
|---|---|---|
name | yes | Display label — typically "<size> / <color>". |
sku | yes | Unique within the shop. |
price | yes | Money string. |
comparePrice | no | Money string. |
stock | no | Default 0. |
optionValues | no | Free-form key/value, used for option-grid rendering. |
Response
201 Created with the variant.
Errors
| Status | Code | When |
|---|---|---|
| 400 | invalid_body | Validation failed. |
| 404 | not_found | Product doesn't exist in this shop. |
| 409 | duplicate_sku | SKU already exists for another product/variant. |
Get a variant
GET /api/v1/admin/products/{id}/variants/{variantId}Scope: products:read
Update a variant
PATCH /api/v1/admin/products/{id}/variants/{variantId}Scope: products:write
Any subset of the create-time fields.
curl -X PATCH "https://api.sellvik.app/api/v1/admin/products/f3a7.../variants/v9d8..." \
-H "Authorization: Bearer <admin-key>" \
-H "Content-Type: application/json" \
-d '{ "stock": 10 }'Stock changes here bypass the inventory audit log. Prefer
POST /v1/admin/inventory/adjustwhen the change has a reason worth recording (sale, return, breakage, recount).
Soft-delete a variant
DELETE /api/v1/admin/products/{id}/variants/{variantId}Scope: products:write
Returns 204. Removes the variant from the storefront immediately; existing
order lines retain their reference.