Every request to a protected Dubu Pay endpoint must carry valid credentials. Dubu Pay offers two authentication methods: a short-lived JWT bearer token issued on login, and a long-lived API key you create and manage from your account. Understanding when to use each method will help you build a secure integration.Documentation Index
Fetch the complete documentation index at: https://docs.dubupay.com/llms.txt
Use this file to discover all available pages before exploring further.
Authentication methods
JWT bearer token
When you callPOST /auth/login, the API returns an access_token and a refresh_token. Include the access token in the Authorization header for subsequent requests:
| Property | Value |
|---|---|
| Access token lifetime | 15 minutes |
| Refresh token lifetime | 7 days |
| Header name | Authorization |
| Header value format | Bearer <token> |
API key
API keys are long-lived credentials tied to your merchant account. Pass one in theX-Api-Key header:
| Property | Value |
|---|---|
| Key formats | dubu_sk_live_<32chars> or dubu_sk_test_<32chars> |
| Header name | X-Api-Key |
| Expiry | None (until revoked) |
Refreshing an access token
When your access token expires, use the refresh token to obtain a new pair without requiring the user to log in again. Each refresh call issues a new access token and rotates the refresh token. Request bodyThe refresh token returned by
/auth/login or a previous /auth/refresh call.Authentication priority
When a request includes both anX-Api-Key header and an Authorization: Bearer header, Dubu Pay evaluates the API key first. If the API key is valid and active, the bearer token is ignored.
Error responses
| HTTP status | Error code | Cause |
|---|---|---|
401 | UNAUTHORIZED | No credentials provided, token has expired, or token signature is invalid. |
403 | IP_WHITELIST_REQUIRED | Your account has no whitelisted IPs configured and IP enforcement is enabled. |
403 | IP_NOT_WHITELISTED | The request originated from an IP address not on your whitelist. |
If you receive a
403 IP_NOT_WHITELISTED error, add your server’s outbound IP address to the IP whitelist in your account settings.Logging out
To invalidate a session and revoke the active refresh token, callPOST /auth/logout with a valid bearer token.
Next steps
API keys
Create and manage long-lived API keys for server-side integrations.
Quickstart
Follow the end-to-end guide to issue your first virtual bank account.