Get Authentication token
Authentication
Get Authentication Token
Exchange your consumer credentials for a short-lived Bearer token.
POST
Get Authentication token
Overview
Use this endpoint to exchange your consumer_key and consumer_secret for a short-lived Bearer token. This is a server-to-server flow and does not require an existing Bearer token.Use this token when calling protected Waftpay APIs such as Collections, Payouts, Remittance, Checkout, Wallet Balance, and Transaction Status Query.
Environments
| Environment | Base URL |
|---|---|
| Sandbox | https://dev.waftpay.io |
| Production | https://waftpay.io |
Endpoint
Full URLs
| Environment | URL |
|---|---|
| Sandbox | https://dev.waftpay.io/auth/api/v1/generate-token |
| Production | https://waftpay.io/auth/api/v1/generate-token |
Request body
| Field | Type | Required | Description |
|---|---|---|---|
consumer_key | string | Yes | Your product-specific consumer key. |
consumer_secret | string | Yes | Your product-specific consumer secret. |
Example request
- Sandbox
- Production
Example response (success)
Response fields
| Field | Type | Description |
|---|---|---|
status | boolean | Indicates whether the token request was successful. |
message | string | Human-readable response message. |
token | string | Bearer token to use on protected API requests. |
expires_in | number | Token validity duration in milliseconds. |
Using the token
Use the token in theAuthorization header:
Token lifecycle
Cache token securely
Store the token server-side and reuse it for subsequent API requests until it expires.
Notes
- Use the credentials for the specific product you are calling: Payouts, Collections, Remittance, Checkout, Wallet Balance, or Transaction Status Query.
- This endpoint does not require Bearer authentication.
- Never expose your
consumer_secretin frontend or mobile applications. - If you regenerate your keys, the old credentials stop working immediately.
Response
Authentication token generated successfully
