Guide
Authentication
How to authenticate with the NextPay API
NextPay uses a device code flow for authentication, similar to CLI tools like GitHub CLI.
Device Code Flow
- Request a device code —
POST /v1/auth/device-code - User authorizes — Direct the user to the verification URL
- Poll for token —
GET /v1/auth/device-code/{code}until authorized - Exchange for token —
POST /v1/auth/token
Using Tokens
Include the token in the Authorization header:
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://api.nextpay.world/v1/auth/meToken Refresh
Tokens expire after a set period. Use the refresh token to obtain a new access token without re-authenticating.