Skip to main content
GET
/
api
/
ledger
/
v2
/
{ledger}
/
transactions
List transactions from a ledger
curl --request GET \
  --url http://localhost/api/ledger/v2/{ledger}/transactions \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{}'
{
  "cursor": {
    "pageSize": 15,
    "hasMore": false,
    "data": [
      {
        "timestamp": "2023-11-07T05:31:56Z",
        "postings": [
          {
            "amount": 100,
            "asset": "COIN",
            "destination": "users:002",
            "source": "users:001"
          }
        ],
        "metadata": {
          "admin": "true"
        },
        "id": 1,
        "reverted": true,
        "insertedAt": "2023-11-07T05:31:56Z",
        "updatedAt": "2023-11-07T05:31:56Z",
        "reference": "ref:001",
        "revertedAt": "2023-11-07T05:31:56Z",
        "preCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "preCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        },
        "postCommitEffectiveVolumes": {
          "orders:1": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          },
          "orders:2": {
            "USD": {
              "input": 100,
              "output": 10,
              "balance": 90
            }
          }
        }
      }
    ],
    "previous": "YXVsdCBhbmQgYSBtYXhpbXVtIG1heF9yZXN1bHRzLol=",
    "next": ""
  }
}
Retrieve a paginated list of transactions from the ledger, sorted by ID in descending order (newest first).

Parameters

ledger: The name of the ledger to query transactions from. (e.g., ledger001) pageSize: Number of transactions to return per page. Defaults to 15, maximum 1000. (e.g., 100) cursor: Pagination cursor from a previous response. Use the next or previous value from the response to navigate pages. (e.g., aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ==) expand: Include additional data in the response. Use volumes to include account volume changes for each transaction. (e.g., volumes) pit: Point-in-time query. Returns the ledger state as it existed at this timestamp. Useful for historical queries and audit trails. (e.g., 2024-01-15T10:30:00Z) order: Deprecated: Use the sort parameter instead. reverse: When true, returns results in ascending order (oldest first) instead of descending.

Request Body

Filter criteria. Use $match to filter by account, metadata, reference, or other fields. See Filtering Queries for full syntax. Example:
{
  "$match": {
    "account": "users:john:wallet"
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

ledger
string
required

Name of the ledger.

Example:

"ledger001"

Query Parameters

pageSize
integer<int64>

The maximum number of results to return per page.

Required range: 1 <= x <= 1000
cursor
string

Parameter used in pagination requests. Maximum page size is set to 15. Set to the value of next for the next page of results. Set to the value of previous for the previous page of results. No other parameters can be set when this parameter is set.

Example:

"aHR0cHM6Ly9nLnBhZ2UvTmVrby1SYW1lbj9zaGFyZQ=="

expand
string
pit
string<date-time>
order
enum<string>

Deprecated: Use sort param

Available options:
effective
reverse
boolean
sort
string

Sort results using a field name and order (ascending or descending). Format: <field>:<order>, where <field> is the field name and <order> is either asc or desc.

Example:

"id:desc"

Body

application/json

The body is of type object.

Response

OK

cursor
object
required