Fidelización
El programa de fidelización: reglas, recompensas, miembros y canjes.
Valores de los ejemplos
Escríbelos una vez y todos los ejemplos de esta página los usan. La clave de API se queda solo en esta página y nunca se guarda.
GET/v1/loyalty/companies/{companyId}
Las tarjetas de fidelización de los contactos de una empresa.
Leer/companies/{companyId}Si va bien: 200.Permiso: Leer.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
companyId | string | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/companies/{companyId}" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/companies/{companyId}", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/companies/{companyId}",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/companies/{companyId}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/companies/{companyId}")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/companies/{companyId}", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/companies/{companyId}"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/companies/{companyId}");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();GET/v1/loyalty/contacts/{contactId}
La tarjeta de un contacto: si es miembro, saldo, nivel, historial y canjes.
Leer/contacts/{contactId}Si va bien: 200.Permiso: Leer.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
contactId | string | Sí |
Respuesta
78 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
member | object | null | Sí |
member.balance | integer | Sí |
member.cardUrl | string (uri) | Sí |
member.contactId | string (uuid) | Sí |
member.createdAt | string (date-time) | Sí |
member.currency | string | Sí |
member.id | string (uuid) | Sí |
member.lastActivityAt | string (date-time) | Sí |
member.lifetimePoints | integer | Sí |
member.nextTier | object | null | Sí |
member.nextTier.name | string | Sí |
member.nextTier.pointsToGo | integer | Sí |
member.purchases | integer | Sí |
member.spent | integer | Sí |
member.tier | object | null | Sí |
member.tier.index | integer | Sí |
member.tier.name | string | Sí |
program | object | Sí |
program.active | boolean | Sí |
program.autoEnroll | boolean | Sí |
program.currency | string | Sí |
program.eventRules | array of object | Sí |
program.eventRules[].event | string | Sí |
program.eventRules[].perDay | integer | Sí |
program.eventRules[].points | integer | Sí |
program.expirationMonths | integer | null | Sí |
program.minPurchaseAmount | integer | Sí |
program.name | string | null | Sí |
program.organizationId | string (uuid) | Sí |
program.pointsLabel | string | null | Sí |
program.pointsPerPurchase | integer | Sí |
program.pointsPerUnit | integer | Sí |
program.selfRedeem | boolean | Sí |
program.sources | object | Sí |
program.sources.invoices | boolean | Sí |
program.sources.manualPayments | boolean | Sí |
program.sources.payments | boolean | Sí |
program.terms | string | null | Sí |
program.tiers | array of object | Sí |
program.tiers[].minPoints | integer | Sí |
program.tiers[].multiplierPercent | integer | Sí |
program.tiers[].name | string | Sí |
program.unitAmount | integer | Sí |
program.updatedAt | string (date-time) | Sí |
program.welcomePoints | integer | Sí |
redemptions | array of object | Sí |
redemptions[].canceledAt | string | null (date-time) | Sí |
redemptions[].code | string | Sí |
redemptions[].createdAt | string (date-time) | Sí |
redemptions[].createdBy | null en los ejemplos | Sí |
redemptions[].fulfilledAt | null en los ejemplos | Sí |
redemptions[].fulfilledBy | null en los ejemplos | Sí |
redemptions[].id | string (uuid) | Sí |
redemptions[].memberId | string (uuid) | Sí |
redemptions[].organizationId | string (uuid) | Sí |
redemptions[].points | integer | Sí |
redemptions[].reward | object | Sí |
redemptions[].reward.currency | string | Sí |
redemptions[].reward.kind | string | Sí |
redemptions[].reward.name | string | Sí |
redemptions[].reward.value | null en los ejemplos | Sí |
redemptions[].rewardId | string (uuid) | Sí |
redemptions[].source | string | Sí |
redemptions[].status | string | Sí |
transactions | array of object | Sí |
transactions[].amount | integer | null | Sí |
transactions[].createdAt | string (date-time) | Sí |
transactions[].createdBy | string | null (uuid) | Sí |
transactions[].currency | string | null | Sí |
transactions[].id | string (uuid) | Sí |
transactions[].kind | string | Sí |
transactions[].memberId | string (uuid) | Sí |
transactions[].note | string | null | Sí |
transactions[].organizationId | string (uuid) | Sí |
transactions[].points | integer | Sí |
transactions[].reversedAt | string | null (date-time) | Sí |
transactions[].source | string | Sí |
transactions[].sourceKey | string | null | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/contacts/{contactId}" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/contacts/{contactId}", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/contacts/{contactId}",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/contacts/{contactId}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/contacts/{contactId}")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/contacts/{contactId}", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/contacts/{contactId}"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/contacts/{contactId}");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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
Suma o quita puntos a mano, con el motivo.
Actualizar/contacts/{contactId}/adjustSi va bien: 200.Permiso: Actualizar.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
contactId | string | Sí |
Cuerpo
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
points | integer | Sí | min -10000000 · max 10000000 |
note | string | Sí | min length 1 · max length 500 |
Respuesta
55 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
member | object | Sí |
member.balance | integer | Sí |
member.cardUrl | string (uri) | Sí |
member.contactId | string (uuid) | Sí |
member.createdAt | string (date-time) | Sí |
member.currency | string | Sí |
member.id | string (uuid) | Sí |
member.lastActivityAt | string (date-time) | Sí |
member.lifetimePoints | integer | Sí |
member.nextTier | object | Sí |
member.nextTier.name | string | Sí |
member.nextTier.pointsToGo | integer | Sí |
member.purchases | integer | Sí |
member.spent | integer | Sí |
member.tier | null en los ejemplos | Sí |
program | object | Sí |
program.active | boolean | Sí |
program.autoEnroll | boolean | Sí |
program.currency | string | Sí |
program.eventRules | array of any | Sí |
program.expirationMonths | null en los ejemplos | Sí |
program.minPurchaseAmount | integer | Sí |
program.name | string | Sí |
program.organizationId | string (uuid) | Sí |
program.pointsLabel | string | Sí |
program.pointsPerPurchase | integer | Sí |
program.pointsPerUnit | integer | Sí |
program.selfRedeem | boolean | Sí |
program.sources | object | Sí |
program.sources.invoices | boolean | Sí |
program.sources.manualPayments | boolean | Sí |
program.sources.payments | boolean | Sí |
program.terms | string | Sí |
program.tiers | array of object | Sí |
program.tiers[].minPoints | integer | Sí |
program.tiers[].multiplierPercent | integer | Sí |
program.tiers[].name | string | Sí |
program.unitAmount | integer | Sí |
program.updatedAt | string (date-time) | Sí |
program.welcomePoints | integer | Sí |
redemptions | array of any | Sí |
transactions | array of object | Sí |
transactions[].amount | null en los ejemplos | Sí |
transactions[].createdAt | string (date-time) | Sí |
transactions[].createdBy | string (uuid) | Sí |
transactions[].currency | null en los ejemplos | Sí |
transactions[].id | string (uuid) | Sí |
transactions[].kind | string | Sí |
transactions[].memberId | string (uuid) | Sí |
transactions[].note | string | null | Sí |
transactions[].organizationId | string (uuid) | Sí |
transactions[].points | integer | Sí |
transactions[].reversedAt | null en los ejemplos | Sí |
transactions[].source | string | Sí |
transactions[].sourceKey | string | null | Sí |
Ejemplo
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": "…"
}'const res = await fetch("https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust", {
method: "POST",
headers: { "X-Api-Key": "fmd_...", "Content-Type": "application/json" },
body: JSON.stringify({
"points": -10000000,
"note": "…"
}),
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust",
headers={"X-Api-Key": "fmd_..."},
json={
"points": -10000000,
"note": "…",
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_...", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"points": -10000000,
"note": "…"
}
JSON,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"points": -10000000,
"note": "…"
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)body := strings.NewReader(`{
"points": -10000000,
"note": "…"
}`)
req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust", body)
req.Header.Set("X-Api-Key", "fmd_...")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust"))
.header("X-Api-Key", "fmd_...")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"points": -10000000,
"note": "…"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/contacts/{contactId}/adjust");
request.Content = new StringContent(""""
{
"points": -10000000,
"note": "…"
}
"""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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
Hace miembro a un contacto, con los puntos de bienvenida.
Crear/contacts/{contactId}/enrollSi va bien: 200.Permiso: Crear.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
contactId | string | Sí |
Ejemplo
curl -X POST "https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll", {
method: "POST",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll"))
.header("X-Api-Key", "fmd_...")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/contacts/{contactId}/enroll");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();POST/v1/loyalty/contacts/{contactId}/send
Envía a un contacto por correo el enlace a su tarjeta.
Actualizar/contacts/{contactId}/sendSi va bien: 200.Permiso: Actualizar.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
contactId | string | Sí |
Cuerpo
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
email | string (email) | No | max length 320 |
Ejemplo
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]"
}'const res = await fetch("https://api.firmado.app/v1/loyalty/contacts/{contactId}/send", {
method: "POST",
headers: { "X-Api-Key": "fmd_...", "Content-Type": "application/json" },
body: JSON.stringify({
"email": "[email protected]"
}),
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/contacts/{contactId}/send",
headers={"X-Api-Key": "fmd_..."},
json={
"email": "[email protected]",
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/contacts/{contactId}/send");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_...", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"email": "[email protected]"
}
JSON,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/contacts/{contactId}/send")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"email": "[email protected]"
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)body := strings.NewReader(`{
"email": "[email protected]"
}`)
req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/contacts/{contactId}/send", body)
req.Header.Set("X-Api-Key", "fmd_...")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/contacts/{contactId}/send"))
.header("X-Api-Key", "fmd_...")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"email": "[email protected]"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/contacts/{contactId}/send");
request.Content = new StringContent(""""
{
"email": "[email protected]"
}
"""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();GET/v1/loyalty/members
Lista los miembros con su saldo y nivel.
Leer/membersSi va bien: 200.Permiso: Leer.
Parámetros de consulta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
q | string | No | max length 100 |
page | integer | No | min 1 · default 1 |
pageSize | integer | No | min 1 · max 100 · default 25 |
sort | "balance" | "lifetimePoints" | "lastActivityAt" | "createdAt" | No | default "balance" |
Respuesta
4 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
data | array of any | Sí |
page | integer | Sí |
pageSize | integer | Sí |
total | integer | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/members" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/members", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/members",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/members");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/members")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/members", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/members"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/members");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"data": [],
"page": 1,
"pageSize": 1,
"total": 1
}GET/v1/loyalty/overview
Los números del programa: miembros, puntos dados y gastados, canjes.
Leer/overviewSi va bien: 200.Permiso: Leer.
Respuesta
37 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
last30 | object | Sí |
last30.earned | integer | Sí |
last30.expired | integer | Sí |
last30.redeemed | integer | Sí |
members | integer | Sí |
outstanding | integer | Sí |
pendingRedemptions | integer | Sí |
program | object | Sí |
program.active | boolean | Sí |
program.autoEnroll | boolean | Sí |
program.currency | string | Sí |
program.eventRules | array of any | Sí |
program.expirationMonths | null en los ejemplos | Sí |
program.minPurchaseAmount | integer | Sí |
program.name | string | Sí |
program.organizationId | string (uuid) | Sí |
program.pointsLabel | string | Sí |
program.pointsPerPurchase | integer | Sí |
program.pointsPerUnit | integer | Sí |
program.selfRedeem | boolean | Sí |
program.sources | object | Sí |
program.sources.invoices | boolean | Sí |
program.sources.manualPayments | boolean | Sí |
program.sources.payments | boolean | Sí |
program.terms | string | Sí |
program.tiers | array of object | Sí |
program.tiers[].minPoints | integer | Sí |
program.tiers[].multiplierPercent | integer | Sí |
program.tiers[].name | string | Sí |
program.unitAmount | integer | Sí |
program.updatedAt | string (date-time) | Sí |
program.welcomePoints | integer | Sí |
spent | integer | Sí |
topRewards | array of object | Sí |
topRewards[].name | string | Sí |
topRewards[].rewardId | string (uuid) | Sí |
topRewards[].total | integer | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/overview" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/overview", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/overview",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/overview");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/overview")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/overview", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/overview"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/overview");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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
Las reglas del programa: cómo suman las compras, niveles y vencimiento.
Leer/programSi va bien: 200.Permiso: Leer.
Respuesta
21 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
active | boolean | Sí |
autoEnroll | boolean | Sí |
currency | string | Sí |
eventRules | array of any | Sí |
expirationMonths | null en los ejemplos | Sí |
minPurchaseAmount | integer | Sí |
name | null en los ejemplos | Sí |
organizationId | string (uuid) | Sí |
pointsLabel | null en los ejemplos | Sí |
pointsPerPurchase | integer | Sí |
pointsPerUnit | integer | Sí |
selfRedeem | boolean | Sí |
sources | object | Sí |
sources.invoices | boolean | Sí |
sources.manualPayments | boolean | Sí |
sources.payments | boolean | Sí |
terms | null en los ejemplos | Sí |
tiers | array of any | Sí |
unitAmount | integer | Sí |
updatedAt | string (date-time) | Sí |
welcomePoints | integer | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/program" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/program", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/program",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/program");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/program")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/program", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/program"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/program");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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
Guarda las reglas del programa (administradores).
Actualizar/programSi va bien: 200.Permiso: Actualizar.
Cuerpo
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
active | boolean | Sí | |
name | string | null | No | |
pointsLabel | string | null | No | |
currency | string | Sí | pattern ^[A-Z]{3}$ |
pointsPerPurchase | integer | Sí | min 0 · max 1000000 |
pointsPerUnit | integer | Sí | min 0 · max 1000000 |
unitAmount | integer | Sí | min 1 · max 1000000000000 |
minPurchaseAmount | integer | Sí | min 0 · max 1000000000000 |
welcomePoints | integer | Sí | min 0 · max 1000000 |
expirationMonths | integer | null | Sí | |
tiers | array of object | Sí | max items 5 |
tiers[].name | string | Sí | min length 1 · max length 40 |
tiers[].minPoints | integer | Sí | min 0 · max 1000000000 |
tiers[].multiplierPercent | integer | No | min 100 · max 1000 · default 100 |
eventRules | array of object | No | max items 10 |
eventRules[].event | string | Sí | |
eventRules[].points | integer | Sí | min 1 · max 1000000 |
eventRules[].perDay | integer | null | No | default null |
sources | object | Sí | |
sources.payments | boolean | Sí | |
sources.invoices | boolean | Sí | |
sources.manualPayments | boolean | Sí | |
autoEnroll | boolean | Sí | |
selfRedeem | boolean | Sí | |
terms | string | null | No |
Respuesta
27 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
active | boolean | Sí |
autoEnroll | boolean | Sí |
currency | string | Sí |
eventRules | array of object | Sí |
eventRules[].event | string | Sí |
eventRules[].perDay | integer | Sí |
eventRules[].points | integer | Sí |
expirationMonths | null en los ejemplos | Sí |
minPurchaseAmount | integer | Sí |
name | string | null | Sí |
organizationId | string (uuid) | Sí |
pointsLabel | string | null | Sí |
pointsPerPurchase | integer | Sí |
pointsPerUnit | integer | Sí |
selfRedeem | boolean | Sí |
sources | object | Sí |
sources.invoices | boolean | Sí |
sources.manualPayments | boolean | Sí |
sources.payments | boolean | Sí |
terms | string | null | Sí |
tiers | array of object | Sí |
tiers[].minPoints | integer | Sí |
tiers[].multiplierPercent | integer | Sí |
tiers[].name | string | Sí |
unitAmount | integer | Sí |
updatedAt | string (date-time) | Sí |
welcomePoints | integer | Sí |
Ejemplo
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
}'const res = await fetch("https://api.firmado.app/v1/loyalty/program", {
method: "PUT",
headers: { "X-Api-Key": "fmd_...", "Content-Type": "application/json" },
body: JSON.stringify({
"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
}),
})
const data = await res.json()import requests
res = requests.put(
"https://api.firmado.app/v1/loyalty/program",
headers={"X-Api-Key": "fmd_..."},
json={
"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,
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/program");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_...", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"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
}
JSON,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/program")
req = Net::HTTP::Put.new(uri)
req["X-Api-Key"] = "fmd_..."
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"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
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)body := strings.NewReader(`{
"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
}`)
req, _ := http.NewRequest("PUT", "https://api.firmado.app/v1/loyalty/program", body)
req.Header.Set("X-Api-Key", "fmd_...")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/program"))
.header("X-Api-Key", "fmd_...")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("""
{
"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
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("PUT"), "https://api.firmado.app/v1/loyalty/program");
request.Content = new StringContent(""""
{
"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
}
"""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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 las recompensas canjeadas, por estado.
Leer/redemptionsSi va bien: 200.Permiso: Leer.
Parámetros de consulta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
status | "pending" | "fulfilled" | "canceled" | No | |
code | string | No | max length 20 |
contactId | string (uuid) | No | |
page | integer | No | min 1 · default 1 |
pageSize | integer | No | min 1 · max 100 · default 25 |
Respuesta
24 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
data | array of object | Sí |
data[].canceledAt | null en los ejemplos | Sí |
data[].code | string | Sí |
data[].contactId | string (uuid) | Sí |
data[].createdAt | string (date-time) | Sí |
data[].createdBy | null en los ejemplos | Sí |
data[].fulfilledAt | null en los ejemplos | Sí |
data[].fulfilledBy | null en los ejemplos | Sí |
data[].id | string (uuid) | Sí |
data[].memberId | string (uuid) | Sí |
data[].name | string | Sí |
data[].organizationId | string (uuid) | Sí |
data[].points | integer | Sí |
data[].reward | object | Sí |
data[].reward.currency | string | Sí |
data[].reward.kind | string | Sí |
data[].reward.name | string | Sí |
data[].reward.value | null en los ejemplos | Sí |
data[].rewardId | string (uuid) | Sí |
data[].source | string | Sí |
data[].status | string | Sí |
page | integer | Sí |
pageSize | integer | Sí |
total | integer | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/redemptions" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/redemptions", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/redemptions",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/redemptions");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/redemptions")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/redemptions", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/redemptions"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/redemptions");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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
Canjea una recompensa para un contacto, gastando sus puntos.
Crear/redemptionsSi va bien: 201.Permiso: Crear.
Cuerpo
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
contactId | string (uuid) | Sí | |
rewardId | string (uuid) | Sí |
Respuesta
18 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
canceledAt | null en los ejemplos | Sí |
code | string | Sí |
createdAt | string (date-time) | Sí |
createdBy | string (uuid) | Sí |
fulfilledAt | null en los ejemplos | Sí |
fulfilledBy | null en los ejemplos | Sí |
id | string (uuid) | Sí |
memberId | string (uuid) | Sí |
organizationId | string (uuid) | Sí |
points | integer | Sí |
reward | object | Sí |
reward.currency | string | Sí |
reward.kind | string | Sí |
reward.name | string | Sí |
reward.value | null en los ejemplos | Sí |
rewardId | string (uuid) | Sí |
source | string | Sí |
status | string | Sí |
Ejemplo
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"
}'const res = await fetch("https://api.firmado.app/v1/loyalty/redemptions", {
method: "POST",
headers: { "X-Api-Key": "fmd_...", "Content-Type": "application/json" },
body: JSON.stringify({
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}),
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/redemptions",
headers={"X-Api-Key": "fmd_..."},
json={
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/redemptions");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_...", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}
JSON,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/redemptions")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)body := strings.NewReader(`{
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}`)
req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/redemptions", body)
req.Header.Set("X-Api-Key", "fmd_...")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/redemptions"))
.header("X-Api-Key", "fmd_...")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/redemptions");
request.Content = new StringContent(""""
{
"contactId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10",
"rewardId": "3f0b6c3e-8a51-4c2b-9a51-0d6f3b2a7c10"
}
"""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (201), con valores de ejemplo:
{
"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 una recompensa no entregada; los puntos vuelven.
Actualizar/redemptions/{id}/cancelSi va bien: 200.Permiso: Actualizar.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
id | string | Sí |
Respuesta
18 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
canceledAt | string (date-time) | Sí |
code | string | Sí |
createdAt | string (date-time) | Sí |
createdBy | null en los ejemplos | Sí |
fulfilledAt | null en los ejemplos | Sí |
fulfilledBy | null en los ejemplos | Sí |
id | string (uuid) | Sí |
memberId | string (uuid) | Sí |
organizationId | string (uuid) | Sí |
points | integer | Sí |
reward | object | Sí |
reward.currency | string | Sí |
reward.kind | string | Sí |
reward.name | string | Sí |
reward.value | null en los ejemplos | Sí |
rewardId | string (uuid) | Sí |
source | string | Sí |
status | string | Sí |
Ejemplo
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel", {
method: "POST",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel"))
.header("X-Api-Key", "fmd_...")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/redemptions/{id}/cancel");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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 una recompensa como entregada.
Actualizar/redemptions/{id}/fulfillSi va bien: 200.Permiso: Actualizar.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
id | string | Sí |
Respuesta
18 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
canceledAt | null en los ejemplos | Sí |
code | string | Sí |
createdAt | string (date-time) | Sí |
createdBy | string (uuid) | Sí |
fulfilledAt | string (date-time) | Sí |
fulfilledBy | string (uuid) | Sí |
id | string (uuid) | Sí |
memberId | string (uuid) | Sí |
organizationId | string (uuid) | Sí |
points | integer | Sí |
reward | object | Sí |
reward.currency | string | Sí |
reward.kind | string | Sí |
reward.name | string | Sí |
reward.value | null en los ejemplos | Sí |
rewardId | string (uuid) | Sí |
source | string | Sí |
status | string | Sí |
Ejemplo
curl -X POST "https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill", {
method: "POST",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill"))
.header("X-Api-Key", "fmd_...")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/redemptions/{id}/fulfill");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
{
"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 las recompensas que pueden canjear los miembros.
Leer/rewardsSi va bien: 200.Permiso: Leer.
Respuesta
14 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
[].active | boolean | Sí |
[].cost | integer | Sí |
[].createdAt | string (date-time) | Sí |
[].description | null en los ejemplos | Sí |
[].id | string (uuid) | Sí |
[].kind | string | Sí |
[].minTier | null en los ejemplos | Sí |
[].name | string | Sí |
[].organizationId | string (uuid) | Sí |
[].perMember | integer | null | Sí |
[].position | integer | Sí |
[].stock | integer | null | Sí |
[].updatedAt | string (date-time) | Sí |
[].value | integer | null | Sí |
Ejemplo
curl -X GET "https://api.firmado.app/v1/loyalty/rewards" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/rewards", {
method: "GET",
headers: { "X-Api-Key": "fmd_..." },
})
const data = await res.json()import requests
res = requests.get(
"https://api.firmado.app/v1/loyalty/rewards",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/rewards");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/rewards")
req = Net::HTTP::Get.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.firmado.app/v1/loyalty/rewards", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/rewards"))
.header("X-Api-Key", "fmd_...")
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("GET"), "https://api.firmado.app/v1/loyalty/rewards");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (200), con valores de ejemplo:
[
{
"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
Crea una recompensa: un artículo, un descuento o cashback, y sus puntos.
Crear/rewardsSi va bien: 201.Permiso: Crear.
Cuerpo
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
name | string | Sí | min length 1 · max length 120 |
description | string | null | No | |
kind | "item" | "discount_percent" | "discount_amount" | "cashback" | Sí | |
value | integer | null | No | |
cost | integer | Sí | min 1 · max 1000000000 |
stock | integer | null | No | |
perMember | integer | null | No | |
minTier | integer | null | No | |
active | boolean | No | default true |
position | integer | No | min 0 · max 1000 · default 0 |
Respuesta
14 campos
| Campo | Tipo | Siempre presente |
|---|---|---|
active | boolean | Sí |
cost | integer | Sí |
createdAt | string (date-time) | Sí |
description | null en los ejemplos | Sí |
id | string (uuid) | Sí |
kind | string | Sí |
minTier | null en los ejemplos | Sí |
name | string | Sí |
organizationId | string (uuid) | Sí |
perMember | integer | null | Sí |
position | integer | Sí |
stock | integer | null | Sí |
updatedAt | string (date-time) | Sí |
value | integer | null | Sí |
Ejemplo
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": "…"
}'const res = await fetch("https://api.firmado.app/v1/loyalty/rewards", {
method: "POST",
headers: { "X-Api-Key": "fmd_...", "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}),
})
const data = await res.json()import requests
res = requests.post(
"https://api.firmado.app/v1/loyalty/rewards",
headers={"X-Api-Key": "fmd_..."},
json={
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…",
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/rewards");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_...", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
JSON,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/rewards")
req = Net::HTTP::Post.new(uri)
req["X-Api-Key"] = "fmd_..."
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)body := strings.NewReader(`{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}`)
req, _ := http.NewRequest("POST", "https://api.firmado.app/v1/loyalty/rewards", body)
req.Header.Set("X-Api-Key", "fmd_...")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/rewards"))
.header("X-Api-Key", "fmd_...")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("""
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("POST"), "https://api.firmado.app/v1/loyalty/rewards");
request.Content = new StringContent(""""
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
"""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Respuesta (201), con valores de ejemplo:
{
"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}
Elimina una recompensa; los canjes ya hechos se mantienen.
Eliminar/rewards/{id}Si va bien: 204.Permiso: Eliminar.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
id | string | Sí |
Ejemplo
curl -X DELETE "https://api.firmado.app/v1/loyalty/rewards/{id}" \
-H "X-Api-Key: fmd_..."const res = await fetch("https://api.firmado.app/v1/loyalty/rewards/{id}", {
method: "DELETE",
headers: { "X-Api-Key": "fmd_..." },
})
if (!res.ok) throw new Error(await res.text())import requests
res = requests.delete(
"https://api.firmado.app/v1/loyalty/rewards/{id}",
headers={"X-Api-Key": "fmd_..."},
)
res.raise_for_status()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/rewards/{id}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_..."],
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/rewards/{id}")
req = Net::HTTP::Delete.new(uri)
req["X-Api-Key"] = "fmd_..."
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }req, _ := http.NewRequest("DELETE", "https://api.firmado.app/v1/loyalty/rewards/{id}", nil)
req.Header.Set("X-Api-Key", "fmd_...")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/rewards/{id}"))
.header("X-Api-Key", "fmd_...")
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("DELETE"), "https://api.firmado.app/v1/loyalty/rewards/{id}");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();PUT/v1/loyalty/rewards/{id}
Cambia una recompensa.
Actualizar/rewards/{id}Si va bien: 200.Permiso: Actualizar.
Parámetros de ruta
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
id | string | Sí |
Cuerpo
| Campo | Tipo | Obligatorio | Notas |
|---|---|---|---|
name | string | Sí | min length 1 · max length 120 |
description | string | null | No | |
kind | "item" | "discount_percent" | "discount_amount" | "cashback" | Sí | |
value | integer | null | No | |
cost | integer | Sí | min 1 · max 1000000000 |
stock | integer | null | No | |
perMember | integer | null | No | |
minTier | integer | null | No | |
active | boolean | No | default true |
position | integer | No | min 0 · max 1000 · default 0 |
Ejemplo
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": "…"
}'const res = await fetch("https://api.firmado.app/v1/loyalty/rewards/{id}", {
method: "PUT",
headers: { "X-Api-Key": "fmd_...", "Content-Type": "application/json" },
body: JSON.stringify({
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}),
})
const data = await res.json()import requests
res = requests.put(
"https://api.firmado.app/v1/loyalty/rewards/{id}",
headers={"X-Api-Key": "fmd_..."},
json={
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…",
},
)
res.raise_for_status()
data = res.json()<?php
$ch = curl_init("https://api.firmado.app/v1/loyalty/rewards/{id}");
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["X-Api-Key: fmd_...", "Content-Type: application/json"],
CURLOPT_POSTFIELDS => <<<'JSON'
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
JSON,
]);
$data = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);require "net/http"
require "json"
uri = URI("https://api.firmado.app/v1/loyalty/rewards/{id}")
req = Net::HTTP::Put.new(uri)
req["X-Api-Key"] = "fmd_..."
req["Content-Type"] = "application/json"
req.body = <<~JSON
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
JSON
res = Net::HTTP.start(uri.host, uri.port, use_ssl: uri.scheme == "https") { |http| http.request(req) }
data = JSON.parse(res.body)body := strings.NewReader(`{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}`)
req, _ := http.NewRequest("PUT", "https://api.firmado.app/v1/loyalty/rewards/{id}", body)
req.Header.Set("X-Api-Key", "fmd_...")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)var request = HttpRequest.newBuilder(URI.create("https://api.firmado.app/v1/loyalty/rewards/{id}"))
.header("X-Api-Key", "fmd_...")
.header("Content-Type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("""
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
"""))
.build();
var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());using var http = new HttpClient();
http.DefaultRequestHeaders.Add("X-Api-Key", "fmd_...");
var request = new HttpRequestMessage(new HttpMethod("PUT"), "https://api.firmado.app/v1/loyalty/rewards/{id}");
request.Content = new StringContent(""""
{
"name": "Ana Lima",
"kind": "item",
"cost": 1,
"description": "…"
}
"""", Encoding.UTF8, "application/json");
var response = await http.SendAsync(request);
response.EnsureSuccessStatusCode();Eventos de webhook
Cambios de esta funcionalidad que los webhooks pueden enviar.
loyalty_program.updatedActualizarloyalty_member.joinedCrearloyalty.points_changedActualizarloyalty_reward.createdCrearloyalty_reward.updatedActualizarloyalty_reward.deletedEliminarloyalty_redemption.createdCrearloyalty_redemption.updatedActualizar