UserLedgerEntries

List balance movements

Returns the individual entries behind your account balance: refills, payments, and label/subscription charges, each with the running balance immediately after it -- your account statement.

Reads directly from the account's own records, so a just-booked entry appears immediately.

Two ways to page through results: page/per_page for browsing a bounded range, or before_id for walking a large account's full history -- see the before_id parameter below.

get/user_ledger_entries

Query parameters

created_at_minstring date-time

"From" timestamp for the entries to be included in the filter. Examples:

  • 2017-06-19T11:00:03.305+02:00
  • 2017-06-19 will be transformed into 2017-06-19T00:00:00.000+02:00

Date filters are intended for recent periods. A narrow window far in the past is slow to query on a large account regardless of how few rows it matches; walking a long history should use before_id instead of a date range.

created_at_maxstring date-time

"To" timestamp for the entries to be included in the filter. Examples:

  • 2017-06-29T11:00:03.305+02:00
  • 2017-06-29 will be transformed into 2017-06-29T00:00:00.000+02:00

Same caveat as created_at_min: prefer before_id over a narrow historical date range on a large account.

reference_type'shipment' | 'payment_request' | 'payment_requests' | 'generic_payment' | 'generic_payments' | 'sales_header' | 'subscription_period' | 'shipment_case'

Restrict to entries relating to this kind of record.

source_type'sales_document' | 'transaction'

Restrict to charges (sales_document) or refills/payments (transaction).

settlement_idinteger

Restrict to the entry settling this entry ID.

per_pageinteger

For pagination. Defines how many entries are returned per page. Capped at 50 with page, or at 500 when paging with before_id instead.

pageinteger

For pagination. Defines which page the results are fetched from. Ignored when before_id is present.

before_idinteger

Returns entries with an id lower than this one, most recent first -- cursor pagination. Takes precedence over page when both are given. Unlike page/per_page, cost is constant regardless of how deep into an account's history you page, since it filters by id directly instead of skipping and discarding rows. Use this to walk a large account's full history; use page/per_page to browse a bounded, recent range. The response's X-Next-Before-Id header, present whenever a full page was returned, is the value to pass for the next page.

Response

Successful.

idinteger

Unique identifier of the object.

created_atstring date-time

When the entry was booked.

amountstring nullable

Signed movement in the account's own currency. Positive for a refill or payment, negative for a charge.

currency_codestring nullable

ISO 4217 currency code.

balancestring nullable

The account's running balance immediately after this entry.

descriptionstring nullable

Human readable description of the entry, in the account's own language.

reference_type'shipment' | 'payment_request' | 'payment_requests' | 'generic_payment' | 'generic_payments' | 'sales_header' | 'subscription_period' | 'shipment_case' nullable

What the entry relates to. Null when the entry has no reference.

reference_idinteger nullable

ID of the record named by reference_type, in that record's own resource.

source_type'sales_document' | 'transaction' nullable

Whether the entry is a charge (sales_document) or a refill/payment (transaction). Null for an entry with no source record.

settlement_idinteger nullable

ID of the entry this one settles, when applicable. Null for most entries.

Example response

[
  {
    "id": 8172345,
    "amount": "-49.00",
    "currency_code": "DKK",
    "balance": "451.00",
    "description": "Shipment #123456"
  }
]

Changes