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

Scopes

ScopeGrants
readEligibility, transaction lists, status, repayments, /me
transactionsCreate transactions, cancel pending ones
registrationOnboard civil servants

A key missing a scope gets 403 SCOPE_DENIED on the routes that need it.

Rate limits