Accounts: API examples

Contract-derived requests, potential responses and API links for accounts.

Generated from the public OpenAPI. Examples illustrate the contract and are not live results. Use your assigned gateway, credentials and identifiers. The snippets do not execute automatically.

Use Node.js 22 or later. Copy the setup below into an .mjs file, set QFP_BASE_URL and QFP_ACCESS_TOKEN, then append the operation snippet you need. No repository checkout or downloaded client is required. Keep secrets in your backend and persist each write key and body before sending.

Request setup

const required = name => {
  const value = process.env[name];
  if (!value) throw new Error(`Set ${name} before running this example`);
  return value;
};
const baseUrl = required('QFP_BASE_URL').replace(/\/$/, '');
if (!/^https:\/\//.test(baseUrl)) throw new Error('Use your assigned HTTPS gateway');
const token = required('QFP_ACCESS_TOKEN');
const segment = value => encodeURIComponent(value);
async function request(method, path, body, key) {
  const headers = { Authorization: `Bearer ${token}`, 'API-Version': '1.0.0', Accept: 'application/json' };
  if (key) headers['Idempotency-Key'] = key;
  const multipart = body instanceof FormData;
  if (body !== undefined && !multipart) headers['Content-Type'] = 'application/json';
  const response = await fetch(baseUrl + path, {
    method, headers, body: body === undefined ? undefined : multipart ? body : JSON.stringify(body),
    signal: AbortSignal.timeout(30_000), redirect: 'error',
  });
  const text = await response.text();
  const data = text && response.headers.get('content-type')?.includes('json') ? JSON.parse(text) : text || null;
  if (!response.ok) {
    const error = new Error(`HTTP ${response.status}`);
    Object.assign(error, { status: response.status, data, headers: response.headers });
    throw error;
  }
  return { status: response.status, data };
}

registerAccount

Register an account. API Reference · Integration guide

POST /api/accounts

ParameterLocationRequired
API-VersionheaderYes
Idempotency-KeyheaderYes

Request body: default

{
  "customerRef": "CUST-0001",
  "accountRef": "ACC-0001",
  "assetId": "GBP"
}
const body = {
  "customerRef": "CUST-0001",
  "accountRef": "ACC-0001",
  "assetId": "GBP"
};
const result = await request('POST', '/api/accounts', body, required('QFP_IDEMPOTENCY_KEY'));
console.log(result.status, result.data);

Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.

Potential responses

Documented statuses: 202, 400, 401, 404, 409, 422, 500.

Example 202 (default); see the reference for other outcomes.

{
  "accountRef": "ACC-0001",
  "customerRef": "CUST-0001",
  "assetId": "GBP",
  "status": "PENDING",
  "createdAt": "2026-08-03T09:29:10.285Z",
  "updatedAt": "2026-08-03T09:29:10.285Z"
}

For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.

listAccounts

List accounts. API Reference · Integration guide

GET /api/accounts

ParameterLocationRequired
API-VersionheaderYes
customerRefqueryNo
statusqueryNo
assetIdqueryNo
pagequeryNo
sizequeryNo
const body = undefined;
const result = await request('GET', '/api/accounts', body, undefined);
console.log(result.status, result.data);

Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.

Potential responses

Documented statuses: 200, 400, 401, 500.

Example 200 (default); see the reference for other outcomes.

{
  "content": [
    {
      "accountRef": "ACC-0001",
      "customerRef": "CUST-0001",
      "assetId": "GBP",
      "status": "ACTIVE",
      "walletAddress": "0x4E55aD154FFfE514D7dEF1658dEbe593907121ae",
      "createdAt": "2026-08-03T09:29:10.285Z",
      "updatedAt": "2026-08-03T09:29:14.911Z"
    }
  ],
  "page": 0,
  "size": 20,
  "totalElements": 1,
  "totalPages": 1
}

For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.

getAccount

Get an account. API Reference · Integration guide

GET /api/accounts/{accountRef}

ParameterLocationRequired
API-VersionheaderYes
accountRefpathYes
const body = undefined;
const result = await request('GET', '/api/accounts/' + encodeURIComponent('<accountRef>') + '', body, undefined);
console.log(result.status, result.data);

Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.

Potential responses

Documented statuses: 200, 401, 404, 500.

Example 200 (provisioned); see the reference for other outcomes.

{
  "accountRef": "ACC-0001",
  "customerRef": "CUST-0001",
  "assetId": "GBP",
  "status": "ACTIVE",
  "walletAddress": "0x4E55aD154FFfE514D7dEF1658dEbe593907121ae",
  "createdAt": "2026-08-03T09:29:10.285Z",
  "updatedAt": "2026-08-03T09:29:14.911Z"
}

For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.

updateAccountStatus

Activate or deactivate an account. API Reference · Integration guide

PATCH /api/accounts/{accountRef}

ParameterLocationRequired
API-VersionheaderYes
accountRefpathYes
Idempotency-KeyheaderYes

Request body: default

{
  "status": "INACTIVE"
}
const body = {
  "status": "INACTIVE"
};
const result = await request('PATCH', '/api/accounts/' + encodeURIComponent('<accountRef>') + '', body, required('QFP_IDEMPOTENCY_KEY'));
console.log(result.status, result.data);

Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.

Potential responses

Documented statuses: 200, 400, 401, 404, 409, 422, 500.

Example 200 (default); see the reference for other outcomes.

{
  "accountRef": "ACC-0001",
  "customerRef": "CUST-0001",
  "assetId": "GBP",
  "status": "INACTIVE",
  "walletAddress": "0x4E55aD154FFfE514D7dEF1658dEbe593907121ae",
  "createdAt": "2026-08-03T09:29:10.285Z",
  "updatedAt": "2026-08-03T09:36:02.551Z"
}

For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.

control

Freeze or unfreeze an account. API Reference · Integration guide

POST /api/accounts/{accountRef}/controls

ParameterLocationRequired
API-VersionheaderYes
accountRefpathYes
Idempotency-KeyheaderYes

Request body: freeze

{
  "operation": "FREEZE",
  "reason": "Sanctions screening hit \u2014 case CMP-4471"
}

Request body: unfreeze

{
  "operation": "UNFREEZE",
  "reason": "Sanctions review cleared \u2014 case CMP-4471"
}
const body = {
  "operation": "FREEZE",
  "reason": "Sanctions screening hit \u2014 case CMP-4471"
};
const result = await request('POST', '/api/accounts/' + encodeURIComponent('<accountRef>') + '/controls', body, required('QFP_IDEMPOTENCY_KEY'));
console.log(result.status, result.data);

Replace angle-bracket placeholders before calling. Persist any idempotency key with the business instruction.

Potential responses

Documented statuses: 200, 202, 400, 401, 404, 500.

Example 200 (default); see the reference for other outcomes.

{
  "transactionId": "7d6c1a90-5d2e-4b08-9a41-6c2b8e5d7f13",
  "accountRef": "ACC-0001",
  "operation": "FREEZE",
  "state": "BATCHED",
  "createdAt": "2026-09-21T09:36:02.551Z",
  "updatedAt": "2026-09-21T09:37:11.008Z"
}

For CSV/download endpoints, the response may be text rather than JSON. The request helper preserves that distinction.


Did this page help you?