Authentication & environments
Every request is authenticated with a secret API key in a header.
Sending your key
Send the key as a bearer token — Authorization: Bearer sk_test_… — on every /v1 request. The older X-API-Key: sk_test_… header is still accepted (send one or the other; two different keys are refused). There is no other way to authenticate the API (no query-string keys, no basic auth).
curl -X GET "https://api.developers.sendjoor.com/v1/payment-links" \
-H "Authorization: Bearer $SENDJOOR_SECRET_KEY"Key types
| Prefix | What it is | Where it may live |
|---|---|---|
sk_test_… | Secret test key — sandbox only | Your server |
sk_live_… | Secret live key — real money | Your 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.
| Test | Live | |
|---|---|---|
| Available | Immediately after signup | After verification is approved |
| Money | Simulated — never moves | Real |
| Data | Separate test database | Live database |
| Webhooks | Your test endpoints only | Your live endpoints only |
| Emails to payers | Never | Receipts 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.
| Scope | Allows |
|---|---|
CHARGES_READ | List, retrieve and verify charges |
CHARGES_WRITE | Create charges |
PAYMENT_LINKS_READ | List and retrieve payment links |
PAYMENT_LINKS_WRITE | Create, update and disable payment links |
KYC_READ · KYC_WRITE | Verify your own customers (customer verification) |
SCHOOLS_READ · STUDENTS_READ · FEES_READ · PAYMENTS_READ | School 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 ansk_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.