curl --request GET \
--url https://api.example.com/coupons \
--header 'Authorization: <authorization>'{
"data": [
{
"couponId": "019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f",
"externalRef": null,
"code": "WELCOME10",
"name": "Welcome Discount",
"type": "PERCENTAGE",
"amount": 10,
"currency": "BRL",
"duration": "ONCE",
"durationInMonths": null,
"maxRedemptions": 100,
"redeemBy": null,
"timesRedeemed": 25,
"amountRedeemed": 12500,
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-01-01T00:00:00.000Z",
"deletedBy": null,
"deletedAt": null
}
],
"meta": { "page": 1, "limit": 20, "totalItems": 10, "totalPages": 1 }
}
Recuperar uma lista paginada de todos os cupons com opcoes de filtragem e ordenacao.
curl --request GET \
--url https://api.example.com/coupons \
--header 'Authorization: <authorization>'{
"data": [
{
"couponId": "019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f",
"externalRef": null,
"code": "WELCOME10",
"name": "Welcome Discount",
"type": "PERCENTAGE",
"amount": 10,
"currency": "BRL",
"duration": "ONCE",
"durationInMonths": null,
"maxRedemptions": 100,
"redeemBy": null,
"timesRedeemed": 25,
"amountRedeemed": 12500,
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-01-01T00:00:00.000Z",
"deletedBy": null,
"deletedAt": null
}
],
"meta": { "page": 1, "limit": 20, "totalItems": 10, "totalPages": 1 }
}
coupon:read.Show propriedades do cupom
{
"data": [
{
"couponId": "019525fd-d3a4-7baf-a7c3-9d1e3f5b7c9f",
"externalRef": null,
"code": "WELCOME10",
"name": "Welcome Discount",
"type": "PERCENTAGE",
"amount": 10,
"currency": "BRL",
"duration": "ONCE",
"durationInMonths": null,
"maxRedemptions": 100,
"redeemBy": null,
"timesRedeemed": 25,
"amountRedeemed": 12500,
"status": "ACTIVE",
"createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"createdAt": "2026-01-01T00:00:00.000Z",
"updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
"updatedAt": "2026-01-01T00:00:00.000Z",
"deletedBy": null,
"deletedAt": null
}
],
"meta": { "page": 1, "limit": 20, "totalItems": 10, "totalPages": 1 }
}
curl https://api.awsales.io/admin/coupons?page=1&limit=20 \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN"
| Status | Codigo | Descricao |
|---|---|---|
400 | validation_error | Entrada invalida ou campos obrigatorios ausentes |
401 | unauthorized | Autenticacao ausente ou invalida |
403 | forbidden | Permissoes insuficientes |
500 | internal_server_error | Ocorreu um erro inesperado |