Authentication
Every merchant gets an API credential pair — client_id (public, safe to embed) and client_secret (shown once at issue; store it server-side like a password). Credentials are issued, rotated and revoked by the GuarantorPay admin from your merchant account.
1. Exchange for a bearer token
POST /api/v1/auth/token
{
"client_id": "gp_xxxxxxxxxxxxxxxx",
"client_secret": "sk_xxxxxxxxxxxxxxxxxxxxxxxx"
}
200:
{
"token": "51|xxxxxxxxxxxxxxxxxxxxxxxx",
"token_type": "Bearer",
"expires_in": 86400,
"merchant": { "serial": 20, "name": "ACME Retail", "organisation": "ACME RETAIL LTD" },
"scopes": ["read", "transactions", "registration"],
"test_mode": false
}
Cache the token and reuse it for 24 hours — do not exchange on every call (the token endpoint is rate-limited to 10 requests/minute per IP). Refresh when a call returns 401 TOKEN_EXPIRED.
2. Call the API
Authorization: Bearer {token}
Accept: application/json
Token rules
- 24-hour life, enforced at the gateway — expired tokens return
401 TOKEN_EXPIRED. - Revocation is instant — when the admin revokes or rotates your credential, live tokens die immediately.
- Tokens are bound to your merchant account — they cannot read or touch any other merchant's data.
- An optional IP allowlist can be pinned to your credential (set by the GP admin) — calls from other IPs get
403 IP_NOT_ALLOWED.
Scopes
| Scope | Grants |
|---|---|
read | Eligibility, transaction lists, status, repayments, /me |
transactions | Create transactions, cancel pending ones |
registration | Onboard civil servants |
A key missing a scope gets 403 SCOPE_DENIED on the routes that need it.
Rate limits
- Token exchange: 10/min per IP (HTTP 429 when exceeded)
- All other endpoints: 60/min per credential