API v1

Authentication & environments

Every request is authenticated with a secret API key in a header.

Key types

PrefixWhat it isWhere it may live
sk_test_…Secret test key — sandbox onlyYour server
sk_live_…Secret live key — real moneyYour server, in a secret store
pk_test_… / pk_live_…Legacy secret keys issued before 13 Oct 2026. Still valid; rotate them to sk_ when convenient.Your server

Sendjoor does not issue publishable (browser) keys: payers use the hosted checkout, which needs no key in the browser at all. Every key Sendjoor issues is secret.

Never expose a secret key

Don't ship it in JavaScript bundles, mobile apps, screenshots or public repositories. If one leaks, revoke or rotate it in the dashboard immediately — revocation takes effect on the very next request.

How the environment is chosen

The key decides the environment, from its stored record — never anything in the request. A test key reads and writes only the test database and a simulated bank; a live key only live data. Neither can see the other's charges, links, webhooks or logs (requests for the other environment's resources return 404). The key prefix is a label for humans; Sendjoor checks the record, and rejects a key whose prefix disagrees with it.

TestLive
AvailableImmediately after signupAfter verification is approved
MoneySimulated — never movesReal
DataSeparate test databaseLive database
WebhooksYour test endpoints onlyYour live endpoints only
Emails to payersNeverReceipts as normal

If an environment isn't served by the deployment you call, the API fails closed with 503 and code ENVIRONMENT_UNAVAILABLE — it never falls back to the other environment.

Scopes (permissions)

Each key carries only the scopes you grant. With none selected, a key gets charges read + create.

ScopeAllows
CHARGES_READList, retrieve and verify charges
CHARGES_WRITECreate charges
PAYMENT_LINKS_READList and retrieve payment links
PAYMENT_LINKS_WRITECreate, update and disable payment links
KYC_READ · KYC_WRITEVerify your own customers (customer verification)
SCHOOLS_READ · STUDENTS_READ · FEES_READ · PAYMENTS_READSchool data, only for schools that approved you (school integrations)

A missing scope returns 403 naming exactly what is missing. Transfer scopes cannot be granted: Sendjoor has no money-out API.

IP allowlists

Optionally restrict a key to your servers' egress addresses — single IPs (203.0.113.7) or CIDR ranges (203.0.113.0/24, IPv6 too). Requests from anywhere else get 403. Leave the list empty for no restriction.

Rotation, revocation and expiry

  • Rotate mints a new key with the same environment, scopes and allowlist and revokes the old one immediately — deploy the new key first, then rotate. A legacy pk_ key rotates into an sk_ key.
  • Revoke is permanent and immediate. Keys are never deleted; revoked keys stay visible for your records.
  • Expiry (optional, up to 730 days) makes a key stop working automatically.
  • Live keys also stop working while your verification is suspended, and start again if it is reinstated.

Every create, rotate, revoke and edit is audited and emailed to you. Sendjoor never emails a secret.