Transactions
Bulk transactions
Submit multiple transactions in one request with the Python SDK.
POST
/transactions/bulkUse blnk.transactions.create_bulk to create many transactions in one request.
Call the method
Create batch
response = blnk.transactions.create_bulk({
"atomic": True,
"transactions": [
{
"amount": 1000,
"precision": 100,
"currency": "USD",
"source": "@source_1",
"destination": "@dest_1",
"reference": "bulk_001",
"description": "Payment 1",
},
{
"amount": 2000,
"precision": 100,
"currency": "USD",
"source": "@source_2",
"destination": "@dest_2",
"reference": "bulk_002",
"description": "Payment 2",
},
],
})
| Field | Type | Description |
|---|---|---|
transactions | list[dict] | Transaction objects to create; references must be unique within the batch. |
atomic | bool | When True, every transaction succeeds or fails together. |
inflight | bool | When True, transactions are created in INFLIGHT status for a later commit or void. |
run_async | bool | When True, Core processes the batch in the background and returns status: "queued". |
skip_queue | bool | When True, transactions bypass the queue and process synchronously. |
Dry run
Preview the batch without writing anything. See Dry-run transactions.
preview = blnk.transactions.create_bulk({
"dry_run": True,
"skip_queue": False,
"transactions": [
{
"precise_amount": 45000,
"precision": 100,
"currency": "USD",
"source": "bln_source-bal-001",
"destination": "bln_dest-bal-001",
"reference": "ref_payout_450",
"description": "First payout",
},
],
})Save the batch ID
On a posted batch, use response.data["batch_id"] as parent_transaction to find child transactions, or with update_status to commit or void an inflight batch.
A dry run has no batch_id. Check would_apply and results.
Response
Create batch
{
"batch_id": "bulk_c62f200b-905f-4983-a349-cadd279234aa",
"status": "applied",
"transaction_count": 4
}{
"batch_id": "bulk_c62f200b-905f-4983-a349-cadd279234aa",
"status": "queued",
"message": "Bulk transaction processing started"
}Dry run
{
"dry_run": true,
"would_apply": true,
"cumulative": false,
"atomic": false,
"results": [
{
"dry_run": true,
"would_apply": true,
"status": "APPLIED",
"reference": "ref_payout_450",
"currency": "USD",
"amount": 450,
"precise_amount": "45000",
"precision": 100
}
]
}| Field | Type | Description |
|---|---|---|
batch_id | str | Identifier for the batch. Use as parent_transaction to find child transactions, or with update_status to commit or void an inflight batch. |
status | str | applied, inflight, or queued depending on the batch. |
transaction_count | number | Number of transactions when processed synchronously. |
message | str | Status message when run_async is True. |