cURL
curl --request GET 'https://api.integrateledger.com/v1/entities/alice?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.getEntity({ entityId: "alice", customerId: "user_123" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.get_entity(customer_id="user_123", entity_id="alice"){
"entityId": "<string>",
"customerId": "<string>",
"name": "<string>",
"allowanceCredits": 123,
"capCredits": 1,
"createdAt": "2023-11-07T05:31:56Z",
"availableCredits": 1,
"allowanceRemaining": 1,
"periodUsage": 1,
"capRemaining": 1,
"heldCredits": 1,
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"plans": [
{
"planId": "<string>",
"group": "<string>",
"status": "pending",
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z"
}
],
"seats": [
{
"planId": "<string>",
"slot": 123
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "insufficient_permissions",
"requiredScope": "customers:read",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "rate_limited",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}Entities
Get an entity
Read one entity’s settings, allowance left and cap left this billing period.
GET
/
v1
/
entities
/
{entityId}
cURL
curl --request GET 'https://api.integrateledger.com/v1/entities/alice?customerId=user_123' \
-H "Authorization: Bearer $LEDGER_API_KEY"import ledger from "integrateledger";
const client = new ledger({ apiKey: process.env.LEDGER_API_KEY ?? "" });
await client.getEntity({ entityId: "alice", customerId: "user_123" });import os
from integrateledger import ledger
client = ledger(api_key=os.environ["LEDGER_API_KEY"])
client.get_entity(customer_id="user_123", entity_id="alice"){
"entityId": "<string>",
"customerId": "<string>",
"name": "<string>",
"allowanceCredits": 123,
"capCredits": 1,
"createdAt": "2023-11-07T05:31:56Z",
"availableCredits": 1,
"allowanceRemaining": 1,
"periodUsage": 1,
"capRemaining": 1,
"heldCredits": 1,
"periodStart": "2023-11-07T05:31:56Z",
"periodEnd": "2023-11-07T05:31:56Z",
"plans": [
{
"planId": "<string>",
"group": "<string>",
"status": "pending",
"startsAt": "2023-11-07T05:31:56Z",
"endsAt": "2023-11-07T05:31:56Z"
}
],
"seats": [
{
"planId": "<string>",
"slot": 123
}
]
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "insufficient_permissions",
"requiredScope": "customers:read",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "rate_limited",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}{
"error": "<string>",
"message": "No customer \"user_123\" exists in this environment. Create it with POST /v1/customers, or check that the API key is for the right environment."
}Returns the entity’s settings and where it stands in the customer’s current billing period (
periodStart to periodEnd):
availableCredits: what it can spend now, its allowance left plus the shared credits it may still draw under its cap.allowanceRemaining: its own allowance left, after what its reservations hold.periodUsage: shared credits and overage it drew this period.capRemaining: shared credits it may still draw (null without a cap), after what its reservations hold.heldCredits: what its active reservations hold.
404 entity_not_found. Needs the Customers permission at Read.Authorizations
Path Parameters
Query Parameters
Response
The entity's settings and balance