Node.js
import { createHmac } from "node:crypto";
// Node.js 18+. Set credentials and resource values on your server.
function required(name) {
const value = process.env[name];
if (!value) throw new Error(`Set ${name} before running this example.`);
return value;
}
const baseUrl = process.env.LEDIG_API_BASE_URL ?? "https://api-sandbox.ledig.io";
const method = "GET";
const path = `/v1/managed-businesses`;
const pathWithQuery = path;
const rawBody = "";
const headers = { "Accept": "application/json" };
const timestamp = Math.floor(Date.now() / 1000).toString();
const payload = `${timestamp}.${method}.${pathWithQuery}.${rawBody}`;
headers["x-ledig-key"] = required("LEDIG_API_KEY");
headers["x-ledig-timestamp"] = timestamp;
headers["x-ledig-signature"] = "v1=" + createHmac("sha256", required("LEDIG_API_SECRET"))
.update(payload).digest("base64");
const response = await fetch(`${baseUrl}${pathWithQuery}`, {
method,
headers,
});
const result = await response.json();
// Use result in your application; do not log credentials or upload links.
console.log(response.status);{
"status": "success",
"data": [
{
"id": "relationship_example_001",
"institutionBusinessId": "institution_example_001",
"businessId": "business_example_001",
"applicationId": "application_example_001",
"requestId": "application_request_example_001",
"name": "Example Supplies Ltd",
"segment": "standard",
"businessStatus": "pending",
"onboardingStatus": "draft",
"status": "active",
"canAct": false,
"createdAt": "2026-01-15T10:00:00.000Z",
"revokedAt": null,
"onboardingMode": "parent_managed"
}
]
}{
"status": "error",
"code": "BAD_REQUEST",
"message": "Check the request fields and try again."
}{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Authentication is required."
}{
"status": "error",
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action."
}{
"status": "error",
"code": "RATE_LIMITED",
"message": "Too many requests. Wait before trying again."
}{
"status": "error",
"code": "PROVIDER_UNAVAILABLE",
"message": "This service is temporarily unavailable. Please try again later."
}Managed businesses
List your managed businesses
View the businesses your institution currently manages.
GET
/
v1
/
managed-businesses
Node.js
import { createHmac } from "node:crypto";
// Node.js 18+. Set credentials and resource values on your server.
function required(name) {
const value = process.env[name];
if (!value) throw new Error(`Set ${name} before running this example.`);
return value;
}
const baseUrl = process.env.LEDIG_API_BASE_URL ?? "https://api-sandbox.ledig.io";
const method = "GET";
const path = `/v1/managed-businesses`;
const pathWithQuery = path;
const rawBody = "";
const headers = { "Accept": "application/json" };
const timestamp = Math.floor(Date.now() / 1000).toString();
const payload = `${timestamp}.${method}.${pathWithQuery}.${rawBody}`;
headers["x-ledig-key"] = required("LEDIG_API_KEY");
headers["x-ledig-timestamp"] = timestamp;
headers["x-ledig-signature"] = "v1=" + createHmac("sha256", required("LEDIG_API_SECRET"))
.update(payload).digest("base64");
const response = await fetch(`${baseUrl}${pathWithQuery}`, {
method,
headers,
});
const result = await response.json();
// Use result in your application; do not log credentials or upload links.
console.log(response.status);{
"status": "success",
"data": [
{
"id": "relationship_example_001",
"institutionBusinessId": "institution_example_001",
"businessId": "business_example_001",
"applicationId": "application_example_001",
"requestId": "application_request_example_001",
"name": "Example Supplies Ltd",
"segment": "standard",
"businessStatus": "pending",
"onboardingStatus": "draft",
"status": "active",
"canAct": false,
"createdAt": "2026-01-15T10:00:00.000Z",
"revokedAt": null,
"onboardingMode": "parent_managed"
}
]
}{
"status": "error",
"code": "BAD_REQUEST",
"message": "Check the request fields and try again."
}{
"status": "error",
"code": "UNAUTHORIZED",
"message": "Authentication is required."
}{
"status": "error",
"code": "FORBIDDEN",
"message": "You do not have permission to perform this action."
}{
"status": "error",
"code": "RATE_LIMITED",
"message": "Too many requests. Wait before trying again."
}{
"status": "error",
"code": "PROVIDER_UNAVAILABLE",
"message": "This service is temporarily unavailable. Please try again later."
}Required scope:
merchants:read
Select your institution in the business headers and use credentials with managed-business access. The list includes businesses still completing onboarding; canAct is false when you cannot yet act for a business. An active management relationship does not by itself mean the business or its payment services are approved. The response contains the full list without pagination. Query parameters are not accepted.