Overview
In simple terms, a parent transaction is a transaction that generates another transaction in your ledger. Blnk records the ID of this parent transaction in theparent_transaction field of the new (child) transaction. This creates a clear lineage of transactions, allowing you to trace a transaction back to its origin, see how it evolved, and connect it to any related siblings.
transaction.json
Because transactions in Blnk are immutable, each status change creates a new transaction record. This new record references the previous one through the
parent_transaction field, preserving the full history.Single transaction
Consider a single $100 transaction in your ledger. Its lifecycle might look like this:
- When the transaction is first created, it starts in the
QUEUEDstate. - Once Blnk processes it, a new transaction is created in the
APPLIEDstate. - The initial
QUEUEDtransaction becomes the parent of the newAPPLIEDtransaction.
Inflight transaction
Consider an inflight transaction of $100. Its lifecycle looks like this:
- When the transaction is created, it starts in the
QUEUEDstate. - Once Blnk processes it, a new transaction is created in the
INFLIGHTstate. - The initial
QUEUEDtransaction becomes the parent of the newINFLIGHTtransaction. - Once the inflight transaction is committed, a new transaction is created in the
APPLIEDstate. - If the inflight transaction is voided instead, a new transaction is created in the
VOIDstate. - The
INFLIGHTtransaction becomes the parent of theAPPLIEDand/orVOIDtransactions.
INFLIGHT record as the parent, you can retrieve the complete outcome of that transaction by querying for all transactions whose parent_transaction field matches the INFLIGHT transaction ID:
cURL
Queued parent transactions
A queued parent transaction refers to the very first transaction in a chain — the one that initiates the entire transaction lifecycle. In most cases, this initial transaction starts in theQUEUED state, serving as the root from which all subsequent transactions (like INFLIGHT or APPLIED) are derived.
Blnk records the ID of this initial transaction in the meta_data.QUEUED_PARENT_TRANSACTION field of every subsequent transaction. You can use this ID to query and retrieve all transactions that belong to the same lifecycle chain:
cURL
Bulk/split transaction
Consider a split transaction of $100. Half to person A and half to person B. The lifecycle of this transaction would be as follows:
- The split transaction is first created in the
QUEUEDstate. - Blnk then generates two individual transactions — one for Person A and one for Person B — both in the
QUEUEDstate. - The original
QUEUEDsplit transaction becomes the parent of these two newQUEUEDtransactions. - As Blnk processes the two individual transactions, it creates two new transactions in the
APPLIEDstate. - Each individual child
QUEUEDtransaction becomes the parent of its correspondingAPPLIEDtransaction.
parent_transaction to get the final outcome of a split transaction. This is because the final APPLIED transactions aren’t directly linked to the original split transaction. Instead, they’re linked to the two individual QUEUED transactions created from it — each representing a separate outcome for Person A and Person B.
Instead you’ll need to query by the meta_data.QUEUED_PARENT_TRANSACTION field, which is present in all related transactions, regardless of their parent.