Simulation Scenarios
Every simulated transaction starts with one creation call and, optionally, moves through its lifecycle via POST /transaction/update. Which creation call you use depends on what you’re simulating.
Creating a transaction
Each simulated transaction kind has its own creation endpoint:
Neither endpoint simulates card refunds or transfers between two of your own Capital Accounts. POST /transaction/card produces an outbound purchase only, and POST /transaction/payment exchanges with a linked account only. Use POST /accounts/capital/transfer on Penny Banking for transfers.
Card purchases
POST /transaction/card takes these fields:
The merchant object:
The force flag controls authorization:
force: false(default) — runs the purchase through Penny’s authorization: account and card eligibility, available funds, spend controls, and any configured live decisioning callback. Penny records its decision (transaction.request.approvedortransaction.request.declined), and the simulator then confirms it the way a card network would (transaction.approvedortransaction.declined). You do not trigger that confirmation step. A decline is still a successful simulation response that contains a declined transaction.force: true— bypasses authorization and records the transaction as settled (transaction.settled), modeling an offline or store-and-forward capture that arrives with no prior authorization.
See Simulating a Card Purchase for a worked example.
Linked account payments
POST /transaction/payment takes linked_account_id, capital_account_id, amount, and currency (USD), all required, plus:
direction(defaultinbound) —inboundfor a payment received from the linked account,outboundfor a payment sent to it.settle(defaultfalse) —truesettles the payment immediately;falseleaves it approved until you send atransaction.settledevent withPOST /transaction/update.
Transaction events
Once a transaction exists, POST /transaction/update advances it with one of four events:
An optional reason string is recorded on the event for any of these.
Only the four events above are accepted by POST /transaction/update. The request and approval events happen automatically when a card transaction is created (see above), and any other event value is rejected with 400.
Settlement and adjustment amounts are deltas, not cumulative totals. Send a second settlement event with its own amount to exercise multi-part settlement. To model a reversal, send a negative transaction.adjustment, or a separate payment in the opposite direction.
Penny validates each event against the transaction’s current state, as it does for real activity. An event that is not valid from the transaction’s current state is rejected with 422.
Reading a simulated transaction back
Read a simulated transaction through Penny Banking’s GET /transactions/{transaction_id} endpoint, or through a transaction list scoped to its card or account. See Transactions.
Idempotency
POST /transaction/card, POST /transaction/payment, and POST /transaction/update accept an Idempotency-Key header. It is optional, but strongly advised. Use a new key for each intended event, and reuse the same key, with the same body, only when retrying that exact event. A request still being processed under the same key returns 409. See Retries & Idempotency.