X-Quoine-Auth

Create User API Token

A user API token must be created to be able to use this endpoint. This user must be the configured user for the partner api key. Refer to help article on creating tokens: https://help.liquid.com/en/articles/2285018-how-to-create-api-tokens
This token only requires the view Accounts View permission.
Creating an API token in the Liquid web app provides two variables: tokenId and tokenSecret.

Encode and Sign JWT

After creating the API toke/secret above, the next step is to create a signed JWT.
To generate X-Quoine-Auth (signed JWT string), encode and sign the following payload:
1
{
2
"token_id": "{created in Liquid web app, link above}",
3
"path": "/realtime",
4
"delegate_path": {path of api request},
5
"nonce": {current unix timestamp}
6
}
Copied!

Example

1
/**
2
npm install jwt-simple
3
npm install axios
4
node example.js
5
*/
6
7
8
const jwt = require("jwt-simple");
9
const axios = require("axios");
10
11
const tokenId = "";
12
const tokenSecret = "";
13
const publicApiKey = "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
14
const path = `/api/v1/partner/${publicApiKey}/transactions`;
15
16
const apiBase = "https://partners.liquid.com";
17
18
const xQuoineAuth = jwt.encode(
19
{
20
token_id: tokenId,
21
path: "/realtime",
22
delegate_path: path,
23
nonce: Date.now(),
24
},
25
tokenSecret
26
);
27
28
console.log("Single use auth header: ", {
29
"X-Quoine-Auth": xQuoineAuth
30
})
Copied!
Last modified 4mo ago