Transactions

Get transaction lineage

See how a transaction's spend was allocated across providers with the Python SDK.

GET/transactions/{transaction_id}/lineage

Use blnk.transactions.get_lineage to inspect a transaction’s fund breakdown.

Call the method

response = blnk.transactions.get_lineage(
  "txn_8d2ce2f0-0d75-4a91-9d43-2ad2c2e6b9ad",
)
FieldTypeDescription
transactionIdstrTransaction ID with fund lineage enabled.

Use the provider breakdown

Read fund_allocation for how much came from each provider. Read shadow_transactions for the internal records Blnk created to track each provider’s share.

Response

{
  "transaction_id": "txn_8d2ce2f0-0d75-4a91-9d43-2ad2c2e6b9ad",
  "fund_allocation": [
    {
      "provider": "stripe",
      "amount": "2500"
    }
  ],
  "shadow_transactions": [
    {
      "transaction_id": "txn_shadow_123",
      "reference": "ref_002_release_stripe_0",
      "precise_amount": "2500",
      "currency": "USD",
      "status": "APPLIED"
    }
  ]
}
FieldTypeDescription
transaction_idstrTransaction you queried.
fund_allocationlist[dict]How much of the spend came from each provider. Amounts are strings in minor units. May be empty when no tagged funds were used.
shadow_transactionslist[dict]Internal records Blnk creates to track each provider’s share of the spend. May be empty.