| Header | Description |
|---|---|
| X-Api-Key | This is the API Key obtained in the previous step. |
| X-Api-Secret | This is the API Secret Key also obtained in the previous step and is shown once on the portal. |
| X-Api-Signature | This is the Base64 encoded HMACSHA256 signature, signed using the API Secret, of the JSON request body for all requests with a body. Not required for GET requests. |
| X-Application | The name of the application that uniquely identifies it (provided by Fiscal Harmony). |
| X-App-Station | The unique identifier for the workstation/till/operator/station/user using the third party application. The third party using this API must be able to uniquely identify each operator for audit purposes. This value should not change once set. |
| X-App-Version | The version of the application (provided by Fiscal Harmony). |
X-Api-Signature is constructed by hashing the body and the secret key together and then encrypting it. You may use the following code to perform that function:import crypto from 'crypto-js';
const hashBytes = crypto.HmacSHA256(YourBody, YourSecretKey);
const signature = crypto.enc.Base64.stringify(hashBytes);X-App-Station header is mandatory, therefore provide it to ensure that your API connections keep working without needing to re-develop your integration. The value in this header must be unique for each user or physical device operating your application.var body = pm.request.body.raw;
var key = pm.environment.get("X-Api-Key");
var secretKey = pm.environment.get("X-Api-Secret");
var hashBytes = require('crypto-js').HmacSHA256(body, secretKey);
var hashBase64 = require('crypto-js').enc.Base64.stringify(hashBytes);
pm.request.headers.add({
key: "X-Api-Signature",
value: hashBase64
});
pm.request.headers.add({
key: "X-Api-Key",
value: key
});
pm.request.headers.add({
key: "X-Application",
value: pm.environment.get("X-Application")
});
pm.request.headers.add({
key: "X-App-Station",
value: pm.environment.get("X-App-Station")
});
pm.request.headers.add({
key: "X-App-Version",
value: pm.environment.get("X-App-Version")
});
pm.request.headers.add({
key: "X-Client-Count",
value: pm.environment.get("X-Client-Count")
});