Transactions
Bulk transactions
Submit multiple transactions in one request with the Go SDK.
POST
/transactions/bulkUse client.Transaction.CreateBulk to create many transactions in one request (up to blnkgo.MaxBulkCreateItems, 10,000 per request).
Call the method
Create batch
result, _, _ := client.Transaction.CreateBulk(blnkgo.CreateBulkTransactionRequest{
Atomic: true,
Transactions: []blnkgo.CreateTransactionRequest{
{
ParentTransaction: blnkgo.ParentTransaction{
Amount: 1000,
Precision: 100,
Currency: "USD",
Source: "@source_1",
Destination: "@dest_1",
Reference: "bulk_001",
Description: "Payment 1",
},
},
{
ParentTransaction: blnkgo.ParentTransaction{
Amount: 2000,
Precision: 100,
Currency: "USD",
Source: "@source_2",
Destination: "@dest_2",
Reference: "bulk_002",
Description: "Payment 2",
},
},
},
})
| Field | Type | Description |
|---|---|---|
Transactions | []blnkgo.CreateTransactionRequest | Transaction objects to create; up to 10,000 per request (blnkgo.MaxBulkCreateItems). 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. |
RunAsync | bool | When true, Core processes the batch in the background and returns status: "queued". |
SkipQueue | bool | When true, transactions bypass the queue and process synchronously. |
Dry run
Preview the batch without writing anything. Use CreateBulkDryRun. SkipQueue selects cumulative vs independent projection. RunAsync is ignored. See Dry-run transactions.
preview, _, _ := client.Transaction.CreateBulkDryRun(blnkgo.CreateBulkTransactionRequest{
SkipQueue: false,
Transactions: []blnkgo.CreateTransactionRequest{
{
ParentTransaction: blnkgo.ParentTransaction{
PreciseAmount: big.NewInt(45000),
Precision: 100,
Currency: "USD",
Source: "bln_source-bal-001",
Destination: "bln_dest-bal-001",
Reference: "ref_payout_450",
Description: "First payout",
},
},
{
ParentTransaction: blnkgo.ParentTransaction{
PreciseAmount: big.NewInt(10000),
Precision: 100,
Currency: "USD",
Source: "bln_source-bal-001",
Destination: "bln_dest-bal-002",
Reference: "ref_payout_100",
Description: "Second payout",
},
},
},
})Save the batch ID
On a posted batch, use result.BatchID as parent transaction to find child transactions.
A dry run has no BatchID. Check WouldApply and Results.
Response
Create batchGo response (
{
"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"
}Go response (*blnkgo.CreateBulkTransactionResponse)
| Field | Type | Description |
|---|---|---|
BatchID | string | Identifier for the batch. Use as ParentTransactionID to find child transactions, or with Update to commit or void an inflight batch. |
Status | string | applied, inflight, or queued depending on the batch. |
TransactionCount | int | Number of transactions when processed synchronously. |
Message | string | Status message when RunAsync is true. |
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
},
{
"dry_run": true,
"would_apply": true,
"status": "APPLIED",
"reference": "ref_payout_100",
"currency": "USD",
"amount": 100,
"precise_amount": "10000",
"precision": 100
}
]
}