Fidelidade

O programa de fidelidade: regras, recompensas, membros e resgates.

Valores dos exemplos

Digite uma vez e todos os exemplos desta página passam a usá-los. A chave de API fica só nesta página e nunca é guardada.

GET/v1/loyalty/companies/{companyId}

Os cartões de fidelidade dos contatos de uma empresa.

Ler/companies/{companyId}Em caso de sucesso: 200.Permissão: Ler.

Parâmetros do caminho

CampoTipoObrigatórioObservações
companyIdstringSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/companies/{companyId}" \
  -H "X-Api-Key: fmd_..."

GET/v1/loyalty/contacts/{contactId}

O cartão de um contato: se é membro, saldo, nível, histórico e resgates.

Ler/contacts/{contactId}Em caso de sucesso: 200.Permissão: Ler.

Parâmetros do caminho

CampoTipoObrigatórioObservações
contactIdstringSim

Resposta

78 campos
CampoTipoSempre presente
memberobject | nullSim
member.balanceintegerSim
member.cardUrlstring (uri)Sim
member.contactIdstring (uuid)Sim
member.createdAtstring (date-time)Sim
member.currencystringSim
member.idstring (uuid)Sim
member.lastActivityAtstring (date-time)Sim
member.lifetimePointsintegerSim
member.nextTierobject | nullSim
member.nextTier.namestringSim
member.nextTier.pointsToGointegerSim
member.purchasesintegerSim
member.spentintegerSim
member.tierobject | nullSim
member.tier.indexintegerSim
member.tier.namestringSim
programobjectSim
program.activebooleanSim
program.autoEnrollbooleanSim
program.currencystringSim
program.eventRulesarray of objectSim
program.eventRules[].eventstringSim
program.eventRules[].perDayintegerSim
program.eventRules[].pointsintegerSim
program.expirationMonthsinteger | nullSim
program.minPurchaseAmountintegerSim
program.namestring | nullSim
program.organizationIdstring (uuid)Sim
program.pointsLabelstring | nullSim
program.pointsPerPurchaseintegerSim
program.pointsPerUnitintegerSim
program.selfRedeembooleanSim
program.sourcesobjectSim
program.sources.invoicesbooleanSim
program.sources.manualPaymentsbooleanSim
program.sources.paymentsbooleanSim
program.termsstring | nullSim
program.tiersarray of objectSim
program.tiers[].minPointsintegerSim
program.tiers[].multiplierPercentintegerSim
program.tiers[].namestringSim
program.unitAmountintegerSim
program.updatedAtstring (date-time)Sim
program.welcomePointsintegerSim
redemptionsarray of objectSim
redemptions[].canceledAtstring | null (date-time)Sim
redemptions[].codestringSim
redemptions[].createdAtstring (date-time)Sim
redemptions[].createdBynull nos exemplosSim
redemptions[].fulfilledAtnull nos exemplosSim
redemptions[].fulfilledBynull nos exemplosSim
redemptions[].idstring (uuid)Sim
redemptions[].memberIdstring (uuid)Sim
redemptions[].organizationIdstring (uuid)Sim
redemptions[].pointsintegerSim
redemptions[].rewardobjectSim
redemptions[].reward.currencystringSim
redemptions[].reward.kindstringSim
redemptions[].reward.namestringSim
redemptions[].reward.valuenull nos exemplosSim
redemptions[].rewardIdstring (uuid)Sim
redemptions[].sourcestringSim
redemptions[].statusstringSim
transactionsarray of objectSim
transactions[].amountinteger | nullSim
transactions[].createdAtstring (date-time)Sim
transactions[].createdBystring | null (uuid)Sim
transactions[].currencystring | nullSim
transactions[].idstring (uuid)Sim
transactions[].kindstringSim
transactions[].memberIdstring (uuid)Sim
transactions[].notestring | nullSim
transactions[].organizationIdstring (uuid)Sim
transactions[].pointsintegerSim
transactions[].reversedAtstring | null (date-time)Sim
transactions[].sourcestringSim
transactions[].sourceKeystring | nullSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/contacts/{contactId}" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "member": {
    "balance": 1,
    "cardUrl": "https://example.com",
    "contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "createdAt": "2026-11-21T14:00:00.000Z",
    "currency": "USD",
    "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "lastActivityAt": "2026-11-21T14:00:00.000Z",
    "lifetimePoints": 1,
    "nextTier": {
      "name": "Ana Lima",
      "pointsToGo": 1
    },
    "purchases": 1,
    "spent": 1,
    "tier": {
      "index": 1,
      "name": "Ana Lima"
    }
  },
  "program": {
    "active": true,
    "autoEnroll": true,
    "currency": "USD",
    "eventRules": [
      {}
    ],
    "expirationMonths": 1,
    "minPurchaseAmount": 1,
    "name": "Ana Lima",
    "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "pointsLabel": "…",
    "pointsPerPurchase": 1,
    "pointsPerUnit": 1,
    "selfRedeem": true,
    "sources": {
      "invoices": true,
      "manualPayments": true,
      "payments": true
    },
    "terms": "…",
    "tiers": [
      {}
    ],
    "unitAmount": 1,
    "updatedAt": "2026-11-21T14:00:00.000Z",
    "welcomePoints": 1
  },
  "redemptions": [
    {
      "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "reward": {},
      "points": 1,
      "code": "…",
      "status": "…",
      "source": "…",
      "createdBy": null,
      "fulfilledAt": null,
      "fulfilledBy": null,
      "canceledAt": "2026-11-21T14:00:00.000Z",
      "createdAt": "2026-11-21T14:00:00.000Z"
    }
  ],
  "transactions": [
    {
      "amount": 1,
      "createdAt": "2026-11-21T14:00:00.000Z",
      "createdBy": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "currency": "USD",
      "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "kind": "…",
      "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "note": "…",
      "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "points": 1,
      "reversedAt": "2026-11-21T14:00:00.000Z",
      "source": "…",
      "sourceKey": "…"
    }
  ]
}

POST/v1/loyalty/contacts/{contactId}/adjust

Adiciona ou tira pontos à mão, com o motivo.

Atualizar/contacts/{contactId}/adjustEm caso de sucesso: 200.Permissão: Atualizar.

Parâmetros do caminho

CampoTipoObrigatórioObservações
contactIdstringSim

Corpo

CampoTipoObrigatórioObservações
pointsintegerSimmin -10000000 · max 10000000
notestringSimmin length 1 · max length 500

Resposta

55 campos
CampoTipoSempre presente
memberobjectSim
member.balanceintegerSim
member.cardUrlstring (uri)Sim
member.contactIdstring (uuid)Sim
member.createdAtstring (date-time)Sim
member.currencystringSim
member.idstring (uuid)Sim
member.lastActivityAtstring (date-time)Sim
member.lifetimePointsintegerSim
member.nextTierobjectSim
member.nextTier.namestringSim
member.nextTier.pointsToGointegerSim
member.purchasesintegerSim
member.spentintegerSim
member.tiernull nos exemplosSim
programobjectSim
program.activebooleanSim
program.autoEnrollbooleanSim
program.currencystringSim
program.eventRulesarray of anySim
program.expirationMonthsnull nos exemplosSim
program.minPurchaseAmountintegerSim
program.namestringSim
program.organizationIdstring (uuid)Sim
program.pointsLabelstringSim
program.pointsPerPurchaseintegerSim
program.pointsPerUnitintegerSim
program.selfRedeembooleanSim
program.sourcesobjectSim
program.sources.invoicesbooleanSim
program.sources.manualPaymentsbooleanSim
program.sources.paymentsbooleanSim
program.termsstringSim
program.tiersarray of objectSim
program.tiers[].minPointsintegerSim
program.tiers[].multiplierPercentintegerSim
program.tiers[].namestringSim
program.unitAmountintegerSim
program.updatedAtstring (date-time)Sim
program.welcomePointsintegerSim
redemptionsarray of anySim
transactionsarray of objectSim
transactions[].amountnull nos exemplosSim
transactions[].createdAtstring (date-time)Sim
transactions[].createdBystring (uuid)Sim
transactions[].currencynull nos exemplosSim
transactions[].idstring (uuid)Sim
transactions[].kindstringSim
transactions[].memberIdstring (uuid)Sim
transactions[].notestring | nullSim
transactions[].organizationIdstring (uuid)Sim
transactions[].pointsintegerSim
transactions[].reversedAtnull nos exemplosSim
transactions[].sourcestringSim
transactions[].sourceKeystring | nullSim
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust" \
  -H "X-Api-Key: fmd_..." \
  -H "Content-Type: application/json" \
  -d '{
  "points": -10000000,
  "note": "…"
}'

Resposta (200), com valores de exemplo:

{
  "program": {
    "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "active": true,
    "name": "Ana Lima",
    "pointsLabel": "…",
    "currency": "USD",
    "pointsPerPurchase": 1,
    "pointsPerUnit": 1,
    "unitAmount": 1,
    "minPurchaseAmount": 1,
    "welcomePoints": 1,
    "expirationMonths": null,
    "tiers": [
      {}
    ],
    "eventRules": [],
    "sources": {
      "invoices": true,
      "payments": true,
      "manualPayments": true
    },
    "autoEnroll": true,
    "selfRedeem": true,
    "terms": "…",
    "updatedAt": "2026-11-21T14:00:00.000Z"
  },
  "member": {
    "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "balance": 1,
    "lifetimePoints": 1,
    "purchases": 1,
    "spent": 1,
    "currency": "USD",
    "tier": null,
    "nextTier": {
      "name": "Ana Lima",
      "pointsToGo": 1
    },
    "cardUrl": "https://example.com",
    "lastActivityAt": "2026-11-21T14:00:00.000Z",
    "createdAt": "2026-11-21T14:00:00.000Z"
  },
  "transactions": [
    {
      "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "kind": "…",
      "points": 1,
      "source": "…",
      "sourceKey": "…",
      "amount": null,
      "currency": null,
      "note": "…",
      "reversedAt": null,
      "createdBy": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "createdAt": "2026-11-21T14:00:00.000Z"
    }
  ],
  "redemptions": []
}

POST/v1/loyalty/contacts/{contactId}/enroll

Torna um contato membro, com os pontos de boas-vindas.

Criar/contacts/{contactId}/enrollEm caso de sucesso: 200.Permissão: Criar.

Parâmetros do caminho

CampoTipoObrigatórioObservações
contactIdstringSim
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll" \
  -H "X-Api-Key: fmd_..."

POST/v1/loyalty/contacts/{contactId}/send

Envia ao contato o link do cartão por e-mail.

Atualizar/contacts/{contactId}/sendEm caso de sucesso: 200.Permissão: Atualizar.

Parâmetros do caminho

CampoTipoObrigatórioObservações
contactIdstringSim

Corpo

CampoTipoObrigatórioObservações
emailstring (email)Nãomax length 320
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/contacts/{contactId}/send" \
  -H "X-Api-Key: fmd_..." \
  -H "Content-Type: application/json" \
  -d '{
  "email": "[email protected]"
}'

GET/v1/loyalty/members

Lista os membros com saldo e nível.

Ler/membersEm caso de sucesso: 200.Permissão: Ler.

Parâmetros da consulta

CampoTipoObrigatórioObservações
qstringNãomax length 100
pageintegerNãomin 1 · default 1
pageSizeintegerNãomin 1 · max 100 · default 25
sort"balance" | "lifetimePoints" | "lastActivityAt" | "createdAt"Nãodefault "balance"

Resposta

4 campos
CampoTipoSempre presente
dataarray of anySim
pageintegerSim
pageSizeintegerSim
totalintegerSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/members" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "data": [],
  "page": 1,
  "pageSize": 1,
  "total": 1
}

GET/v1/loyalty/overview

Os números do programa: membros, pontos dados e gastos, resgates.

Ler/overviewEm caso de sucesso: 200.Permissão: Ler.

Resposta

37 campos
CampoTipoSempre presente
last30objectSim
last30.earnedintegerSim
last30.expiredintegerSim
last30.redeemedintegerSim
membersintegerSim
outstandingintegerSim
pendingRedemptionsintegerSim
programobjectSim
program.activebooleanSim
program.autoEnrollbooleanSim
program.currencystringSim
program.eventRulesarray of anySim
program.expirationMonthsnull nos exemplosSim
program.minPurchaseAmountintegerSim
program.namestringSim
program.organizationIdstring (uuid)Sim
program.pointsLabelstringSim
program.pointsPerPurchaseintegerSim
program.pointsPerUnitintegerSim
program.selfRedeembooleanSim
program.sourcesobjectSim
program.sources.invoicesbooleanSim
program.sources.manualPaymentsbooleanSim
program.sources.paymentsbooleanSim
program.termsstringSim
program.tiersarray of objectSim
program.tiers[].minPointsintegerSim
program.tiers[].multiplierPercentintegerSim
program.tiers[].namestringSim
program.unitAmountintegerSim
program.updatedAtstring (date-time)Sim
program.welcomePointsintegerSim
spentintegerSim
topRewardsarray of objectSim
topRewards[].namestringSim
topRewards[].rewardIdstring (uuid)Sim
topRewards[].totalintegerSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/overview" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "program": {
    "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "active": true,
    "name": "Ana Lima",
    "pointsLabel": "…",
    "currency": "USD",
    "pointsPerPurchase": 1,
    "pointsPerUnit": 1,
    "unitAmount": 1,
    "minPurchaseAmount": 1,
    "welcomePoints": 1,
    "expirationMonths": null,
    "tiers": [
      {}
    ],
    "eventRules": [],
    "sources": {
      "invoices": true,
      "payments": true,
      "manualPayments": true
    },
    "autoEnroll": true,
    "selfRedeem": true,
    "terms": "…",
    "updatedAt": "2026-11-21T14:00:00.000Z"
  },
  "members": 1,
  "outstanding": 1,
  "spent": 1,
  "last30": {
    "earned": 1,
    "redeemed": 1,
    "expired": 1
  },
  "pendingRedemptions": 1,
  "topRewards": [
    {
      "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "name": "Ana Lima",
      "total": 1
    }
  ]
}

GET/v1/loyalty/program

As regras do programa: como as compras rendem pontos, níveis e expiração.

Ler/programEm caso de sucesso: 200.Permissão: Ler.

Resposta

21 campos
CampoTipoSempre presente
activebooleanSim
autoEnrollbooleanSim
currencystringSim
eventRulesarray of anySim
expirationMonthsnull nos exemplosSim
minPurchaseAmountintegerSim
namenull nos exemplosSim
organizationIdstring (uuid)Sim
pointsLabelnull nos exemplosSim
pointsPerPurchaseintegerSim
pointsPerUnitintegerSim
selfRedeembooleanSim
sourcesobjectSim
sources.invoicesbooleanSim
sources.manualPaymentsbooleanSim
sources.paymentsbooleanSim
termsnull nos exemplosSim
tiersarray of anySim
unitAmountintegerSim
updatedAtstring (date-time)Sim
welcomePointsintegerSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/program" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "active": true,
  "name": null,
  "pointsLabel": null,
  "currency": "USD",
  "pointsPerPurchase": 1,
  "pointsPerUnit": 1,
  "unitAmount": 1,
  "minPurchaseAmount": 1,
  "welcomePoints": 1,
  "expirationMonths": null,
  "tiers": [],
  "eventRules": [],
  "sources": {
    "payments": true,
    "invoices": true,
    "manualPayments": true
  },
  "autoEnroll": true,
  "selfRedeem": true,
  "terms": null,
  "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "updatedAt": "2026-11-21T14:00:00.000Z"
}

PUT/v1/loyalty/program

Salva as regras do programa (administradores).

Atualizar/programEm caso de sucesso: 200.Permissão: Atualizar.

Corpo

CampoTipoObrigatórioObservações
activebooleanSim
namestring | nullNão
pointsLabelstring | nullNão
currencystringSimpattern ^[A-Z]{3}$
pointsPerPurchaseintegerSimmin 0 · max 1000000
pointsPerUnitintegerSimmin 0 · max 1000000
unitAmountintegerSimmin 1 · max 1000000000000
minPurchaseAmountintegerSimmin 0 · max 1000000000000
welcomePointsintegerSimmin 0 · max 1000000
expirationMonthsinteger | nullSim
tiersarray of objectSimmax items 5
tiers[].namestringSimmin length 1 · max length 40
tiers[].minPointsintegerSimmin 0 · max 1000000000
tiers[].multiplierPercentintegerNãomin 100 · max 1000 · default 100
eventRulesarray of objectNãomax items 10
eventRules[].eventstringSim
eventRules[].pointsintegerSimmin 1 · max 1000000
eventRules[].perDayinteger | nullNãodefault null
sourcesobjectSim
sources.paymentsbooleanSim
sources.invoicesbooleanSim
sources.manualPaymentsbooleanSim
autoEnrollbooleanSim
selfRedeembooleanSim
termsstring | nullNão

Resposta

27 campos
CampoTipoSempre presente
activebooleanSim
autoEnrollbooleanSim
currencystringSim
eventRulesarray of objectSim
eventRules[].eventstringSim
eventRules[].perDayintegerSim
eventRules[].pointsintegerSim
expirationMonthsnull nos exemplosSim
minPurchaseAmountintegerSim
namestring | nullSim
organizationIdstring (uuid)Sim
pointsLabelstring | nullSim
pointsPerPurchaseintegerSim
pointsPerUnitintegerSim
selfRedeembooleanSim
sourcesobjectSim
sources.invoicesbooleanSim
sources.manualPaymentsbooleanSim
sources.paymentsbooleanSim
termsstring | nullSim
tiersarray of objectSim
tiers[].minPointsintegerSim
tiers[].multiplierPercentintegerSim
tiers[].namestringSim
unitAmountintegerSim
updatedAtstring (date-time)Sim
welcomePointsintegerSim
Exemplo
curl -X PUT "https://api.firmado.app/v1/loyalty/program" \
  -H "X-Api-Key: fmd_..." \
  -H "Content-Type: application/json" \
  -d '{
  "active": true,
  "currency": "USD",
  "pointsPerPurchase": 0,
  "pointsPerUnit": 0,
  "unitAmount": 1,
  "minPurchaseAmount": 0,
  "welcomePoints": 0,
  "expirationMonths": 1,
  "tiers": [
    {
      "name": "Ana Lima",
      "minPoints": 0,
      "multiplierPercent": 100
    }
  ],
  "sources": {
    "payments": true,
    "invoices": true,
    "manualPayments": true
  },
  "autoEnroll": true,
  "selfRedeem": true
}'

Resposta (200), com valores de exemplo:

{
  "active": true,
  "autoEnroll": true,
  "currency": "USD",
  "eventRules": [
    {
      "event": "…",
      "perDay": 1,
      "points": 1
    }
  ],
  "expirationMonths": null,
  "minPurchaseAmount": 1,
  "name": "Ana Lima",
  "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "pointsLabel": "…",
  "pointsPerPurchase": 1,
  "pointsPerUnit": 1,
  "selfRedeem": true,
  "sources": {
    "invoices": true,
    "manualPayments": true,
    "payments": true
  },
  "terms": "…",
  "tiers": [
    {
      "name": "Ana Lima",
      "minPoints": 1,
      "multiplierPercent": 1
    }
  ],
  "unitAmount": 1,
  "updatedAt": "2026-11-21T14:00:00.000Z",
  "welcomePoints": 1
}

GET/v1/loyalty/redemptions

Lista as recompensas resgatadas, por status.

Ler/redemptionsEm caso de sucesso: 200.Permissão: Ler.

Parâmetros da consulta

CampoTipoObrigatórioObservações
status"pending" | "fulfilled" | "canceled"Não
codestringNãomax length 20
contactIdstring (uuid)Não
pageintegerNãomin 1 · default 1
pageSizeintegerNãomin 1 · max 100 · default 25

Resposta

24 campos
CampoTipoSempre presente
dataarray of objectSim
data[].canceledAtnull nos exemplosSim
data[].codestringSim
data[].contactIdstring (uuid)Sim
data[].createdAtstring (date-time)Sim
data[].createdBynull nos exemplosSim
data[].fulfilledAtnull nos exemplosSim
data[].fulfilledBynull nos exemplosSim
data[].idstring (uuid)Sim
data[].memberIdstring (uuid)Sim
data[].namestringSim
data[].organizationIdstring (uuid)Sim
data[].pointsintegerSim
data[].rewardobjectSim
data[].reward.currencystringSim
data[].reward.kindstringSim
data[].reward.namestringSim
data[].reward.valuenull nos exemplosSim
data[].rewardIdstring (uuid)Sim
data[].sourcestringSim
data[].statusstringSim
pageintegerSim
pageSizeintegerSim
totalintegerSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/redemptions" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "data": [
    {
      "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "reward": {},
      "points": 1,
      "code": "…",
      "status": "…",
      "source": "…",
      "createdBy": null,
      "fulfilledAt": null,
      "fulfilledBy": null,
      "canceledAt": null,
      "createdAt": "2026-11-21T14:00:00.000Z",
      "contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
      "name": "Ana Lima"
    }
  ],
  "page": 1,
  "pageSize": 1,
  "total": 1
}

POST/v1/loyalty/redemptions

Resgata uma recompensa para um contato, gastando seus pontos.

Criar/redemptionsEm caso de sucesso: 201.Permissão: Criar.

Corpo

CampoTipoObrigatórioObservações
contactIdstring (uuid)Sim
rewardIdstring (uuid)Sim

Resposta

18 campos
CampoTipoSempre presente
canceledAtnull nos exemplosSim
codestringSim
createdAtstring (date-time)Sim
createdBystring (uuid)Sim
fulfilledAtnull nos exemplosSim
fulfilledBynull nos exemplosSim
idstring (uuid)Sim
memberIdstring (uuid)Sim
organizationIdstring (uuid)Sim
pointsintegerSim
rewardobjectSim
reward.currencystringSim
reward.kindstringSim
reward.namestringSim
reward.valuenull nos exemplosSim
rewardIdstring (uuid)Sim
sourcestringSim
statusstringSim
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions" \
  -H "X-Api-Key: fmd_..." \
  -H "Content-Type: application/json" \
  -d '{
  "contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}'

Resposta (201), com valores de exemplo:

{
  "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "reward": {
    "kind": "…",
    "name": "Ana Lima",
    "value": null,
    "currency": "USD"
  },
  "points": 1,
  "code": "…",
  "status": "…",
  "source": "…",
  "createdBy": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "fulfilledAt": null,
  "fulfilledBy": null,
  "canceledAt": null,
  "createdAt": "2026-11-21T14:00:00.000Z"
}

POST/v1/loyalty/redemptions/{id}/cancel

Cancela uma recompensa não entregue; os pontos voltam.

Atualizar/redemptions/{id}/cancelEm caso de sucesso: 200.Permissão: Atualizar.

Parâmetros do caminho

CampoTipoObrigatórioObservações
idstringSim

Resposta

18 campos
CampoTipoSempre presente
canceledAtstring (date-time)Sim
codestringSim
createdAtstring (date-time)Sim
createdBynull nos exemplosSim
fulfilledAtnull nos exemplosSim
fulfilledBynull nos exemplosSim
idstring (uuid)Sim
memberIdstring (uuid)Sim
organizationIdstring (uuid)Sim
pointsintegerSim
rewardobjectSim
reward.currencystringSim
reward.kindstringSim
reward.namestringSim
reward.valuenull nos exemplosSim
rewardIdstring (uuid)Sim
sourcestringSim
statusstringSim
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "reward": {
    "kind": "…",
    "name": "Ana Lima",
    "value": null,
    "currency": "USD"
  },
  "points": 1,
  "code": "…",
  "status": "…",
  "source": "…",
  "createdBy": null,
  "fulfilledAt": null,
  "fulfilledBy": null,
  "canceledAt": "2026-11-21T14:00:00.000Z",
  "createdAt": "2026-11-21T14:00:00.000Z"
}

POST/v1/loyalty/redemptions/{id}/fulfill

Marca uma recompensa como entregue.

Atualizar/redemptions/{id}/fulfillEm caso de sucesso: 200.Permissão: Atualizar.

Parâmetros do caminho

CampoTipoObrigatórioObservações
idstringSim

Resposta

18 campos
CampoTipoSempre presente
canceledAtnull nos exemplosSim
codestringSim
createdAtstring (date-time)Sim
createdBystring (uuid)Sim
fulfilledAtstring (date-time)Sim
fulfilledBystring (uuid)Sim
idstring (uuid)Sim
memberIdstring (uuid)Sim
organizationIdstring (uuid)Sim
pointsintegerSim
rewardobjectSim
reward.currencystringSim
reward.kindstringSim
reward.namestringSim
reward.valuenull nos exemplosSim
rewardIdstring (uuid)Sim
sourcestringSim
statusstringSim
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

{
  "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "memberId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "reward": {
    "kind": "…",
    "name": "Ana Lima",
    "value": null,
    "currency": "USD"
  },
  "points": 1,
  "code": "…",
  "status": "…",
  "source": "…",
  "createdBy": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "fulfilledAt": "2026-11-21T14:00:00.000Z",
  "fulfilledBy": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "canceledAt": null,
  "createdAt": "2026-11-21T14:00:00.000Z"
}

GET/v1/loyalty/rewards

Lista as recompensas que os membros podem resgatar.

Ler/rewardsEm caso de sucesso: 200.Permissão: Ler.

Resposta

14 campos
CampoTipoSempre presente
[].activebooleanSim
[].costintegerSim
[].createdAtstring (date-time)Sim
[].descriptionnull nos exemplosSim
[].idstring (uuid)Sim
[].kindstringSim
[].minTiernull nos exemplosSim
[].namestringSim
[].organizationIdstring (uuid)Sim
[].perMemberinteger | nullSim
[].positionintegerSim
[].stockinteger | nullSim
[].updatedAtstring (date-time)Sim
[].valueinteger | nullSim
Exemplo
curl -X GET "https://api.firmado.app/v1/loyalty/rewards" \
  -H "X-Api-Key: fmd_..."

Resposta (200), com valores de exemplo:

[
  {
    "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
    "name": "Ana Lima",
    "description": null,
    "kind": "…",
    "value": 1,
    "cost": 1,
    "stock": 1,
    "perMember": 1,
    "minTier": null,
    "active": true,
    "position": 1,
    "createdAt": "2026-11-21T14:00:00.000Z",
    "updatedAt": "2026-11-21T14:00:00.000Z"
  }
]

POST/v1/loyalty/rewards

Cria uma recompensa: um item, um desconto ou cashback, e seus pontos.

Criar/rewardsEm caso de sucesso: 201.Permissão: Criar.

Corpo

CampoTipoObrigatórioObservações
namestringSimmin length 1 · max length 120
descriptionstring | nullNão
kind"item" | "discount_percent" | "discount_amount" | "cashback"Sim
valueinteger | nullNão
costintegerSimmin 1 · max 1000000000
stockinteger | nullNão
perMemberinteger | nullNão
minTierinteger | nullNão
activebooleanNãodefault true
positionintegerNãomin 0 · max 1000 · default 0

Resposta

14 campos
CampoTipoSempre presente
activebooleanSim
costintegerSim
createdAtstring (date-time)Sim
descriptionnull nos exemplosSim
idstring (uuid)Sim
kindstringSim
minTiernull nos exemplosSim
namestringSim
organizationIdstring (uuid)Sim
perMemberinteger | nullSim
positionintegerSim
stockinteger | nullSim
updatedAtstring (date-time)Sim
valueinteger | nullSim
Exemplo
curl -X POST "https://api.firmado.app/v1/loyalty/rewards" \
  -H "X-Api-Key: fmd_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ana Lima",
  "kind": "item",
  "cost": 1,
  "description": "…"
}'

Resposta (201), com valores de exemplo:

{
  "id": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "organizationId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
  "name": "Ana Lima",
  "description": null,
  "kind": "…",
  "value": 1,
  "cost": 1,
  "stock": 1,
  "perMember": 1,
  "minTier": null,
  "active": true,
  "position": 1,
  "createdAt": "2026-11-21T14:00:00.000Z",
  "updatedAt": "2026-11-21T14:00:00.000Z"
}

DELETE/v1/loyalty/rewards/{id}

Exclui uma recompensa; os resgates já feitos continuam.

Excluir/rewards/{id}Em caso de sucesso: 204.Permissão: Excluir.

Parâmetros do caminho

CampoTipoObrigatórioObservações
idstringSim
Exemplo
curl -X DELETE "https://api.firmado.app/v1/loyalty/rewards/{id}" \
  -H "X-Api-Key: fmd_..."

PUT/v1/loyalty/rewards/{id}

Altera uma recompensa.

Atualizar/rewards/{id}Em caso de sucesso: 200.Permissão: Atualizar.

Parâmetros do caminho

CampoTipoObrigatórioObservações
idstringSim

Corpo

CampoTipoObrigatórioObservações
namestringSimmin length 1 · max length 120
descriptionstring | nullNão
kind"item" | "discount_percent" | "discount_amount" | "cashback"Sim
valueinteger | nullNão
costintegerSimmin 1 · max 1000000000
stockinteger | nullNão
perMemberinteger | nullNão
minTierinteger | nullNão
activebooleanNãodefault true
positionintegerNãomin 0 · max 1000 · default 0
Exemplo
curl -X PUT "https://api.firmado.app/v1/loyalty/rewards/{id}" \
  -H "X-Api-Key: fmd_..." \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Ana Lima",
  "kind": "item",
  "cost": 1,
  "description": "…"
}'

Eventos de webhook

Mudanças desta funcionalidade que os webhooks podem enviar.

  • loyalty_program.updatedAtualizar
  • loyalty_member.joinedCriar
  • loyalty.points_changedAtualizar
  • loyalty_reward.createdCriar
  • loyalty_reward.updatedAtualizar
  • loyalty_reward.deletedExcluir
  • loyalty_redemption.createdCriar
  • loyalty_redemption.updatedAtualizar