Exchange a code, refresh a token or authenticate a client
post
https://einvoicing.wafeq.com/oauth/token
Get access tokens for your app. Send the body as application/x-www-form-urlencoded
from your server to https://einvoicing.wafeq.com/oauth/token (Live) or
https://einvoicing.wafeq.com/sandbox/oauth/token (Sandbox).
Authenticate your OAuth client with HTTP Basic or with
client_id and client_secret in the body.
authorization_code: after the taxpayer approves your app, exchange thecode
from your callback, with the sameredirect_uriand your PKCEcode_verifier. A code
works once, within 10 minutes. Returns an access token and a refresh token for that
taxpayer, plusgrant_id,grant_label,external_id,taxpayer_id,tinand
taxpayer_name, so you can match the connection to your own records.refresh_token: returns a new access token and a new refresh token, and the old
refresh token stops working. Sending a used refresh token again revokes every token
of that grant.client_credentials: returns an access token for your organization, not for a
taxpayer. Use it for organization-level calls such asGET /grants.
Access tokens last one hour and refresh tokens 90 days. Send an access token as
Authorization: Bearer <token>.
Updated about 1 month ago