Transactions

Bulk transactions

Submit multiple transactions in one request with the TypeScript SDK.

POST/transactions/bulk

Use blnk.Transactions.createBulk to create many transactions in one request (up to 10,000 per request).

Call the method

const response = await blnk.Transactions.createBulk({
  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',
    },
  ],
});
FieldTypeDescription
transactionsobject[]Transaction objects to create; up to 10,000 per request. References must be unique within the batch.
atomicbooleanWhen true, every transaction succeeds or fails together.
inflightbooleanWhen true, transactions are created in INFLIGHT status for a later commit or void.
run_asyncbooleanWhen true, Core processes the batch in the background and returns status: 'queued'.
skip_queuebooleanWhen true, transactions bypass the queue and process synchronously.

Preview the batch without writing anything. skip_queue selects cumulative vs independent projection. run_async is ignored. See Dry-run transactions.

const preview = await blnk.Transactions.createBulk({
  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',
    },
    {
      precise_amount: 10000,
      precision: 100,
      currency: 'USD',
      source: 'bln_source-bal-001',
      destination: 'bln_dest-bal-002',
      reference: 'ref_payout_100',
      description: 'Second payout',
    },
  ],
});
FieldTypeDescription
dry_runtrueReturn a BulkTransactionPreview without creating transactions or consuming references.
skip_queuebooleantrue projects items in order against each other. false projects each item against current balances on its own.

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

Save the batch ID

On a posted batch, use response.data.batch_id as parent_transaction to find child transactions, or with updateStatus to commit or void an inflight batch.

A dry run has no batch_id. Check would_apply and results.

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"
}
FieldTypeDescription
batch_idstringIdentifier for the batch. Use as parent_transaction to find child transactions, or with updateStatus to commit or void an inflight batch.
statusstringapplied, inflight, or queued depending on the batch.
transaction_countnumberNumber of transactions when processed synchronously.
messagestringStatus message when run_async is true.
{
  "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
    }
  ]
}