Transactions

Dry-run a transaction

Preview a transaction without writing it to the ledger.

POST/transactions

Authorization

If set, the API uses an API key for authentication. Include the following header in your requests: X-blnk-key: <api-key>.

Replace <api-key> with your secret API key. Ensure the key is kept secure and not exposed in public repositories or client-side code.

See also: Core API key.

Send the same body as Record a transaction and set dry_run to true. Blnk returns a projection instead of a recorded transaction.

The preview always answers synchronously with HTTP 200. dry_run takes precedence over skip_queue. A projected rejection is 200 with would_apply: false, not an HTTP error.

dry_run also works on bulk create, refund, and update inflight. See Dry-run transactions.

Body

dry_runbooleanrequiredbody

Set true to project the transaction without writing anything. No transaction row, balance change, queue entry, webhook, or hook is created, and the reference is not consumed.

precise_amountintegerbody

The transaction amount in its smallest unit (recommended). Include the corresponding precision value. See Precision.

amountfloatbody

The transaction amount as a float. Blnk multiplies amount by precision to store precise_amount.

currencystringrequiredbody

The currency of the transaction amount.

precisionintegerdefault 1requiredbody

Precision for the transaction’s currency. See Precision.

referencestringrequiredbody

Unique transaction reference. A dry run does not consume it.

sourcestringrequiredbody

Balance sending the amount. @ prefix indicates an internal balance.

destinationstringrequiredbody

Balance receiving the amount. @ prefix indicates an internal balance.

descriptionstringbody

Narration of the transaction.

allow_overdraftbooleandefault falsebody

Whether the source can go negative. See Overdrafts.

inflightbooleandefault falsebody

When true, the preview uses INFLIGHT status and projects inflight balances. See Create inflight.

skip_queuebooleandefault falsebody

Ignored for a single-transaction dry run. The preview always answers now. For bulk and splits, this flag selects cumulative vs independent projection. See Bulk and split transactions.

sourcesarraybody

Multiple sources instead of source. See Multiple sources.

destinationsarraybody

Multiple destinations instead of destination. See Multiple destinations.

Response

dry_runbooleanrequired

Always true. This is a preview, not a recorded transaction.

would_applybooleanrequired

Whether a real post of this payload would be accepted against balances as they stand now.

rejectionobject

Present when would_apply is false. code is the same catalog code a real post would return.

statusstring

Status the real transaction would carry (APPLIED, or INFLIGHT if you sent inflight: true). Omitted when would_apply is false.

referencestring

The reference you sent. It is still unused after a dry run.

currencystring

Currency of the projected movement.

amountfloat

Display amount of the projected movement.

precise_amountstring

Movement in minor units, returned as a string so nothing is rounded.

precisionfloat

Precision used to convert precise_amount.

operationstring

Present on inflight previews only: commit or void.

balancesarrayrequired

Before and after state for each participating balance. Amounts are minor-unit strings.

legsarray

One entry per split that would apply on a multiple-source or multiple-destination transaction.

notesarray

Advisory messages that are not rejections, such as a currency mismatch or a scheduled_for date being ignored.