Skip to content
OpenTrain AIOpenTrain AIOpenTrain AIDocs

Ask OpenTrain

Answers from the documentation, with sources.

What would you like to do with OpenTrain?

AI answers can be mistaken. Check the linked sources. Don’t include private account information.

Open app

DEVELOPER DOCUMENTATION

List Credit Ledger

Page through the credit transaction history: top-ups, escrow holds, hold releases, captures, refunds, and adjustments.

GET/api/public/v1/credits/ledger

Lists every credit ledger entry on your account, newest first, with cursor pagination. Each entry links the related top-up, proposal, contract, or milestone so you can reconcile balance changes against the actions that caused them.

amountCents is signed: positive entries add to the available balance, negative entries draw from it. Accounts that have never used credits get an empty page (not a 404).

Requirements: payments:read scope + the public_api_credits feature. Works pre-claim.

typeMeaning
TOP_UPA completed top-up added funds
HOLDFunds reserved into escrow (hire or milestone funding)
HOLD_RELEASEA hold returned to the available balance (e.g. milestone cancelled)
CAPTUREHeld funds paid out (milestone released)
REFUNDFunds returned to the account
ADJUSTMENTManual correction by OpenTrain
cursorstringquery

Opaque cursor from a previous response’s nextCursor. Omit for the first page.

limitintegerquery
Default: 50

Page size, 1–100. Out-of-range values return 400.

entriesobject[]
ledger entry
idstring

Ledger entry ID.

typestring

One of the entry types above.

amountCentsnumber

Signed amount in US cents.

createdAtstring

ISO timestamp.

holdEntryIdstring | null

For HOLD_RELEASE/CAPTURE, the originating HOLD entry.

jobofferIdstring | null

Related proposal, when the entry came from a hire.

contractIdstring | null

Related contract.

milestoneIdstring | null

Related milestone.

topUpIdstring | null

Related top-up, for TOP_UP entries.

notestring | null

Free-text note (mostly on ADJUSTMENT entries).

nextCursorstring | null

Pass as cursor to fetch older entries; null at the end of the ledger.

StatuscodeMeaning
400BAD_REQUESTlimit outside 1–100 (details: {field: "limit"})
401UNAUTHORIZEDMissing or invalid token
403FORBIDDENMissing payments:read scope, or public_api_credits disabled