API — Cupoes
Documentacao tecnica gerada automaticamente a partir da especificacao OpenAPI.
GET /api/coupons
List Coupons
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| page | integer | Nao | — |
| page_size | integer | Nao | — |
Exemplo resposta (200):
{
"items": [
"..."
],
"total": 0,
"page": 0,
"page_size": 0,
"pages": 0
}
Erros possiveis: 422 Validation Error
POST /api/coupons
Create Coupon
Corpo do pedido:
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| code | string | Sim | Code |
| description | object | Nao | Description |
| discount_type | object | Nao | Discount Type |
| type | object | Nao | Type |
| discount_value | object | Nao | Discount Value |
| value | object | Nao | Value |
| min_order_amount | object | Nao | Min Order Amount |
| max_discount_amount | object | Nao | Max Discount Amount |
| usage_limit | object | Nao | Usage Limit |
| per_customer_limit | integer | Nao | Per Customer Limit |
| valid_from | object | Nao | Valid From |
| valid_until | object | Nao | Valid Until |
| is_active | boolean | Nao | Is Active |
Exemplo pedido:
{
"code": "string",
"description": null,
"discount_type": null,
"type": null,
"discount_value": null,
"value": null,
"min_order_amount": null,
"max_discount_amount": null,
"usage_limit": null,
"per_customer_limit": 0,
"valid_from": null,
"valid_until": null,
"is_active": true
}
Exemplo resposta (201):
{
"id": 0,
"tenant_id": 0,
"code": "string",
"description": null,
"discount_type": "string",
"type": null,
"discount_value": "string",
"value": null,
"min_order_amount": null,
"max_discount_amount": null,
"usage_limit": null,
"usage_count": 0,
"per_customer_limit": 0,
"valid_from": null,
"valid_until": null,
"is_active": true
}
Erros possiveis: 422 Validation Error
PUT /api/coupons/{coupon_id}
Update Coupon
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| coupon_id | integer | Sim | — |
Corpo do pedido:
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| code | object | Nao | Code |
| description | object | Nao | Description |
| discount_type | object | Nao | Discount Type |
| type | object | Nao | Type |
| discount_value | object | Nao | Discount Value |
| value | object | Nao | Value |
| min_order_amount | object | Nao | Min Order Amount |
| max_discount_amount | object | Nao | Max Discount Amount |
| usage_limit | object | Nao | Usage Limit |
| per_customer_limit | object | Nao | Per Customer Limit |
| valid_from | object | Nao | Valid From |
| valid_until | object | Nao | Valid Until |
| is_active | object | Nao | Is Active |
Exemplo pedido:
{
"code": null,
"description": null,
"discount_type": null,
"type": null,
"discount_value": null,
"value": null,
"min_order_amount": null,
"max_discount_amount": null,
"usage_limit": null,
"per_customer_limit": null,
"valid_from": null,
"valid_until": null,
"is_active": null
}
Exemplo resposta (200):
{
"id": 0,
"tenant_id": 0,
"code": "string",
"description": null,
"discount_type": "string",
"type": null,
"discount_value": "string",
"value": null,
"min_order_amount": null,
"max_discount_amount": null,
"usage_limit": null,
"usage_count": 0,
"per_customer_limit": 0,
"valid_from": null,
"valid_until": null,
"is_active": true
}
Erros possiveis: 422 Validation Error
DELETE /api/coupons/{coupon_id}
Delete Coupon
Parametros:
| Nome | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| coupon_id | integer | Sim | — |
Resposta (204): Successful Response
Erros possiveis: 422 Validation Error
POST /api/coupons/validate
Validate Coupon
Corpo do pedido:
| Campo | Tipo | Obrigatorio | Descricao |
|---|---|---|---|
| code | string | Sim | Code |
| order_amount | object | Sim | Order Amount |
Exemplo pedido:
{
"code": "string",
"order_amount": null
}
Exemplo resposta (200):
{
"valid": true,
"code": "string",
"discount_type": null,
"discount_value": null,
"discount_amount": null,
"message": "string"
}
Erros possiveis: 422 Validation Error
Documentacao gerada automaticamente.