Saltar al contenido principal

API — Variants

Documentacao tecnica gerada automaticamente a partir da especificacao OpenAPI.


GET /api/products/{product_id}/variants

List Variants

Parametros:

NomeTipoObrigatorioDescricao
product_idintegerSim

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:

NomeTipoObrigatorioDescricao
product_idintegerSim

Corpo do pedido:

CampoTipoObrigatorioDescricao
skuobjectNaoSku
priceobjectSimPrice
sale_priceobjectNaoSale Price
stock_quantityintegerNaoStock Quantity
stock_statusstringNaoStock Status
weightobjectNaoWeight
image_urlobjectNaoImage Url
is_activebooleanNaoIs Active
attribute_value_idsarrayNaoAttribute 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:

NomeTipoObrigatorioDescricao
product_idintegerSim
variant_idintegerSim

Corpo do pedido:

CampoTipoObrigatorioDescricao
skuobjectNaoSku
priceobjectNaoPrice
sale_priceobjectNaoSale Price
stock_quantityobjectNaoStock Quantity
stock_statusobjectNaoStock Status
weightobjectNaoWeight
image_urlobjectNaoImage Url
is_activeobjectNaoIs Active
attribute_value_idsobjectNaoAttribute 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:

NomeTipoObrigatorioDescricao
product_idintegerSim
variant_idintegerSim

Resposta (204): Successful Response

Erros possiveis: 422 Validation Error


Documentacao gerada automaticamente.