Fidélité

Le programme de fidélité : règles, récompenses, membres et échanges.

Valeurs des exemples

Saisissez-les une fois : tous les exemples de cette page les utilisent. La clé d’API reste sur cette page et n’est jamais enregistrée.

GET/v1/loyalty/companies/{companyId}

Les cartes de fidélité des contacts d’une entreprise.

Lire/companies/{companyId}En cas de succès : 200.Permission : Lire.

Paramètres de chemin

ChampTypeObligatoireNotes
companyIdstringOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/companies/{companyId}" \
  -H "X-Api-Key: fmd_..."

GET/v1/loyalty/contacts/{contactId}

La carte d’un contact : membre ou non, solde, niveau, historique et récompenses prises.

Lire/contacts/{contactId}En cas de succès : 200.Permission : Lire.

Paramètres de chemin

ChampTypeObligatoireNotes
contactIdstringOui

Réponse

78 champs
ChampTypeToujours présent
memberobject | nullOui
member.balanceintegerOui
member.cardUrlstring (uri)Oui
member.contactIdstring (uuid)Oui
member.createdAtstring (date-time)Oui
member.currencystringOui
member.idstring (uuid)Oui
member.lastActivityAtstring (date-time)Oui
member.lifetimePointsintegerOui
member.nextTierobject | nullOui
member.nextTier.namestringOui
member.nextTier.pointsToGointegerOui
member.purchasesintegerOui
member.spentintegerOui
member.tierobject | nullOui
member.tier.indexintegerOui
member.tier.namestringOui
programobjectOui
program.activebooleanOui
program.autoEnrollbooleanOui
program.currencystringOui
program.eventRulesarray of objectOui
program.eventRules[].eventstringOui
program.eventRules[].perDayintegerOui
program.eventRules[].pointsintegerOui
program.expirationMonthsinteger | nullOui
program.minPurchaseAmountintegerOui
program.namestring | nullOui
program.organizationIdstring (uuid)Oui
program.pointsLabelstring | nullOui
program.pointsPerPurchaseintegerOui
program.pointsPerUnitintegerOui
program.selfRedeembooleanOui
program.sourcesobjectOui
program.sources.invoicesbooleanOui
program.sources.manualPaymentsbooleanOui
program.sources.paymentsbooleanOui
program.termsstring | nullOui
program.tiersarray of objectOui
program.tiers[].minPointsintegerOui
program.tiers[].multiplierPercentintegerOui
program.tiers[].namestringOui
program.unitAmountintegerOui
program.updatedAtstring (date-time)Oui
program.welcomePointsintegerOui
redemptionsarray of objectOui
redemptions[].canceledAtstring | null (date-time)Oui
redemptions[].codestringOui
redemptions[].createdAtstring (date-time)Oui
redemptions[].createdBynull dans les exemplesOui
redemptions[].fulfilledAtnull dans les exemplesOui
redemptions[].fulfilledBynull dans les exemplesOui
redemptions[].idstring (uuid)Oui
redemptions[].memberIdstring (uuid)Oui
redemptions[].organizationIdstring (uuid)Oui
redemptions[].pointsintegerOui
redemptions[].rewardobjectOui
redemptions[].reward.currencystringOui
redemptions[].reward.kindstringOui
redemptions[].reward.namestringOui
redemptions[].reward.valuenull dans les exemplesOui
redemptions[].rewardIdstring (uuid)Oui
redemptions[].sourcestringOui
redemptions[].statusstringOui
transactionsarray of objectOui
transactions[].amountinteger | nullOui
transactions[].createdAtstring (date-time)Oui
transactions[].createdBystring | null (uuid)Oui
transactions[].currencystring | nullOui
transactions[].idstring (uuid)Oui
transactions[].kindstringOui
transactions[].memberIdstring (uuid)Oui
transactions[].notestring | nullOui
transactions[].organizationIdstring (uuid)Oui
transactions[].pointsintegerOui
transactions[].reversedAtstring | null (date-time)Oui
transactions[].sourcestringOui
transactions[].sourceKeystring | nullOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/contacts/{contactId}" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

{
  "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

Ajoute ou retire des points à la main, avec le motif.

Modifier/contacts/{contactId}/adjustEn cas de succès : 200.Permission : Modifier.

Paramètres de chemin

ChampTypeObligatoireNotes
contactIdstringOui

Corps

ChampTypeObligatoireNotes
pointsintegerOuimin -10000000 · max 10000000
notestringOuimin length 1 · max length 500

Réponse

55 champs
ChampTypeToujours présent
memberobjectOui
member.balanceintegerOui
member.cardUrlstring (uri)Oui
member.contactIdstring (uuid)Oui
member.createdAtstring (date-time)Oui
member.currencystringOui
member.idstring (uuid)Oui
member.lastActivityAtstring (date-time)Oui
member.lifetimePointsintegerOui
member.nextTierobjectOui
member.nextTier.namestringOui
member.nextTier.pointsToGointegerOui
member.purchasesintegerOui
member.spentintegerOui
member.tiernull dans les exemplesOui
programobjectOui
program.activebooleanOui
program.autoEnrollbooleanOui
program.currencystringOui
program.eventRulesarray of anyOui
program.expirationMonthsnull dans les exemplesOui
program.minPurchaseAmountintegerOui
program.namestringOui
program.organizationIdstring (uuid)Oui
program.pointsLabelstringOui
program.pointsPerPurchaseintegerOui
program.pointsPerUnitintegerOui
program.selfRedeembooleanOui
program.sourcesobjectOui
program.sources.invoicesbooleanOui
program.sources.manualPaymentsbooleanOui
program.sources.paymentsbooleanOui
program.termsstringOui
program.tiersarray of objectOui
program.tiers[].minPointsintegerOui
program.tiers[].multiplierPercentintegerOui
program.tiers[].namestringOui
program.unitAmountintegerOui
program.updatedAtstring (date-time)Oui
program.welcomePointsintegerOui
redemptionsarray of anyOui
transactionsarray of objectOui
transactions[].amountnull dans les exemplesOui
transactions[].createdAtstring (date-time)Oui
transactions[].createdBystring (uuid)Oui
transactions[].currencynull dans les exemplesOui
transactions[].idstring (uuid)Oui
transactions[].kindstringOui
transactions[].memberIdstring (uuid)Oui
transactions[].notestring | nullOui
transactions[].organizationIdstring (uuid)Oui
transactions[].pointsintegerOui
transactions[].reversedAtnull dans les exemplesOui
transactions[].sourcestringOui
transactions[].sourceKeystring | nullOui
Exemple
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": "…"
}'

Réponse (200), avec des valeurs d’exemple :

{
  "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

Fait d’un contact un membre, avec les points de bienvenue.

Créer/contacts/{contactId}/enrollEn cas de succès : 200.Permission : Créer.

Paramètres de chemin

ChampTypeObligatoireNotes
contactIdstringOui
Exemple
curl -X POST "https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll" \
  -H "X-Api-Key: fmd_..."

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

Envoie à un contact le lien de sa carte par e-mail.

Modifier/contacts/{contactId}/sendEn cas de succès : 200.Permission : Modifier.

Paramètres de chemin

ChampTypeObligatoireNotes
contactIdstringOui

Corps

ChampTypeObligatoireNotes
emailstring (email)Nonmax length 320
Exemple
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

Liste les membres avec leur solde et leur niveau.

Lire/membersEn cas de succès : 200.Permission : Lire.

Paramètres de requête

ChampTypeObligatoireNotes
qstringNonmax length 100
pageintegerNonmin 1 · default 1
pageSizeintegerNonmin 1 · max 100 · default 25
sort"balance" | "lifetimePoints" | "lastActivityAt" | "createdAt"Nondefault "balance"

Réponse

4 champs
ChampTypeToujours présent
dataarray of anyOui
pageintegerOui
pageSizeintegerOui
totalintegerOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/members" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

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

GET/v1/loyalty/overview

Les chiffres du programme : membres, points donnés et dépensés, récompenses prises.

Lire/overviewEn cas de succès : 200.Permission : Lire.

Réponse

37 champs
ChampTypeToujours présent
last30objectOui
last30.earnedintegerOui
last30.expiredintegerOui
last30.redeemedintegerOui
membersintegerOui
outstandingintegerOui
pendingRedemptionsintegerOui
programobjectOui
program.activebooleanOui
program.autoEnrollbooleanOui
program.currencystringOui
program.eventRulesarray of anyOui
program.expirationMonthsnull dans les exemplesOui
program.minPurchaseAmountintegerOui
program.namestringOui
program.organizationIdstring (uuid)Oui
program.pointsLabelstringOui
program.pointsPerPurchaseintegerOui
program.pointsPerUnitintegerOui
program.selfRedeembooleanOui
program.sourcesobjectOui
program.sources.invoicesbooleanOui
program.sources.manualPaymentsbooleanOui
program.sources.paymentsbooleanOui
program.termsstringOui
program.tiersarray of objectOui
program.tiers[].minPointsintegerOui
program.tiers[].multiplierPercentintegerOui
program.tiers[].namestringOui
program.unitAmountintegerOui
program.updatedAtstring (date-time)Oui
program.welcomePointsintegerOui
spentintegerOui
topRewardsarray of objectOui
topRewards[].namestringOui
topRewards[].rewardIdstring (uuid)Oui
topRewards[].totalintegerOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/overview" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

{
  "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

Les règles du programme : comment les achats rapportent, niveaux et expiration.

Lire/programEn cas de succès : 200.Permission : Lire.

Réponse

21 champs
ChampTypeToujours présent
activebooleanOui
autoEnrollbooleanOui
currencystringOui
eventRulesarray of anyOui
expirationMonthsnull dans les exemplesOui
minPurchaseAmountintegerOui
namenull dans les exemplesOui
organizationIdstring (uuid)Oui
pointsLabelnull dans les exemplesOui
pointsPerPurchaseintegerOui
pointsPerUnitintegerOui
selfRedeembooleanOui
sourcesobjectOui
sources.invoicesbooleanOui
sources.manualPaymentsbooleanOui
sources.paymentsbooleanOui
termsnull dans les exemplesOui
tiersarray of anyOui
unitAmountintegerOui
updatedAtstring (date-time)Oui
welcomePointsintegerOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/program" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

{
  "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

Enregistre les règles du programme (administrateurs).

Modifier/programEn cas de succès : 200.Permission : Modifier.

Corps

ChampTypeObligatoireNotes
activebooleanOui
namestring | nullNon
pointsLabelstring | nullNon
currencystringOuipattern ^[A-Z]{3}$
pointsPerPurchaseintegerOuimin 0 · max 1000000
pointsPerUnitintegerOuimin 0 · max 1000000
unitAmountintegerOuimin 1 · max 1000000000000
minPurchaseAmountintegerOuimin 0 · max 1000000000000
welcomePointsintegerOuimin 0 · max 1000000
expirationMonthsinteger | nullOui
tiersarray of objectOuimax items 5
tiers[].namestringOuimin length 1 · max length 40
tiers[].minPointsintegerOuimin 0 · max 1000000000
tiers[].multiplierPercentintegerNonmin 100 · max 1000 · default 100
eventRulesarray of objectNonmax items 10
eventRules[].eventstringOui
eventRules[].pointsintegerOuimin 1 · max 1000000
eventRules[].perDayinteger | nullNondefault null
sourcesobjectOui
sources.paymentsbooleanOui
sources.invoicesbooleanOui
sources.manualPaymentsbooleanOui
autoEnrollbooleanOui
selfRedeembooleanOui
termsstring | nullNon

Réponse

27 champs
ChampTypeToujours présent
activebooleanOui
autoEnrollbooleanOui
currencystringOui
eventRulesarray of objectOui
eventRules[].eventstringOui
eventRules[].perDayintegerOui
eventRules[].pointsintegerOui
expirationMonthsnull dans les exemplesOui
minPurchaseAmountintegerOui
namestring | nullOui
organizationIdstring (uuid)Oui
pointsLabelstring | nullOui
pointsPerPurchaseintegerOui
pointsPerUnitintegerOui
selfRedeembooleanOui
sourcesobjectOui
sources.invoicesbooleanOui
sources.manualPaymentsbooleanOui
sources.paymentsbooleanOui
termsstring | nullOui
tiersarray of objectOui
tiers[].minPointsintegerOui
tiers[].multiplierPercentintegerOui
tiers[].namestringOui
unitAmountintegerOui
updatedAtstring (date-time)Oui
welcomePointsintegerOui
Exemple
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
}'

Réponse (200), avec des valeurs d’exemple :

{
  "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

Liste les récompenses prises, par statut.

Lire/redemptionsEn cas de succès : 200.Permission : Lire.

Paramètres de requête

ChampTypeObligatoireNotes
status"pending" | "fulfilled" | "canceled"Non
codestringNonmax length 20
contactIdstring (uuid)Non
pageintegerNonmin 1 · default 1
pageSizeintegerNonmin 1 · max 100 · default 25

Réponse

24 champs
ChampTypeToujours présent
dataarray of objectOui
data[].canceledAtnull dans les exemplesOui
data[].codestringOui
data[].contactIdstring (uuid)Oui
data[].createdAtstring (date-time)Oui
data[].createdBynull dans les exemplesOui
data[].fulfilledAtnull dans les exemplesOui
data[].fulfilledBynull dans les exemplesOui
data[].idstring (uuid)Oui
data[].memberIdstring (uuid)Oui
data[].namestringOui
data[].organizationIdstring (uuid)Oui
data[].pointsintegerOui
data[].rewardobjectOui
data[].reward.currencystringOui
data[].reward.kindstringOui
data[].reward.namestringOui
data[].reward.valuenull dans les exemplesOui
data[].rewardIdstring (uuid)Oui
data[].sourcestringOui
data[].statusstringOui
pageintegerOui
pageSizeintegerOui
totalintegerOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/redemptions" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

{
  "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

Prend une récompense pour un contact, avec ses points.

Créer/redemptionsEn cas de succès : 201.Permission : Créer.

Corps

ChampTypeObligatoireNotes
contactIdstring (uuid)Oui
rewardIdstring (uuid)Oui

Réponse

18 champs
ChampTypeToujours présent
canceledAtnull dans les exemplesOui
codestringOui
createdAtstring (date-time)Oui
createdBystring (uuid)Oui
fulfilledAtnull dans les exemplesOui
fulfilledBynull dans les exemplesOui
idstring (uuid)Oui
memberIdstring (uuid)Oui
organizationIdstring (uuid)Oui
pointsintegerOui
rewardobjectOui
reward.currencystringOui
reward.kindstringOui
reward.namestringOui
reward.valuenull dans les exemplesOui
rewardIdstring (uuid)Oui
sourcestringOui
statusstringOui
Exemple
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"
}'

Réponse (201), avec des valeurs d’exemple :

{
  "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

Annule une récompense non remise ; les points reviennent.

Modifier/redemptions/{id}/cancelEn cas de succès : 200.Permission : Modifier.

Paramètres de chemin

ChampTypeObligatoireNotes
idstringOui

Réponse

18 champs
ChampTypeToujours présent
canceledAtstring (date-time)Oui
codestringOui
createdAtstring (date-time)Oui
createdBynull dans les exemplesOui
fulfilledAtnull dans les exemplesOui
fulfilledBynull dans les exemplesOui
idstring (uuid)Oui
memberIdstring (uuid)Oui
organizationIdstring (uuid)Oui
pointsintegerOui
rewardobjectOui
reward.currencystringOui
reward.kindstringOui
reward.namestringOui
reward.valuenull dans les exemplesOui
rewardIdstring (uuid)Oui
sourcestringOui
statusstringOui
Exemple
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

{
  "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

Marque une récompense comme remise.

Modifier/redemptions/{id}/fulfillEn cas de succès : 200.Permission : Modifier.

Paramètres de chemin

ChampTypeObligatoireNotes
idstringOui

Réponse

18 champs
ChampTypeToujours présent
canceledAtnull dans les exemplesOui
codestringOui
createdAtstring (date-time)Oui
createdBystring (uuid)Oui
fulfilledAtstring (date-time)Oui
fulfilledBystring (uuid)Oui
idstring (uuid)Oui
memberIdstring (uuid)Oui
organizationIdstring (uuid)Oui
pointsintegerOui
rewardobjectOui
reward.currencystringOui
reward.kindstringOui
reward.namestringOui
reward.valuenull dans les exemplesOui
rewardIdstring (uuid)Oui
sourcestringOui
statusstringOui
Exemple
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

{
  "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

Liste les récompenses que les membres peuvent prendre.

Lire/rewardsEn cas de succès : 200.Permission : Lire.

Réponse

14 champs
ChampTypeToujours présent
[].activebooleanOui
[].costintegerOui
[].createdAtstring (date-time)Oui
[].descriptionnull dans les exemplesOui
[].idstring (uuid)Oui
[].kindstringOui
[].minTiernull dans les exemplesOui
[].namestringOui
[].organizationIdstring (uuid)Oui
[].perMemberinteger | nullOui
[].positionintegerOui
[].stockinteger | nullOui
[].updatedAtstring (date-time)Oui
[].valueinteger | nullOui
Exemple
curl -X GET "https://api.firmado.app/v1/loyalty/rewards" \
  -H "X-Api-Key: fmd_..."

Réponse (200), avec des valeurs d’exemple :

[
  {
    "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

Crée une récompense : un article, une remise ou du cashback, et ses points.

Créer/rewardsEn cas de succès : 201.Permission : Créer.

Corps

ChampTypeObligatoireNotes
namestringOuimin length 1 · max length 120
descriptionstring | nullNon
kind"item" | "discount_percent" | "discount_amount" | "cashback"Oui
valueinteger | nullNon
costintegerOuimin 1 · max 1000000000
stockinteger | nullNon
perMemberinteger | nullNon
minTierinteger | nullNon
activebooleanNondefault true
positionintegerNonmin 0 · max 1000 · default 0

Réponse

14 champs
ChampTypeToujours présent
activebooleanOui
costintegerOui
createdAtstring (date-time)Oui
descriptionnull dans les exemplesOui
idstring (uuid)Oui
kindstringOui
minTiernull dans les exemplesOui
namestringOui
organizationIdstring (uuid)Oui
perMemberinteger | nullOui
positionintegerOui
stockinteger | nullOui
updatedAtstring (date-time)Oui
valueinteger | nullOui
Exemple
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": "…"
}'

Réponse (201), avec des valeurs d’exemple :

{
  "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}

Supprime une récompense ; celles déjà prises restent.

Supprimer/rewards/{id}En cas de succès : 204.Permission : Supprimer.

Paramètres de chemin

ChampTypeObligatoireNotes
idstringOui
Exemple
curl -X DELETE "https://api.firmado.app/v1/loyalty/rewards/{id}" \
  -H "X-Api-Key: fmd_..."

PUT/v1/loyalty/rewards/{id}

Modifie une récompense.

Modifier/rewards/{id}En cas de succès : 200.Permission : Modifier.

Paramètres de chemin

ChampTypeObligatoireNotes
idstringOui

Corps

ChampTypeObligatoireNotes
namestringOuimin length 1 · max length 120
descriptionstring | nullNon
kind"item" | "discount_percent" | "discount_amount" | "cashback"Oui
valueinteger | nullNon
costintegerOuimin 1 · max 1000000000
stockinteger | nullNon
perMemberinteger | nullNon
minTierinteger | nullNon
activebooleanNondefault true
positionintegerNonmin 0 · max 1000 · default 0
Exemple
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": "…"
}'

Événements de webhook

Les changements de cette fonctionnalité que les webhooks peuvent envoyer.

  • loyalty_program.updatedModifier
  • loyalty_member.joinedCréer
  • loyalty.points_changedModifier
  • loyalty_reward.createdCréer
  • loyalty_reward.updatedModifier
  • loyalty_reward.deletedSupprimer
  • loyalty_redemption.createdCréer
  • loyalty_redemption.updatedModifier