LedgerBee Developer
  • Getting started
  • Conventions
  • Products
  • Configuration
  • API Reference
Information
Accounts
    List accountsget
API Key
    Get current API keyget
Company
    Get company detailsget
Credit Notes
    List credit notesgetCreate a credit notepostGet a credit notegetGet the delivery status of a credit notegetDownload the credit note PDFgetSend a credit note to the customerpost
Customers
    List customersgetCreate a customerpostGet a customergetUpdate a customerpatchList a customer's contactsgetList a customer's departmentsgetList customer groupsget
Dimensions
    List all dimensionsgetCreate a new dimension categorypostGet a dimensiongetUpdate a dimension categoryputDelete a dimension categorydeleteCreate a new dimension valuepostUpdate a dimension valueputDelete a dimension valuedelete
Document Templates
    List document templatesget
Draft Journal Entries
    Create multiple draft journal entries in batchpostList draft journal entriesgetCreate a draft journal entrypostGet a draft journal entrygetDelete a draft journal entrydeleteBook a draft journal entrypost
Draft Journal Entries (v2)
    Create draft journal entries in batch (v2)postList draft journal entries (v2)getCreate a draft journal entry (v2)postGet a draft journal entry (v2)getDelete a draft journal entry (v2)deleteUpdate a draft journal entry (v2)patchBook a draft journal entry (v2)post
Entitlements
    List entitlementsgetCreate an entitlementpostGet an entitlementgetDelete an entitlementdeleteUpdate an entitlementpatch
Invoices
    List invoicesgetCreate a draft invoicepostGet an invoicegetGet the delivery status of an invoicegetDownload the invoice PDFgetSend an invoice to the customerpost
Journal Categories
    List journal categoriesget
Journal Entries
    Create multiple journal entries in batchpostList journal entriesgetCreate a journal entrypostGet a journal entrygetUpdate a journal entry — correct the reference and/or set your external system idpatchGet attachments for a journal entrygetReverse posted journal entries in batchpostReverse a posted journal entrypost
Journal Entries (v2)
    Create a journal entry (v2)postCreate journal entries in batch (v2)post
MCP
    LedgerBee Developer MCP Serverpost
Meters
    List meter subscriptions by IDgetReport usagepostList meter subscriptions by nameget
Order Confirmations
    List order confirmationsgetCreate a draft order confirmationpostGet an order confirmationgetUpdate a draft order confirmationpatchConvert an order confirmation into an invoicepostDownload an order confirmation as PDFgetSend an order confirmationpost
Payment Methods
    List saved payment methods for a customergetCancel a saved card on the payment providerdeleteUnassign a payment method from a customerdeleteGenerate a link for the customer to save a card for future paymentspostSet a saved payment method as the customer defaultput
Portal Plans
    List the full plan cataloguegetGet a plangetResolve the gated pricing catalogue for an identified buyer (partner display)post
Portal SSO
    Get a tenant's SSO signing keys (JWKS)getMint a customer-portal SSO handoff referencepostProvision a customer + grant portal access (partner JIT provisioning)postRevoke (force-refresh) a user's customer-portal sessionspost
Product Groups
    List product groupsgetCreate a product grouppostGet a product groupgetDelete a product groupdeleteUpdate a product grouppatch
Product Prices
    Create a product pricepostGet a product pricegetDelete a product pricedeleteUpdate a product pricepatchActivate a product pricepostArchive a product pricepostDisable a product pricepostSet a price as the product defaultpost
Products
    List productsgetCreate a productpostGet a productgetDelete a productdeleteUpdate a productpatch
Projects
    List all projectsgetCreate or update a project by external referenceputCreate a projectpostGet a projectgetUpdate a projectputGet project profitgetAdd a subprojectpostUpdate a subprojectputDelete a subprojectdelete
Quotes
    List quotesgetCreate a draft quotepostGet a quotegetUpdate a draft quotepatchConvert a quotepostDownload a quote as PDFgetSend a quotepost
Subscriptions
    List customer subscriptionsgetAssign a subscription to a customerpostGet a customer subscription by its stable idgetUpdate a customer subscriptionpatchRetry a failed card paymentpostList a subscription's pending scheduled changesgetCancel a single pending scheduled changedeleteCancel a customer subscriptionpostList subscription plansgetCreate a subscription planpostArchive a subscription planpost
Suppliers
    List suppliersgetCreate a supplierpostList supplier contactsgetList supplier departmentsgetList supplier groupsget
VAT Codes
    List VAT codesget
Vendors
    List vendorsgetCreate a vendorpostList vendor contactsgetList vendor departmentsgetList vendor groupsget
Webhook Endpoints
    List webhook endpointsgetCreate a webhook endpointpostRetrieve a webhook endpointgetUpdate a webhook endpointputDelete a webhook endpointdeleteRoll the signing secretpostSend a test eventpost
Schemas
LedgerBee Public API
LedgerBee Public API

Meters

Download schema

Meter and usage reporting endpoints


List meter subscriptions by ID

GET
https://api.ledgerbee.com/api
/v1/meters/{meterId}/subscriptions
x-api-key (header)
or
OAuth 2.0

Looks up a meter by its UUID and returns the subscriptions (with their products) that can report usage to it — i.e. subscriptions holding a product whose price is linked to this meter. Paused subscriptions are excluded.

Returns an empty subscriptions array when no product price uses the meter. Responds 404 with code METER_NOT_FOUND if the meter does not exist in your company.

Required Scope

  • meter-report

Required License

  • Metered Products and Subscription — the tenant must hold both module licenses, or the request returns 403 LICENSE.REQUIRED.

List meter subscriptions by ID › path Parameters

meterId
​string · required

The unique identifier of the meter

Example: 550e8400-e29b-41d4-a716-446655440000

List meter subscriptions by ID › Responses

Subscriptions and products that can report usage to this meter

MeterSubscriptionsResponseDTO
meterId
​string · required

Meter ID

Example: 550e8400-e29b-41d4-a716-446655440000
meterName
​string · required

Meter name

Example: api_calls
​MeterSubscriptionDTO[] · required

Subscriptions with products using this meter

GET/v1/meters/{meterId}/subscriptions
curl https://api.ledgerbee.com/api/v1/meters/:meterId/subscriptions \ --header 'x-api-key: <api-key>'
Example Responses
{ "meterId": "550e8400-e29b-41d4-a716-446655440000", "meterName": "api_calls", "subscriptions": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Enterprise Plan", "status": "active", "products": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "API Calls Package", "productNumber": "PROD-001" } ] } ] }
json
application/json

Report usage

POST
https://api.ledgerbee.com/api
/v1/meters/report
x-api-key (header)

Reports a usage event to a meter for metered subscription billing. Ingestion is asynchronous: a successful report returns 202 with status: queued and a requestId — the event is not yet visible the moment the call returns.

The Idempotency-Key header is required (400 when missing). Replaying a request with the same key returns 200 with status: duplicate and the event is not ingested twice, so retries are always safe.

Use the meter-subscriptions endpoints to discover which subscriptions and products can report usage to a given meter.

How usage is aggregated

Each meter has an aggregation method, fixed when the meter is created, that determines how the events you report become the single quantity billed for the period:

  • sum — adds every reported value together (e.g. tokens used, GB transferred).
  • count — counts how many events you report; the value you send is ignored.
  • last — uses the value of the most recent event in the period, by event timestamp (e.g. a current seat count).

value is always required by this endpoint, but for a count meter it is not used in the calculation — send any non-negative number.

The aggregation method can't be changed once usage has been reported to a meter; create a new meter to bill the same events a different way.

Required Scope

  • meter-report

Required License

  • Metered Products — the tenant must also hold this module license, or the request returns 403 LICENSE.REQUIRED.

Report usage › Headers

x-api-idempotency-key
​string · maxLength: 255 · required

Idempotency key to deduplicate submissions

Report usage › Request Body

UsageReportRequestDto
value
​number · required

The numeric value of this usage event. How it is used depends on the meter's aggregation method: summed (sum) or taken as the latest value (last). For count meters the value is ignored, but a non-negative number is still required.

Example: 100
customerId
​string · required

Customer ID this usage is associated with.

Example: 550e8400-e29b-41d4-a716-446655440000
meterId
​string

Meter identifier. Provide meterId or meterName. Meter must be ACTIVE; usage will be rejected for archived meters.

Example: 550e8400-e29b-41d4-a716-446655440000
meterName
​string

Meter name. Provide meterId or meterName. Meter must be ACTIVE; usage will be rejected for archived meters.

Example: api_calls
timestamp
​string

ISO-8601 timestamp. Defaults to now.

Example: 2024-01-15T10:30:00Z
metadata
​object

Additional metadata for the usage event (values must be string, number, or boolean)

Example: {"region":"us-east-1","feature":"api-calls"}

Report usage › Responses

Duplicate request detected

status
​string
idempotencyKey
​string
POST/v1/meters/report
curl https://api.ledgerbee.com/api/v1/meters/report \ --request POST \ --header 'Content-Type: application/json' \ --header 'x-api-idempotency-key: <string>' \ --header 'x-api-key: <api-key>' \ --data '{ "meterId": "550e8400-e29b-41d4-a716-446655440000", "meterName": "api_calls", "value": 100, "timestamp": "2024-01-15T10:30:00Z", "customerId": "550e8400-e29b-41d4-a716-446655440000", "metadata": { "region": "us-east-1", "feature": "api-calls" } }'
Example Request Body
{ "meterId": "550e8400-e29b-41d4-a716-446655440000", "meterName": "api_calls", "value": 100, "timestamp": "2024-01-15T10:30:00Z", "customerId": "550e8400-e29b-41d4-a716-446655440000", "metadata": { "region": "us-east-1", "feature": "api-calls" } }
json
application/json
Example Responses
{ "status": "duplicate", "idempotencyKey": "idempotencyKey" }
json
application/json

List meter subscriptions by name

GET
https://api.ledgerbee.com/api
/v1/meters/subscriptions
x-api-key (header)
or
OAuth 2.0

Looks up a meter by its name (?meterName=) and returns the subscriptions (with their products) that can report usage to it — useful when your integration knows the meter's name (e.g. api_calls) but not its UUID. Paused subscriptions are excluded.

Returns an empty subscriptions array when no product price uses the meter. Responds 400 with code METER_IDENTIFIER_REQUIRED when meterName is missing, and 404 with code METER_NOT_FOUND if no meter has that name in your company.

Required Scope

  • meter-report

Required License

  • Metered Products and Subscription — the tenant must hold both module licenses, or the request returns 403 LICENSE.REQUIRED.

List meter subscriptions by name › query Parameters

meterName
​string · required

The name of the meter to look up

List meter subscriptions by name › Responses

Subscriptions and products that can report usage to this meter (lookup by name)

MeterSubscriptionsResponseDTO
meterId
​string · required

Meter ID

Example: 550e8400-e29b-41d4-a716-446655440000
meterName
​string · required

Meter name

Example: api_calls
​MeterSubscriptionDTO[] · required

Subscriptions with products using this meter

GET/v1/meters/subscriptions
curl 'https://api.ledgerbee.com/api/v1/meters/subscriptions?meterName=<string>' \ --header 'x-api-key: <api-key>'
Example Responses
{ "meterId": "550e8400-e29b-41d4-a716-446655440000", "meterName": "api_calls", "subscriptions": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Enterprise Plan", "status": "active", "products": [ { "id": "550e8400-e29b-41d4-a716-446655440000", "name": "API Calls Package", "productNumber": "PROD-001" } ] } ] }
json
application/json

MCPOrder Confirmations