API — Variants
Documentacao tecnica gerada automaticamente a partir da especificacao OpenAPI.
GET /api/products/{product_id}/variants
List Variants
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
Exemplo resposta (200):
[{
"id": 0,
"product_id": 0,
"sku": null,
"price": "string",
"sale_price": null,
"stock_quantity": 0,
"stock_status": "string",
"weight": null,
"image_url": null,
"is_active": true
}]
Erros possiveis: 422 Validation Error
POST /api/products/{product_id}/variants
Create Variant
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
Corpo do pedido:
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| sku | object | Nao | Sku |
| price | object | Sim | Price |
| sale_price | object | Nao | Sale Price |
| stock_quantity | integer | Nao | Stock Quantity |
| stock_status | string | Nao | Stock Status |
| weight | object | Nao | Weight |
| image_url | object | Nao | Image Url |
| is_active | boolean | Nao | Is Active |
| attribute_value_ids | array | Nao | Attribute Value Ids |
Exemplo pedido:
{
"sku": null,
"price": null,
"sale_price": null,
"stock_quantity": 0,
"stock_status": "string",
"weight": null,
"image_url": null,
"is_active": true,
"attribute_value_ids": [
"..."
]
}
Exemplo resposta (201):
{
"id": 0,
"product_id": 0,
"sku": null,
"price": "string",
"sale_price": null,
"stock_quantity": 0,
"stock_status": "string",
"weight": null,
"image_url": null,
"is_active": true
}
Erros possiveis: 422 Validation Error
PUT /api/products/{product_id}/variants/{variant_id}
Update Variant
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
| variant_id | integer | Sim | — |
Corpo do pedido:
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| sku | object | Nao | Sku |
| price | object | Nao | Price |
| sale_price | object | Nao | Sale Price |
| stock_quantity | object | Nao | Stock Quantity |
| stock_status | object | Nao | Stock Status |
| weight | object | Nao | Weight |
| image_url | object | Nao | Image Url |
| is_active | object | Nao | Is Active |
| attribute_value_ids | object | Nao | Attribute Value Ids |
Exemplo pedido:
{
"sku": null,
"price": null,
"sale_price": null,
"stock_quantity": null,
"stock_status": null,
"weight": null,
"image_url": null,
"is_active": null,
"attribute_value_ids": null
}
Exemplo resposta (200):
{
"id": 0,
"product_id": 0,
"sku": null,
"price": "string",
"sale_price": null,
"stock_quantity": 0,
"stock_status": "string",
"weight": null,
"image_url": null,
"is_active": true
}
Erros possiveis: 422 Validation Error
DELETE /api/products/{product_id}/variants/{variant_id}
Delete Variant
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| product_id | integer | Sim | — |
| variant_id | integer | Sim | — |
Resposta (204): Successful Response
Erros possiveis: 422 Validation Error
Documentacao gerada automaticamente.