Authorization is implemented using OAuth 2.0.Requests must be authorized using http header:Getting consent from a user#
First, redirect your user to Openpay's consent screen to let them grant API access:When the user grants access they will be redirected to your redirect_url with a grant token accessible in a code parameter.Next, request an access token using the grant token obtained from the redirect:{
"access_token": ACCESS_TOKEN,
"token_type": "Bearer",
"expires_in": 7200,
"refresh_token": REFRESH_TOKEN,
"scope": "offline_access"
}
Make an authorized API request#
You can now make API requests on behalf of the user with the access token:Refreshing the access token#
The access token will expire after 2 hours and you must request a new token using the refresh token:{
"access_token": ACCESS_TOKEN,
"token_type": "Bearer",
"expires_in": 7200,
"refresh_token": REFRESH_TOKEN,
"scope": "offline_access"
}
Modified at 2025-08-12 10:40:21