Create or refresh a token

Creating tokens

Once the customer logs in, we will redirect them to your 'RedirectUri' defined in the front end JS. This should be a server side endpoint where you will consume the authorization_code then make a /tokens call to obtain customer access_token and refresh_token.

Refreshing tokens

For each page loading the Zip account / payment buttons (showing account balance for logged in users), you will need to use the stored [refresh_token] to generate a new access_token each new session or after 30mins.

Useful notes

  • This request requires the 'content-type': 'application/x-form-www-urlencoded'
  • client_id and client_secret are Zip provided values. Please request these if you do not already have them.
Response
  • Id_Token STRING

  • Access_Token STRING

    Short life token to be used for /charges /accounts /userinfo API calls.

  • Expires_In DOUBLE

  • Token_Type STRING

  • Refresh_Token STRING

    Long life token to be stored used to create a new access tokens for future /charges and account functions.

Query Params
string
required

Id of the client application.

string
required

Secret key of the client application.

string
required

Must be set to authorization_code. The authorization_code grant type is used to exchange a for an access_token and refresh_token.
Must be set to [refresh_token]. The Refresh Token grant type is used to exchange a refresh token for an access token when the access token has expired.

string
required

Pending

string
required

Pending

string

The latest refresh token issued by the identity service.

Responses

Language
LoadingLoading…
Response
Choose an example:
application/json