Transactions

Bulk transactions

Submit multiple transactions in one request with the Java SDK.

POST/transactions/bulk

Use blnk.transactions().createBulk for this operation.

Call the method

CreateTransactions payment1 = CreateTransactions.create()
    .amount(1000)
    .precision(100)
    .currency("USD")
    .source("@source_1")
    .destination("@dest_1")
    .reference("bulk_001")
    .description("Payment 1");

CreateTransactions payment2 = CreateTransactions.create()
    .amount(2000)
    .precision(100)
    .currency("USD")
    .source("@source_2")
    .destination("@dest_2")
    .reference("bulk_002")
    .description("Payment 2");

ApiResponse<JsonNode> response = blnk.transactions().createBulk(
    BulkTransactions.create()
        .atomic(true)
        .transactions(List.of(payment1, payment2)));
FieldTypeDescription
transactionsList<
CreateTransactions>
Transaction objects to create; 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. See Dry-run transactions.

CreateTransactions item = CreateTransactions.create()
    .preciseAmount(45000)
    .precision(100)
    .currency("USD")
    .source("bln_source-bal-001")
    .destination("bln_dest-bal-001")
    .reference("ref_payout_450")
    .description("First payout");

ApiResponse<JsonNode> preview = blnk.transactions().createBulk(
    BulkTransactions.create()
        .dryRun(true)
        .transactions(List.of(item)));

Save the batch ID

Use response.data().get("batch_id").asText() 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": 2
}
{
  "batch_id": "bulk_c62f200b-905f-4983-a349-cadd279234aa",
  "status": "queued",
  "message": "Bulk transaction processing started"
}
{
  "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
    }
  ]
}
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.