Exchange token
Users
Exchange token
Exchange a pre-registered userId for a Qash user JWT.
POST
Exchange token
Requires
X-Api-Key and X-Api-Secret headers. See Authentication for details.POST /partner/users and their status is active, call this endpoint from your backend to obtain a short-lived Qash JWT. Pass that JWT in the Authorization header for all financial operations on behalf of that user.
No Privy SDK integration is required.
Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | The Qash user ID returned when the user was registered |
Response
200 OK| Field | Type | Description |
|---|---|---|
success | boolean | true when the token was issued successfully |
accessToken | string | JWT to use in Authorization: Bearer for financial endpoints — expires in 1 hour |
refreshToken | string | Token to obtain a new accessToken — valid for 30 days |
user.id | string | Qash user ID |
user.email | string | User email |
user.status | string | Must be "active" — token exchange fails for any other status |
user.userType | string | "personal" or "business" |
Errors
| HTTP status | Error | Cause |
|---|---|---|
400 | userId is required | Missing body field |
401 | Invalid partner credentials | Wrong or missing X-Api-Key / X-Api-Secret |
404 | User not found | User doesn’t exist or belongs to a different partner |
403 | User account is pending | User hasn’t completed KYC — call POST /partner/kyc first |
403 | User account is suspended | User is temporarily suspended |
The
accessToken is scoped to the user and carries the partnerId internally. You cannot use a token issued for one partner’s user on another partner’s endpoints.