Skip to main content
GET
/
coupons
/
{code}
/
availability
Verificar Disponibilidade do Cupom
curl --request GET \
  --url https://api.example.com/coupons/{code}/availability \
  --header 'Authorization: <authorization>'
{
  "coupon": {
    "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": { "available": true }
}
Requer permissao coupon:read.

Headers

Authorization
string
required
Bearer token.

Parametros de Path

code
string
required
Codigo do cupom.

Resposta

coupon
object
Coupon details.
meta
object
Availability metadata.
{
  "coupon": {
    "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": { "available": true }
}

Exemplos de Codigo

curl https://api.awsales.io/admin/coupons/WELCOME20/availability \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Use this endpoint to verify a coupon code is valid and has remaining redemptions before attempting to attach it to a subscription.

Codigos de Erro

StatusCodigoDescricao
400validation_errorEntrada invalida ou campos obrigatorios ausentes
401unauthorizedAutenticacao ausente ou invalida
403forbiddenPermissoes insuficientes
404coupon.not_foundCupom nao encontrado
500internal_server_errorOcorreu um erro inesperado