Authentication#

The gateway API authenticates with an entity API key, sent as a bearer token.

curl https://manage.casapay.com/api/v1/gateway/agreements \
  -H 'Authorization: Bearer sk_live_...'

Key format#

PrefixEnvironmentSessions created
sk_live_LiveReal payments via EveryPay
sk_test_SandboxSimulator payments, no money moves

The key prefix - not the base URL - determines whether a session runs in live or test mode. A sk_test_ key always produces a test-mode session.

Keep keys server-side

API keys grant full access to create agreements and collect payments for your entity. Never expose one in browser or mobile code. The tenant-facing checkout is authenticated by the session ID instead.

Errors#

StatusCodeCause
401MISSING_API_KEYNo Authorization header.
401INVALID_KEY_FORMATKey does not start with sk_live_ or sk_test_.
401INVALID_API_KEYKey not recognised or revoked.
403GATEWAY_NOT_ENABLEDGateway is not enabled for the entity. Contact support.
{
  "error": "Invalid API key.",
  "code": "INVALID_API_KEY"
}

Rate limits#

SurfaceLimit
Authenticated gateway API60 requests/minute
Public checkout API30 requests/minute

Exceeding a limit returns 429 Too Many Requests.

Entity scoping#

Every key is bound to one entity. Sessions, agreements and invoices are always looked up within that entity, so a request for another entity's session returns 404 SESSION_NOT_FOUND rather than 403 - existence is never leaked across tenants.