Skip to main content
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

Sandbox and Production credentials are separate. Use Sandbox credentials on https://dev.waftpay.io and Production credentials on https://api.waftpay.io. Paths are identical across environments (for example /auth/v1/generate-token) — only the host differs.

Endpoint


Request body


Example request


Example response (success)


Response fields


Using the token

Use the token in the Authorization header:
Example:

Token lifecycle

1

Generate token

Call this endpoint using your product-specific consumer credentials.
2

Cache token securely

Store the token server-side and reuse it for subsequent API requests until it expires.
3

Refresh on expiry

Generate a new token only when the current token expires or becomes invalid.

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_secret in frontend or mobile applications.
  • If you regenerate your keys, the old credentials stop working immediately.

Body

application/json
consumer_secret
string
required
consumer_key
string<password>
required

Response

Authentication token generated successfully

status
boolean
required

Indicates if the request was successful

Example:

true

message
string
required
Example:

"Request processed successfully"

token
string
required

JWT bearer token to use in Authorization header

expires_in
integer
required

Token validity in milliseconds

Example:

3600