IteraPay uses two authentication methods: a Bearer token (JWT) for account-level administrative operations, and an API key scoped to a specific merchant for payment operations. Most day-to-day work — creating invoices, listing transactions, initiating withdrawals — uses the API key. The Bearer token is reserved for actions that manage the merchant account itself, like generating a new API key.Documentation Index
Fetch the complete documentation index at: https://docs.iterapay.com/docs/llms.txt
Use this file to discover all available pages before exploring further.
Bearer token
Your Bearer token is a JSON Web Token (JWT) issued when you log in to IteraPay. Retrieve it from Settings → API access in your account dashboard. Pass the Bearer token in theAuthorization header of every request that requires it:
401 Unauthorized, your token may have expired — log in again to obtain a fresh one.
API key
API keys are scoped to a single merchant and authenticate all payment operations. You generate an API key using your Bearer token, then use it for every subsequent merchant operation. Pass the API key in theX-Api-Key header:
Generating and revoking API keys
All key management endpoints require Bearer token authentication.- Generate a key
- Get key info
- Revoke a key
Generate a new API key for your merchant. If a key already exists, this replaces it.Response:IteraPay only returns the full key value at generation time. Store it immediately.
Which auth method does each operation require?
| Operation | Bearer token | API key |
|---|---|---|
Generate API key (POST /key/generate/{merchantID}) | Required | — |
Get API key info (GET /key/info/{merchantID}) | Required | — |
Revoke API key (DELETE /key/revoke/{merchantID}) | Required | — |
Create invoice (POST /merchants/{merchantID}/invoices) | — | Required |
List invoices (GET /merchants/{merchantID}/invoices) | — | Required |
Get payment address (GET /public/invoices/...) | — | Required |
| List transactions | — | Required |
| Create withdrawal | — | Required |
| Manage merchant settings | Required | — |
Operations listed under Bearer token are typically performed once during initial setup or key rotation. Your production application only needs the API key for ongoing payment operations.
Error codes
IteraPay returns errors in RFC 7807application/problem+json format. The two authentication-related error codes you are most likely to encounter are:
401 Unauthorized — The request did not include a valid credential, or the credential has expired or been revoked. Check that:
- The
Authorizationheader is present and uses theBearer <token>format, or - The
X-Api-Keyheader is present and contains a valid, active API key.
403 Forbidden — The credential is valid but does not have permission for the requested operation. This typically means you used an API key for an operation that requires a Bearer token, or the Bearer token belongs to an account without access to the specified merchant.
Example error response:
Security best practices
- Rotate API keys regularly — revoke the current key and generate a fresh one on a schedule, or any time a team member with key access leaves.
- Use environment variables — pass credentials through environment variables rather than embedding them in code.
- Restrict key access — if your infrastructure supports it, limit which services and IP addresses can send requests using your API key. See IP Whitelist for IteraPay’s built-in allowlist feature.
- Audit key usage — use
GET /key/info/{merchantID}to checklastUsedAtand detect unexpected activity.