Customers
/v1/customers — tus clientes finales. Ver también el concepto
Cliente.
El objeto Customer
{
"id": "cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
"email": "cliente@ejemplo.com",
"name": "María Pérez",
"external_id": "user_9182",
"default_payment_method_id": "pm_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
"created_at": "2026-08-24T15:00:00Z"
}| Campo | Tipo |
|---|---|
id | string |
email | string |
name | string | null |
external_id | string | null |
default_payment_method_id | string | null |
created_at | datetime |
Crear un cliente
POST /v1/customers
Request body
{ "email": "cliente@ejemplo.com", "name": "María Pérez", "external_id": "user_9182" }| Campo | Requerido |
|---|---|
email | Sí |
name | No |
external_id | No |
curl
curl -X POST https://api.rekurra.dev/v1/customers \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{ "email": "cliente@ejemplo.com", "name": "María Pérez" }'JavaScript (fetch)
const res = await fetch("https://api.rekurra.dev/v1/customers", {
method: "POST",
headers: {
Authorization: "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX",
"Content-Type": "application/json",
},
body: JSON.stringify({ email: "cliente@ejemplo.com", name: "María Pérez" }),
});
const customer = await res.json();Python (requests)
import requests
res = requests.post(
"https://api.rekurra.dev/v1/customers",
headers={
"Authorization": "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX",
"Content-Type": "application/json",
},
json={"email": "cliente@ejemplo.com", "name": "María Pérez"},
)
customer = res.json()Response — 201 Created
Devuelve el objeto Customer creado.
Errores posibles
| Status | error.type | Causa |
|---|---|---|
400 | invalid_request | email faltante o con formato inválido |
401 | authentication_error | API key inválida o ausente |
Listar clientes
GET /v1/customers
Filtro opcional ?email= (búsqueda exacta), más paginación estándar
(?limit=, ?starting_after=).
curl
curl "https://api.rekurra.dev/v1/customers?email=cliente@ejemplo.com" \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"JavaScript (fetch)
const res = await fetch(
"https://api.rekurra.dev/v1/customers?email=cliente@ejemplo.com",
{ headers: { Authorization: "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" } }
);
const { data } = await res.json();Python (requests)
import requests
res = requests.get(
"https://api.rekurra.dev/v1/customers",
params={"email": "cliente@ejemplo.com"},
headers={"Authorization": "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"},
)
body = res.json()Obtener un cliente
GET /v1/customers/{id}
curl
curl https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"JavaScript (fetch)
const res = await fetch(
"https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
{ headers: { Authorization: "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" } }
);
const customer = await res.json();Python (requests)
import requests
res = requests.get(
"https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
headers={"Authorization": "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"},
)
customer = res.json()Errores posibles
| Status | error.type | Causa |
|---|---|---|
404 | invalid_request | El cliente no existe o no pertenece a tu cuenta |
Actualizar un cliente
PATCH /v1/customers/{id}
curl
curl -X PATCH https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" \
-H "Content-Type: application/json" \
-d '{ "name": "María Pérez Gómez" }'JavaScript (fetch)
const res = await fetch(
"https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
{
method: "PATCH",
headers: {
Authorization: "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX",
"Content-Type": "application/json",
},
body: JSON.stringify({ name: "María Pérez Gómez" }),
}
);
const customer = await res.json();Python (requests)
import requests
res = requests.patch(
"https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
headers={
"Authorization": "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX",
"Content-Type": "application/json",
},
json={"name": "María Pérez Gómez"},
)
customer = res.json()Eliminar un cliente
DELETE /v1/customers/{id}
curl
curl -X DELETE https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
-H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"JavaScript (fetch)
await fetch(
"https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
{
method: "DELETE",
headers: { Authorization: "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX" },
}
);Python (requests)
import requests
requests.delete(
"https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2",
headers={"Authorization": "Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"},
)Errores posibles
| Status | error.type | Causa |
|---|---|---|
404 | invalid_request | El cliente no existe |
409 | invalid_request | El cliente tiene suscripciones activas que impiden su eliminación |