Comment on page

Going Live

Prerequisite

Before going live, make sure you have read the page about Organizations. It's important to handle the case where your users' data resides in an organization vs. their personal account.

Authentication

To go live with your application, you need to setup the OAuth authentication instead of the API keys, please follow these steps:
  1. 1.
    Your integration needs to be whitelisted by the Request Finance team; get in touch here or via the Intercom chat. Be sure to mention the email of the account that will make the queries. We advise setting up an account just for the integration, an account that does not send or receive invoices, with a strong password that can be archived safely.
  2. 2.
    Create an app in your Request Finance account on the "Developers" menu.
  3. 3.
    Retrieve an OAuth access-token and refresh-token for your user by following the Authorization Code Flow, with the provided Client Secret and Client ID. You can use any OAuth2 or OpenID-compatible library to do the heavy lifting. Auth0 also provides its own libraries here, choose any package corresponding to your language under "Regular Web App". For reference, we developed two implementation examples, one using NextJS and one using ExpressJS, available on this demo repository.
  4. 4.
    To configure the OAuth connection, you need to use the following parameters:
    URL: https://auth.request.finance
    Audience: accounts
    Scope: openid profile email offline_access
    Other scopes are also available, like user:read, see List organizations the user belongs to.
  5. 5.
    Save both the access-token and refresh-token. Authenticate your API calls using the access-token and reuse it until it expires (24 hours). After it expires, use the refresh-token to ask for a new access-token. Here is an example of how to use the access-token with NodeJS:
fetch("https://api.request.finance/invoices", {
headers: {
Authorization: Bearer ${accessToken},
"X-Network": "live",
},
})

Optional: Transactional Emails

By default, we don't send transactional notifications for invoices created via API. If your users create invoices through your integration, you probably want issuers to be alerted of new invoices, and other transactional emails to be sent. In such case, please get in touch here or via the Intercom chat, and share your Client ID with the Request Finance team.
Last modified 23d ago