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 the code
    from your callback, with the same redirect_uri and your PKCE code_verifier. A code
    works once, within 10 minutes. Returns an access token and a refresh token for that
    taxpayer, plus grant_id, grant_label, external_id, taxpayer_id, tin and
    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 as GET /grants.

Access tokens last one hour and refresh tokens 90 days. Send an access token as
Authorization: Bearer <token>.

Body Params
stringrequired
string | null
string | null
string | null
string | null
string | null
string | null
Headers
string | null
Response