OAuth2 Flow
Last updated
Last updated
Overview of the flow OAuth2 Flow ReceiptHero
Initiate the flow by redirecting the user to the ReceiptHero consent page.
Redirect
If the user approves the request then the authorization server will redirect the user to the redirect URI defined in the request.
Scopes
receipt:write
Sending receipts to the ReceiptHero system
receipt:read
Reading receipts from the ReceiptHero system
State
message
string
Custom message
partner_metadata
object
To use the state parameters, the state is to be defined in JSON and encoded into Base64.
Callback
The client must make sure that the state matches the provided state value provided to the authorization endpoint. This protects against CSRF type of attacks. The code expires one minute after it has been created.
The client sends the previously received authorization code to the token endpoint which then returns an access token.
Request
The request can be made in either application/json or application/x-www-form-urlencoded.
Response
The returned access token is a JSON Web Token.
In Token you get ID for this connection.
Claims
Claim
Description
receipthero_id
Unique identifier
Response OK
Response Not Found
It is possible to update an existing OAuth2 connection by using this dedicated view.
Query Parameters
receipthero_id
Unique connection identifier (contained in the JWT token)
redirect_uri
The URI where the user is redirected after taking actions on the connection update view
Redirect
The user is redirected back with the following query string parameters:
status
Describes the user action. Possible values are 'cancelled', 'modified' and 'removed'
receipthero_id
Unique connection identifier
Optional Partner defined key-value pairs for carrying relevant metadata (will be included in if provided)