401.
Credentials and permissions
Your business administrator creates API keys in the dashboard. A business can have up to ten active keys, each expiring within six months. Save the secret when creating or rotating a key; it is shown only once. Rotation replaces the old secret immediately, and revocation stops the key from working.
Keep credentials in a server-side secret manager. Do not put them in browser or mobile code, repositories, URLs or logs.
Each endpoint lists its required scope, which is the permission your key needs. Payments still need to meet your business’s service access, recipient approval, balance and limit requirements.
HMAC v1
Use v1 for requests on behalf of your own business. Send these three headers:
Build this exact UTF-8 string:
/; do not include the scheme or hostname. For a request without a body, use the empty string. For JSON, serialize once, then sign and send that same string. Whitespace, query ordering and JSON key ordering affect the signature.
Calculate the digest with your secret and standard base64 encoding. Timestamps must be within 300 seconds of server time. Keep your server clock in sync and use a fresh timestamp and signature for every attempt.
Examples
SetLEDIG_API_BASE_URL to https://api-sandbox.ledig.io to start in Sandbox. Load LEDIG_API_KEY and LEDIG_API_SECRET from your server’s secret configuration.
These examples read your USD balance. The signature and timestamp are calculated for the request; they are not API keys.
Content-Type: application/json. If the response is lost, follow the retry rules.
Act for a managed business
Use HMAC v2 when your institution makes payments or reads balances for a business it manages. V2 includes the business-selection headers in the signature.
Build the v2 payload using compact JSON, in this exact order. This Node.js helper uses the
createHmac import from the example above:
"" for an omitted header. IDs are case-sensitive. Send the resulting signature in x-ledig-signature, along with the key and timestamp headers.
V1 cannot select a managed business. Your institution must have access to that business, and your key must have the permissions required for the request.
When onboarding a managed business, keep your institution selected and put
the managed business ID in the endpoint path. You can use v1 or v2 for these
requests. See Managed businesses.