Learn how to retrieve any data in your Ledger.
:collection
refers to the collection of data you want to query. There are currently only 3 collections in Blnk:
/search/ledgers
)./search/balances
)./search/transactions
)./search/balances
:
Field | Description | Required | Example |
---|---|---|---|
q | The query text to search for in the collection. Learn more about querying. | Yes | "*" returns all records in the transaction. |
filter_by | Filter conditions for refining your results. | No | balance:>1000 returns all ledger balances with their balance value greater than “1000.” |
sort_by | Sorting conditions that will be used to order your results. | No | created_at:desc orders the results in by the “created_at” field in descending order. |
page | The page number of your results. | No | 2 returns the second page of the results. |
per_page | The number of results per page. | No | 50 returns only 50 results on one page; to see the rest (if any), you’ll need to move to the next page. |
Field | Description |
---|---|
found | Number of documents that match your search query and filtering conditions. |
out_of | Number of documents that match only your search query. |
page | The page being displayed to you. |
request_params | Your request payload. |
search_time_ms | Time it took for the search query to execute, usually in ms. |
hits | Contains an array of your search results. |
document | Represents the actual search result item. |
clause
consists of a field
followed by an operator
and then a value
.
Terms | Example | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
clause | "q": "*" | |||||||||
field | "q" | |||||||||
operator | : | |||||||||
value | "*" |
"filter_by": "balance:>1000"
means quotes are required because the value is a string."per_page": 50
doesn’t need quotes because it is a numerical value.value
part of your query clause are determined by the collection you are searching in.
There are three data collections in the current version of the Blnk Ledger — ledgers, ledger balances, and transactions.
Parameters | Sample usage | ||||||||
---|---|---|---|---|---|---|---|---|---|
name | name:World | ||||||||
ledger_id | ledger_id:=ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc | ||||||||
created_at | created_at:<2024-20-01 |
Parameters | Sample usage | ||||||||
---|---|---|---|---|---|---|---|---|---|
balance_id | balance_id:=bln_0be360ca-86fe-457d-be43-daa3f966d8f0 | ||||||||
balance | balance:[100..100000] | ||||||||
credit_balance | credit_balance:>100000 | ||||||||
debit_balance | debit_balance:=2000000 | ||||||||
currency | currency:[USD, GBP, EUR] | ||||||||
precision | precision:=100 | ||||||||
ledger_id | ledger_id:=ldg_073f7ffe-9dfd-42ce-aa50-d1dca1788adc | ||||||||
created_at | created_at:<2024-20-01 |
Parameters | Sample usage | ||||||||
---|---|---|---|---|---|---|---|---|---|
id | id:=txn_6164573b-6cc8-45a4-ad2e-7b4ba6a60f7d | ||||||||
source | source:=bln_0be360ca-86fe-457d-be43-daa3f966d8f0 | ||||||||
destination | destination:=bln_0be360ca-86fe-457d-be43-daa3f966d8f0 | ||||||||
reference | reference:=ref_001adcfgf | ||||||||
amount | amount:[2000..100000] | ||||||||
currency | currency:[USD, GBP, EUR] | ||||||||
status | status:[applied, queued] | ||||||||
created_at | created_at:<2024-20-01 | ||||||||
scheduled_for | scheduled_for:>2024-20-01 | ||||||||
allow_over_draft | allow_over_draft:!=true | ||||||||
inflight | inflight:=true |
GET by id
endpoints specific to the collection you are searching for.