Authentication

API keys, scopes, and modes.

The EzPays Public API authenticates every request with a secret API key passed as a Bearer token.

Sending the credential

GET /api/public/v1/payment-links HTTP/1.1
Host: api.ezpays.app
Authorization: Bearer ezp_live_<32 base62 chars>

Requests without a valid Authorization header receive 401 Unauthorized.

Key format

ComponentValue
Prefixezp_
Modelive_ (production) or test_ (sandbox)
Secret32 random base62 characters

Examples:

  • ezp_live_2g8f4mZkQp... — production key
  • ezp_test_xR3aLm0vJ7... — test key

The full secret is shown once at creation time; only a 14-character prefix and a SHA-256 hash are persisted on our side.

Modes — live vs. test

Both modes share the same API surface, schemas, and response shapes:

Live modeTest mode
Prefixezp_live_ezp_test_
Payment providerReal PSP (e.g. Stripe, Mercado Pago)Sandboxed simulator
Webhook deliveriesReal HTTPS endpointsReal HTTPS endpoints
DataProduction tenants & creditorsProduction tenants & creditors
Cross-talkNone — test keys cannot read or mutate live resources, and vice versa

You can develop and test against ezp_test_ indefinitely without any risk to production data.

Scopes

Each key is granted one or more scopes at creation time. A request that exceeds the key's scopes returns 403 Forbidden with {"error":{"code":"forbidden","message":"Missing required scope: ..."}}.

ScopeAllows
payments:readRead payment links and their settlements.
payments:writeCreate, cancel, and regenerate payment links.
recovery:readRead recovery cases, debts, and payments.
recovery:writeCreate cases and trigger lifecycle actions.
recovery:importSubmit bulk debt imports.
webhooks:manageManage outbound webhook endpoints (admin UI only — no public endpoint).

Apply the principle of least privilege: a backend that only generates payment links should be granted payments:write (and optionally payments:read), not all scopes.

Rotating and revoking

  • Rotate: create a new key, deploy it, then revoke the old one.
  • Revoke: deleting a key in the dashboard takes effect within seconds (cached at most one minute on edge).
  • Audit: every authenticated request is recorded with the key's prefix, IP, and request ID.

Storage best practices

  1. Inject keys via environment variables or a secret manager — never hard-code them.
  2. Use distinct keys per service so you can rotate without coordination.
  3. Restrict scopes per key.
  4. Rotate periodically (every 90 days is a reasonable cadence).