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:

{
"token_id": "{created in Liquid web app, link above}",
"path": "/realtime",
"delegate_path": {path of api request},
"nonce": {current unix timestamp}
}

Example

/**
npm install jwt-simple
npm install axios
node example.js
*/
const jwt = require("jwt-simple");
const axios = require("axios");
const tokenId = "";
const tokenSecret = "";
const publicApiKey = "pk_xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx";
const path = `/api/v1/partner/${publicApiKey}/transactions`;
const apiBase = "https://partners.liquid.com";
const xQuoineAuth = jwt.encode(
{
token_id: tokenId,
path: "/realtime",
delegate_path: path,
nonce: Date.now(),
},
tokenSecret
);
console.log("Single use auth header: ", {
"X-Quoine-Auth": xQuoineAuth
})