Search

Search via DB

Filter ledgers, balances, transactions, and identities with the Java SDK.

POST/{collection}/filter

Use blnk.search().filter for this operation.

Call the method

FilterCondition ledgerFilter = FilterCondition.create()
    .field("ledger_id")
    .operator("eq")
    .value("ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc");

ApiResponse<JsonNode> response = blnk.search().filter(
    FilterParams.create()
        .filters(List.of(ledgerFilter))
        .limit(10),
    "balances");
FieldTypeDescription
filtersList<
FilterCondition>
Filter conditions built with FilterCondition.
create().
logical_operatorStringCombine filters with and or or. Defaults to and.
sort_byStringField to sort by. Defaults to created_at.
sort_orderStringSort direction, asc or desc. Defaults to desc.
include_countbooleanReturn total_count in the response. Defaults to false.
limitNumberMaximum records to return. Defaults to 20, max 100.
offsetNumberRecords to skip for pagination. Defaults to 0.
collectionStringCollection to filter: ledgers, transactions, balances, or identities.

Use the filtered results

Read response.data().get("data") for matching records. Use total_count with limit and offset to paginate when include_count is true.

Response

{
  "data": [
    {
      "transaction_id": "txn_abc123",
      "amount": 15000,
      "currency": "USD",
      "status": "APPLIED",
      "source": "bln_source123",
      "destination": "bln_dest456",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total_count": 150
}
FieldTypeDescription
dataJsonNodeJSON array of matching records. Read with response.data().
get("data").get(i). Shape varies by collection.
total_countNumberTotal matching records. Only present when include_count is true.