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"
}
CampoTipoDescripción
idstringIdentificador único
emailstringCorreo del cliente
namestring | nullNombre del cliente
external_idstring | nullTu propio identificador interno para este cliente
default_payment_method_idstring | nullMétodo de pago por defecto
created_atdatetimeFecha de creación

Crear un cliente

POST /v1/customers

Request body

{ "email": "cliente@ejemplo.com", "name": "María Pérez", "external_id": "user_9182" }
CampoTipoRequeridoDescripción
emailstringSíCorreo del cliente
namestringNoNombre del cliente
external_idstringNoTu identificador interno para este cliente
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" }'

Response — 201 Created

Devuelve el objeto Customer creado.

Errores posibles

Statuserror.typeCausa
400invalid_requestemail faltante o con formato inválido
401authentication_errorAPI 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 "https://api.rekurra.dev/v1/customers?email=cliente@ejemplo.com" \
  -H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"

Obtener un cliente

GET /v1/customers/{id}

curl https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
  -H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"

Errores posibles

Statuserror.typeCausa
404invalid_requestEl cliente no existe o no pertenece a tu cuenta

Actualizar un cliente

PATCH /v1/customers/{id}

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

Eliminar un cliente

DELETE /v1/customers/{id}

curl -X DELETE https://api.rekurra.dev/v1/customers/cus_01HZXK7QJ5M8Z9X2R3TVQ7A1B2 \
  -H "Authorization: Bearer rk_live_XXXXXXXXXXXXXXXXXXXXXXXX"

Errores posibles

Statuserror.typeCausa
404invalid_requestEl cliente no existe
409invalid_requestEl cliente tiene suscripciones activas que impiden su eliminación