GET /companies/balance endpoint has been deprecated. This guide covers how to migrate to the new Company Balance API.
New to the Company Balance API?
API Overview
What the Company Balance API returns and how it’s structured.
API Scopes
Required scope:
company-balance:read.OAuth 2.0 Guide
End-to-end OAuth 2.0 workflow guide for Pleo integrations.
OAuth 2.0 with Postman
How to configure Postman to authenticate using OAuth 2.0 and call the Pleo API.
Standalone API Key Guide
End-to-end guide for authenticating with standalone API keys.
Standalone API Keys with Postman
How to make API calls using standalone API keys in Postman.
Getting Started
You’ll need API credentials with thecompany-balance:read scope. Unlike the legacy endpoint, which returned the balance for the company identified by your bearer token, the new endpoint takes an explicit company ID.
Key Differences
- The legacy endpoint (
GET /companies/balance) returned a single, company-level wallet balance for the company identified by your bearer token. The new endpoint (GET /v1/companies/{companyId}/balance) takes an explicitcompanyIdin the path and returns balances per account. Most companies have a single (primary) account, but the response is a list to support multi-account setups. - Monetary values are now
{ currency, value }objects instead of separate top-level fields, since currency can vary by account. - The new endpoint also reports overdraft and pending-debit information for each account, which the legacy endpoint didn’t expose.
Field Mapping
The table below maps fields from the legacyCompanyBalance model to their equivalents on an entry in the new API’s data.accounts[] list. For a company with a single account, use the entry where isPrimary is true for the closest legacy equivalent.
—: field is not available on the legacy model*: data is the same but represented differently
FAQs
What replaces GET /companies/balance?
GET /v1/companies/{companyId}/balance in the Company Balance API replaces it.- It needs the
company-balance:readscope. - The legacy endpoint used the company of the bearer token. The new endpoint takes an explicit
companyIdin the path. - It returns
404if the company is not found,410if the company accounts are closed, and502if the balance cannot be retrieved from an upstream dependency.
How is the new balance response different?
- It returns a list of balances, one for each account, not one company-level balance. Most companies have a single primary account, so the list usually has one entry.
- Monetary values are
{ currency, value }objects. Thevalueis an integer in minor units of the currency, so check how your code reads the amount. - The new endpoint also reports overdraft and pending-debit data for each account.