Transactions
Bulk commit inflight
Commit multiple independently-created inflight transactions with the Go SDK.
POST
/transactions/inflight/bulk/commitUse client.Transaction.BulkCommitInflight to commit multiple inflight transactions.
Call the method
Queued commit
result, _, _ := client.Transaction.BulkCommitInflight(
blnkgo.BulkCommitInflightRequest{
Transactions: []blnkgo.BulkCommitInflightItem{
{
TransactionID: "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96",
},
{
TransactionID: "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6",
Amount: 40,
},
{
TransactionID: "txn_0b59f6e6-6c4a-4efa-915c-526f77ef",
PreciseAmount: big.NewInt(125034),
},
},
},
)Synchronous commit
Pass SkipQueue: true to process each commit synchronously instead of queuing.
result, _, _ := client.Transaction.BulkCommitInflight(
blnkgo.BulkCommitInflightRequest{
SkipQueue: true,
Transactions: []blnkgo.BulkCommitInflightItem{
{
TransactionID: "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96",
},
{
TransactionID: "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6",
Amount: 40,
},
},
},
)Dry run
Preview every commit without settling any hold. Use BulkCommitInflightDryRun. See Dry-run transactions.
preview, _, _ := client.Transaction.BulkCommitInflightDryRun(
blnkgo.BulkCommitInflightRequest{
Transactions: []blnkgo.BulkCommitInflightItem{
{
TransactionID: "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96",
},
{
TransactionID: "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6",
},
},
},
)| Field | Type | Description |
|---|---|---|
Transactions | []blnkgo.BulkCommitInflightItem | Up to 100 inflight transactions to commit. |
Transactions.[].TransactionID | string | Inflight transaction ID to commit. |
Transactions.[].Amount | float64 | Partial commit amount. Omit to commit the full remaining inflight amount. |
Transactions.[].PreciseAmount | *big.Int | Precision-applied partial commit amount. Takes precedence over Amount. |
SkipQueue | bool | When true, process synchronously instead of queuing. |
Review per-item results
On a posted batch, check result.Results for each transaction’s outcome.
A dry run has no succeeded or failed counts. Check WouldApply and Results.
Response
Queued commitGo response (
{
"succeeded": 2,
"failed": 1,
"results": [
{
"transaction_id": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96",
"status": "succeeded"
},
{
"transaction_id": "txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6",
"status": "succeeded"
},
{
"transaction_id": "txn_0b59f6e6-6c4a-4efa-915c-526f77ef",
"status": "failed",
"code": "INVALID_AMOUNT",
"message": "cannot commit more than inflight amount"
}
]
}Go response (*blnkgo.BulkCommitInflightResponse)
| Field | Type | Description |
|---|---|---|
Succeeded | int | Number committed successfully. |
Failed | int | Number that failed. |
Results | []blnkgo.BulkCommitInflightResult | Per-transaction outcome in request order. |
Results.[].TransactionID | string | Transaction ID from the request. |
Results.[].Status | string | succeeded or failed. |
Results.[].Code | string | Failure code (for example NOT_FOUND, ALREADY_VOIDED, INVALID_AMOUNT). |
Results.[].Message | string | Human-readable failure message. |
Dry run
{
"dry_run": true,
"would_apply": true,
"cumulative": false,
"atomic": false,
"results": [
{
"dry_run": true,
"would_apply": true,
"operation": "commit",
"status": "APPLIED",
"reference": "ref_hold_001",
"currency": "USD",
"amount": 120,
"precise_amount": "12000",
"precision": 100
}
]
}