Step 1 of 5
Get started
See what you need to integrate: your integration details as environment variables, the sandbox, Swagger and Insight.
What you need
- Your integration's details. Its ID, issuer URL, account ID, key ID and key material. You sign a JWT with them to get tokens from Vanguard.
- The sandbox. Build and test against it: the Invoice API is at
https://api.sandbox.waya.se/v4/restand Vanguard athttps://vanguard.sandbox.waya.se/v2.0. Go live has the production URLs. - A client that can make HTTPS calls. The code samples are in Java, Node.js, Python and C#, and the calls are also shown with
curl. - Swagger. Every operation and model of the Invoice Tools API is described in its Swagger (opens in a new tab). Its try-it-out needs an authorization token.
- Insight. Look up the invoices your integration creates in Insight.
Environment variables
The code samples in these docs read their settings from environment variables. Put them in a .env file:
WAYA_INTEGRATION_ID=your-integration-id
WAYA_ISSUER_URL=your-issuer-url
WAYA_ACCOUNT_ID=your-account-id
WAYA_KEY_ID=your-key-id
WAYA_KEY_MATERIAL=your-key-material
WAYA_VANGUARD_URL=https://vanguard.sandbox.waya.se/v2.0
WAYA_API_URL=https://api.sandbox.waya.se/v4/rest
The first five values are the details of your integration. Sign a JWT shows where each one goes. WAYA_VANGUARD_URL and WAYA_API_URL are the sandbox base URLs.
Load the file with your framework's dotenv support, or in a shell:
set -a; source .env; set +a
Authorization tokens
Every call to the Invoice Tools API needs an authorization token from Vanguard. You get one in three steps:
- Sign a JWT with your key material.
- Send the JWT to Vanguard to get an authentication token, which lasts about a week.
- Use the authentication token to authorize your account. Vanguard returns an authorization token, which lasts about 24 hours.
Insight
Insight is Waya's web application, where you can look up the invoices your integration creates. Open Insight in the sandbox (opens in a new tab).
With your environment variables in place, continue with Authentication. It explains each step with code, and ends with your first call to the Invoice API.