Search

Search via DB

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

POST/{collection}/filter

Use Filter on the relevant service to query records in a collection. The Go SDK does not expose a unified Search.filter helper like the TypeScript SDK.

Call the method

result, _, _ := client.Transaction.Filter(
 blnkgo.FilterParams{
	Filters: []blnkgo.Filter{
	 {
		Field: "status",
		Operator: blnkgo.OpEqual,
		Value: "APPLIED",
	 },
	},
	SortBy: "created_at",
	SortOrder: "desc",
	IncludeCount: true,
	Limit: 20,
	Offset: 0,
 },
)
FieldTypeDescription
Filters[]blnkgo.FilterArray of filter conditions, each with a Field, Operator, and a Value or Values.
SortBystringField to sort by. Defaults to created_at.
SortOrderstringSort direction, asc or desc. Defaults to desc.
IncludeCountboolReturn TotalCount in the response. Defaults to false.
LimitintMaximum records to return. Defaults to 20, max 100.
OffsetintRecords to skip for pagination. Defaults to 0.

Response

{
  "data": [
    {
      "transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
      "amount": 15000,
      "currency": "USD",
      "status": "APPLIED",
      "source": "bln_source123",
      "destination": "bln_dest456",
      "created_at": "2024-01-15T10:30:00Z"
    }
  ],
  "total_count": 150
}

Go response (*blnkgo.FilterResponse)

FieldTypeDescription
Datainterface{}Array of matching records. Shape varies by collection.
TotalCount*int64Total matching records. Only present when IncludeCount is true.