Transactions

Bulk commit inflight

Commit multiple independently-created inflight transactions with the TypeScript SDK.

POST/transactions/inflight/bulk/commit

Use blnk.Transactions.bulkCommitInflight to commit multiple inflight transactions.

Call the method

const response = await blnk.Transactions.bulkCommitInflight({
  transactions: [
    {
      transaction_id: 'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96',
    },
    {
      transaction_id: 'txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6',
      amount: 40,
    },
    {
      transaction_id: 'txn_0b59f6e6-6c4a-4efa-915c-526f77ef',
      precise_amount: 125034,
    },
  ],
});

Pass skip_queue: true to process each commit synchronously instead of queuing.

const response = await blnk.Transactions.bulkCommitInflight({
  skip_queue: true,
  transactions: [
    {
      transaction_id: 'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96',
    },
    {
      transaction_id: 'txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6',
      amount: 40,
    },
  ],
});

Preview every commit without settling any hold. Items are projected independently. See Dry-run transactions.

const preview = await blnk.Transactions.bulkCommitInflight({
  dry_run: true,
  transactions: [
    {
      transaction_id: 'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b96',
    },
    {
      transaction_id: 'txn_6164573b-6cc8-45a4-ad2e-7b4ba6a6',
    },
  ],
});
FieldTypeDescription
dry_runtrueReturn a BulkTransactionPreview without committing. Holds stay in place.

Pass dry_run: true inline, as shown above, to infer the preview response. If the request is declared separately, type it as DryRun<BulkCommitInflightRequest>.

FieldTypeDescription
transactionsobject[]Up to 100 inflight transactions to commit.
transactions[].transaction_idstringInflight transaction ID to commit.
transactions[].amountnumberPartial commit amount. Omit to commit the full remaining inflight amount.
transactions[].precise_amountnumberPrecision-applied partial commit amount. Takes precedence over amount.
skip_queuebooleanWhen true, process synchronously instead of queuing.

Review per-item results

On a posted batch, check response.data.results for each transaction’s outcome. Failed items include a code and message without stopping the rest of the batch.

A dry run has no succeeded / failed counts. Check would_apply and results.

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"
    }
  ]
}
FieldTypeDescription
succeedednumberNumber committed successfully.
failednumberNumber that failed.
resultsobject[]Per-transaction outcome in request order.
results[].statusstringsucceeded or failed.
results[].codestringFailure code (for example NOT_FOUND, ALREADY_VOIDED, INVALID_AMOUNT).
results[].messagestringHuman-readable failure message.
{
  "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
    },
    {
      "dry_run": true,
      "would_apply": true,
      "operation": "commit",
      "status": "APPLIED",
      "reference": "ref_hold_002",
      "currency": "USD",
      "amount": 40,
      "precise_amount": "4000",
      "precision": 100
    }
  ]
}