Transactions

Update inflight

Commit or void an inflight transaction with the TypeScript SDK.

PUT/transactions/inflight/{transaction_id}

Use blnk.Transactions.updateStatus to commit or void an inflight transaction or batch.

Call the method

const response = await blnk.Transactions.updateStatus(
  'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c',
  {
    status: 'commit',
  },
);
const response = await blnk.Transactions.updateStatus(
  'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c',
  {
    status: 'commit',
    amount: 500
  },
);
const response = await blnk.Transactions.updateStatus(
  'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c',
  {
    status: 'void',
  },
);

Preview the commit or void without settling the hold. See Dry-run transactions.

const preview = await blnk.Transactions.updateStatus(
  'txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c',
  {
    status: 'commit',
    dry_run: true,
  },
);
FieldTypeDescription
dry_runtrueReturn a TransactionPreview without committing or voiding. The inflight hold stays 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<UpdateTransactionStatus<T>>.

FieldTypeDescription
transactionOrBatchIdstringInflight transaction ID, or batch ID from createBulk.
statusstringcommit to apply funds, or void to cancel and roll back.
amountnumberPartial commit amount. See Partial commits.
precise_amountnumberPrecision-applied partial commit amount. Takes precedence over amount.

Confirm the outcome

On a posted update, check response.data.status for APPLIED or VOID. The child gets a new transaction_id. Use parent_transaction to link it to the original inflight transaction.

A dry run has no transaction_id. Check would_apply instead.

Response

{
  "amount": 1250.34,
  "precision": 100,
  "precise_amount": 125034,
  "transaction_id": "txn_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "parent_transaction": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
  "source": "bln_f344b673-e855-4bda-b769-3e94a02c1941",
  "destination": "@WorldUSD",
  "reference": "ref_2ye281ewiu",
  "currency": "USD",
  "description": "Card payment on Stripe",
  "status": "APPLIED",
  "hash": "0b9c25fb5b00d6c71cb4ca87026bf6dc316e63353d33deb588bd0",
  "created_at": "2024-11-26T09:33:35.265582042Z"
}
{
  "amount": 500,
  "precision": 100,
  "precise_amount": 50000,
  "transaction_id": "txn_b2c3d4e5-f6a7-8901-bcde-f23456789012",
  "parent_transaction": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
  "source": "bln_f344b673-e855-4bda-b769-3e94a02c1941",
  "destination": "@WorldUSD",
  "reference": "ref_2ye281ewiu",
  "currency": "USD",
  "description": "Card payment on Stripe",
  "status": "APPLIED",
  "hash": "0b9c25fb5b00d6c71cb4ca87026bf6dc316e63353d33deb588bd0",
  "created_at": "2024-11-26T09:33:35.265582042Z"
}
{
  "amount": 1250.34,
  "precision": 100,
  "precise_amount": 125034,
  "transaction_id": "txn_c3d4e5f6-a7b8-9012-cdef-345678901234",
  "parent_transaction": "txn_c4e70eb8-e4d6-4e04-a2e2-92a43b969e0c",
  "source": "bln_f344b673-e855-4bda-b769-3e94a02c1941",
  "destination": "@WorldUSD",
  "reference": "ref_2ye281ewiu",
  "currency": "USD",
  "description": "Card payment on Stripe",
  "status": "VOID",
  "hash": "0b9c25fb5b00d6c71cb4ca87026bf6dc316e63353d33deb588bd0",
  "created_at": "2024-11-26T09:33:35.265582042Z"
}
{
  "dry_run": true,
  "would_apply": true,
  "operation": "commit",
  "status": "APPLIED",
  "reference": "ref_card_settle_4821",
  "currency": "USD",
  "amount": 120,
  "precise_amount": "12000",
  "precision": 100,
  "balances": [
    {
      "balance_id": "bln_source-bal-001",
      "role": "source",
      "currency": "USD",
      "current_balance": "50000",
      "current_available": "38000",
      "current_credit_balance": "50000",
      "current_debit_balance": "0",
      "current_inflight_debit_balance": "12000",
      "current_inflight_credit_balance": "0",
      "resulting_balance": "38000",
      "resulting_available": "38000",
      "resulting_credit_balance": "50000",
      "resulting_debit_balance": "12000",
      "resulting_inflight_debit_balance": "0",
      "resulting_inflight_credit_balance": "0"
    },
    {
      "balance_id": "bln_dest-bal-001",
      "role": "destination",
      "currency": "USD",
      "current_balance": "0",
      "current_available": "0",
      "current_credit_balance": "0",
      "current_debit_balance": "0",
      "current_inflight_debit_balance": "0",
      "current_inflight_credit_balance": "12000",
      "resulting_balance": "12000",
      "resulting_available": "12000",
      "resulting_credit_balance": "12000",
      "resulting_debit_balance": "0",
      "resulting_inflight_debit_balance": "0",
      "resulting_inflight_credit_balance": "0"
    }
  ]
}
FieldTypeDescription
transaction_idstringID of the new transaction created by the commit or void.
parent_transactionstringOriginal inflight transaction this resolves.
statusstringAPPLIED or VOID.
precise_amountnumberAmount applied (amount × precision).