Skip to main content
POST
/
organizations
/
{organizationId}
/
vouchers
Criar Voucher
curl --request POST \
  --url https://api.example.com/organizations/{organizationId}/vouchers \
  --header 'Authorization: <authorization>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "amount": 123,
  "organizationId": "<string>",
  "effectiveAt": "<string>",
  "expiresAt": "<string>",
  "feeIds": [
    {}
  ]
}
'
{
  "voucherId": "019525fd-e4b8-7cb0-b8d4-0e2f4a6c8d0a",
  "organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
  "externalRef": null,
  "name": "Onboarding Credit",
  "amount": 50000,
  "currency": "BRL",
  "effectiveAt": "2026-04-01T00:00:00.000Z",
  "expiresAt": "2026-09-30T23:59:59.000Z",
  "amountRedeemed": 0,
  "status": "PENDING",
  "createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
  "createdAt": "2026-03-25T14:00:00.000Z",
  "updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
  "updatedAt": "2026-03-25T14:00:00.000Z",
  "deletedBy": null,
  "deletedAt": null
}
Requer permissao voucher:write.

Headers

Authorization
string
required
Bearer token.

Parametros de Path

organizationId
string
required
UUID da organizacao.

Corpo da Requisicao

name
string
required
Nome do voucher. Max 255 caracteres.
amount
integer
required
Valor do credito em centavos.
organizationId
string
required
UUID da organizacao.
effectiveAt
string
Data ISO 8601 quando o voucher se torna ativo.
expiresAt
string
Data de expiracao ISO 8601.
feeIds
array
IDs de taxas para restringir o credito.

Resposta

voucherId
string
UUID do voucher.
organizationId
string
UUID da organizacao.
externalRef
string
Referencia externa.
name
string
Nome do voucher.
amount
integer
Valor do credito em centavos.
currency
string
Codigo da moeda.
effectiveAt
string
Data de vigencia.
expiresAt
string
Data de expiracao.
amountRedeemed
integer
Valor resgatado em centavos.
status
string
Status do voucher.
createdBy
string
Identificador do criador.
createdAt
string
Timestamp de criacao.
updatedBy
string
Identificador do ultimo atualizador.
updatedAt
string
Timestamp da ultima atualizacao.
deletedBy
string
Deleter identifier.
deletedAt
string
Deletion timestamp.
{
  "voucherId": "019525fd-e4b8-7cb0-b8d4-0e2f4a6c8d0a",
  "organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
  "externalRef": null,
  "name": "Onboarding Credit",
  "amount": 50000,
  "currency": "BRL",
  "effectiveAt": "2026-04-01T00:00:00.000Z",
  "expiresAt": "2026-09-30T23:59:59.000Z",
  "amountRedeemed": 0,
  "status": "PENDING",
  "createdBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
  "createdAt": "2026-03-25T14:00:00.000Z",
  "updatedBy": "019525fd-56a8-7db4-8c3e-2a1b4d6f8e0c",
  "updatedAt": "2026-03-25T14:00:00.000Z",
  "deletedBy": null,
  "deletedAt": null
}

Exemplos de Codigo

curl -X POST https://api.awsales.io/admin/organizations/019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2/vouchers \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Onboarding Credit",
  "amount": 50000,
  "organizationId": "019525fd-4c38-7e30-a5c1-b6e3f4d8a9c2",
  "effectiveAt": "2026-02-01T00:00:00.000Z",
  "expiresAt": "2026-08-01T00:00:00.000Z"
}'

Codigos de Erro

StatusCodigoDescricao
400validation_errorEntrada invalida ou campos obrigatorios ausentes
401unauthorizedAutenticacao ausente ou invalida
403forbiddenPermissoes insuficientes
404organization.not_foundOrganizacao nao encontrada
500internal_server_errorOcorreu um erro inesperado