Aller au contenu principal

API — Cupoes

Documentacao tecnica gerada automaticamente a partir da especificacao OpenAPI.


GET /api/coupons

List Coupons

Parametros:

NomeTipoObrigatorioDescricao
pageintegerNao
page_sizeintegerNao

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:

CampoTipoObrigatorioDescricao
codestringSimCode
descriptionobjectNaoDescription
discount_typeobjectNaoDiscount Type
typeobjectNaoType
discount_valueobjectNaoDiscount Value
valueobjectNaoValue
min_order_amountobjectNaoMin Order Amount
max_discount_amountobjectNaoMax Discount Amount
usage_limitobjectNaoUsage Limit
per_customer_limitintegerNaoPer Customer Limit
valid_fromobjectNaoValid From
valid_untilobjectNaoValid Until
is_activebooleanNaoIs 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:

NomeTipoObrigatorioDescricao
coupon_idintegerSim

Corpo do pedido:

CampoTipoObrigatorioDescricao
codeobjectNaoCode
descriptionobjectNaoDescription
discount_typeobjectNaoDiscount Type
typeobjectNaoType
discount_valueobjectNaoDiscount Value
valueobjectNaoValue
min_order_amountobjectNaoMin Order Amount
max_discount_amountobjectNaoMax Discount Amount
usage_limitobjectNaoUsage Limit
per_customer_limitobjectNaoPer Customer Limit
valid_fromobjectNaoValid From
valid_untilobjectNaoValid Until
is_activeobjectNaoIs 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:

NomeTipoObrigatorioDescricao
coupon_idintegerSim

Resposta (204): Successful Response

Erros possiveis: 422 Validation Error


POST /api/coupons/validate

Validate Coupon

Corpo do pedido:

CampoTipoObrigatorioDescricao
codestringSimCode
order_amountobjectSimOrder 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.