Sandbox simulations: make the sandbox do what the outside world would
(settle or return an ACH transfer, send an inbound ACH or wire,
authorize a card, deposit a check). Every function here errs before
sending anything unless the call's environment is "sandbox"
(increase.environment, or environment in opts), so a
simulation can never reach production. No money moves in the sandbox.
See https://increase.com/documentation/api/simulations.
Functions
authorize-card
fn (params: Map): Map
fn (params: Map, opts: Map): Map
Simulate a card authorization. params needs amount (cents) and
usually card_id; optional merchant_descriptor,
merchant_category_code, merchant_city, merchant_country,
decline_reason, event_subscription_id (to exercise Real-Time
Decisions). Returns {pending_transaction, declined_transaction}.
Example
auth ::increase::simulations/authorize-card({card_id: "card_oubs0hwk5rn6knuecxg2", amount: 1000, merchant_descriptor: "COFFEE SHOP"})
complete-fednow-transfer
fn (fednow-transfer-id: Str): Map
fn (fednow-transfer-id: Str, params: Map, opts: Map): Map
Simulate FedNow completing (or, with params.rejection: {reject_reason_code}, rejecting) a FedNow Transfer.
Example
::increase::simulations/complete-fednow-transfer("fednow_transfer_4i0mptrdu1mueg1196bg")
complete-rtp-transfer
fn (rtp-transfer-id: Str): Map
fn (rtp-transfer-id: Str, params: Map, opts: Map): Map
Simulate the RTP network completing (or, with params.rejection: {reject_reason_code}, rejecting) a Real-Time Payments Transfer.
Example
::increase::simulations/complete-rtp-transfer("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq")
create-inbound-ach-transfer
fn (params: Map): Map
fn (params: Map, opts: Map): Map
Simulate another bank sending an ACH transfer to one of your Account
Numbers. params needs account_number_id and amount (positive
for a credit, negative for a debit); optional company_name,
company_entry_description, standard_entry_class_code,
resolve_at, addenda.
Example
::increase::simulations/create-inbound-ach-transfer({account_number_id: "account_number_v18nkfqm6afpsrvy82b2", amount: 1000})
create-inbound-fednow-transfer
fn (params: Map): Map
fn (params: Map, opts: Map): Map
Simulate an inbound FedNow transfer. params needs account_number_id
and amount; optional debtor_name,
unstructured_remittance_information.
Example
::increase::simulations/create-inbound-fednow-transfer({account_number_id: "account_number_v18nkfqm6afpsrvy82b2", amount: 5000, debtor_name: "Ian Crease"})
create-inbound-rtp-transfer
fn (params: Map): Map
fn (params: Map, opts: Map): Map
Simulate an inbound Real-Time Payments transfer. params needs
account_number_id and amount; optional debtor_name,
unstructured_remittance_information, request_for_payment_id.
Example
::increase::simulations/create-inbound-rtp-transfer({account_number_id: "account_number_v18nkfqm6afpsrvy82b2", amount: 5000, debtor_name: "Ian Crease"})
create-inbound-wire-transfer
fn (params: Map): Map
fn (params: Map, opts: Map): Map
Simulate an inbound wire to one of your Account Numbers. params needs
account_number_id and amount; optional creditor_name,
debtor_name, unstructured_remittance_information and the other
Fedwire fields.
Example
::increase::simulations/create-inbound-wire-transfer({account_number_id: "account_number_v18nkfqm6afpsrvy82b2", amount: 250000, debtor_name: "Ian Crease"})
mail-check-transfer
fn (check-transfer-id: Str): Map
fn (check-transfer-id: Str, opts: Map): Map
Simulate Increase mailing a physical Check Transfer.
Example
::increase::simulations/mail-check-transfer("check_transfer_30b43acfu9vw8fyc4f5")
reject-check-deposit
fn (check-deposit-id: Str): Map
fn (check-deposit-id: Str, opts: Map): Map
Simulate Increase rejecting a Check Deposit (e.g. an unreadable image).
Example
::increase::simulations/reject-check-deposit("check_deposit_f06n9gpg7sxn8t19lfc1")
return-ach-transfer
fn (ach-transfer-id: Str): Map
fn (ach-transfer-id: Str, params: Map, opts: Map): Map
Simulate the receiving bank returning an ACH Transfer. params:
reason (an ACH return reason such as "insufficient_fund" or
"no_account"; default "no_account").
Example
::increase::simulations/return-ach-transfer("ach_transfer_uoxatyh3lt5evrsdvo7q", {reason: "insufficient_fund"}, {})
return-check-deposit
fn (check-deposit-id: Str): Map
fn (check-deposit-id: Str, opts: Map): Map
Simulate the paying bank returning a submitted Check Deposit.
Example
::increase::simulations/return-check-deposit("check_deposit_f06n9gpg7sxn8t19lfc1")
settle-ach-transfer
fn (ach-transfer-id: Str): Map
fn (ach-transfer-id: Str, params: Map, opts: Map): Map
Simulate the Federal Reserve settling a submitted ACH Transfer.
params: inbound_funds_hold_behavior ("release_immediately" or
"release_on_default_schedule").
Example
::increase::simulations/settle-ach-transfer("ach_transfer_uoxatyh3lt5evrsdvo7q")
settle-card
fn (params: Map): Map
fn (params: Map, opts: Map): Map
Simulate settling a card authorization. params needs card_id;
optional pending_transaction_id and amount.
Example
::increase::simulations/settle-card({card_id: "card_oubs0hwk5rn6knuecxg2", pending_transaction_id: "pending_transaction_k1sfetcau2qbvjbzgju4"})
simulate
fn (path: Str, params: Map, required: Vec, opts: Map, operation: Str): Map
POST a simulation path after checking the sandbox guard and the
required fields. The functions below are built on it; use it for
simulations they don't cover, e.g.
simulate("/simulations/interest_payments", {account_id: "...", amount: 1000}, ["account_id", "amount"], {}, "interest payment").
Example
::increase::simulations/simulate("/simulations/interest_payments", {account_id: "account_in71c4amph0vgo2qllky", amount: 1000},
["account_id", "amount"], {}, "interest payment")
submit-ach-transfer
fn (ach-transfer-id: Str): Map
fn (ach-transfer-id: Str, opts: Map): Map
Simulate submitting an ACH Transfer to the Federal Reserve (normally done in batches during the day).
Example
::increase::simulations/submit-ach-transfer("ach_transfer_uoxatyh3lt5evrsdvo7q")
submit-check-deposit
fn (check-deposit-id: Str): Map
fn (check-deposit-id: Str, params: Map, opts: Map): Map
Simulate the Federal Reserve accepting a Check Deposit. params may set
scan: {account_number, routing_number, serial_number} (the MICR line
read off the check).
Example
::increase::simulations/submit-check-deposit("check_deposit_f06n9gpg7sxn8t19lfc1")
submit-wire-transfer
fn (wire-transfer-id: Str): Map
fn (wire-transfer-id: Str, opts: Map): Map
Simulate submitting a Wire Transfer to Fedwire.
Example
::increase::simulations/submit-wire-transfer("wire_transfer_5akynk7dqsq25qwk9q2u")