ACH Transactions
Accept ACH (Automated Clearing House, a network for bank-account payments) payments with Stax.js or the Stax API and track their final success or failure.
This guide is for developers integrating payments. The Stax Pay instructions describe sandbox testing, not an end-user payment workflow. An ACH payment can take up to 5 business days to reach its final outcome; the initial success response does not confirm that the merchant has received the funds.
Track an ACH payment
- Check initial validation. Stax returns
success: truewhen a transaction passes its initial checks. If validation fails, Stax marks the payment as failed immediately. - Track processing. Stax batches transactions that pass validation each day at 8 pm EST and sets
is_settling: true. Settlement is the stage in which payment processing completes before Stax pays out funds to the merchant. - Check the final outcome. During the next five business days, the payment follows one of these paths:
- Settled: Stax populates
settled_atwith the settlement date and time. Expect the funds in the merchant's bank account in roughly 1–2 business days. Failed funding instructions can delay the deposit. - Rejected: Stax creates an associated void transaction (a record that cancels the original payment).
transaction.child_transactions[0].typeis"void",transaction.is_voidedistrue, andtransaction.settled_athas no value.
- Settled: Stax populates
Treat success: true as initial acceptance, not the final payment outcome.
Handle ACH rejections
ACH rejections can occur because of insufficient funds, a frozen account, or incorrect account information. A bank can reject a payment 1–5 business days after the transaction. Display the rejection details so your customer can check their account information or contact their bank.
- Confirm that
transaction.methodis"bank". - Check that
transaction.child_transactionscontains a transaction before accessing index0. - If
transaction.child_transactions[0].typeis"void", read the rejection details fromtransaction.child_transactions[0].meta:achStatuscontains the ACH status, such as"FAILED".achDescriptioncontains a NACHA reason code (a standardized ACH-network code explaining why a bank rejected a payment) and its description in one string. For example:"ReasonCode: R03.ReasonDescription: No Account/Unable to Locate Account".
If the child transaction is absent or is not a void, do not treat it as the rejection record described here.
Optional: Test ACH payments
Use your sandbox account for these tests. The routing and account numbers below are supplied test values, not identifiers you need to find in the Dashboard.
-
Create an ACH transaction with these bank details to simulate a successful payment:
- Routing number:
021000021 - Account number:
9876543210
Any other combination triggers a failure.
- Routing number:
-
To test a rejection or clawback (a reversal that takes back payment funds) during settlement processing, create a transaction for $730.14.
-
Open Stax Pay > Reports > Deposit Report and select Simulate Settlements.
-
Check the final transaction status using the fields in Track an ACH payment and Handle ACH rejections above. For the rejection test, expect an associated void transaction rather than relying on the initial
successflag.
Optional: Test deposit reporting
Use the Deposit Reporting API to retrieve deposits and connect them to the original transactions. In your sandbox account, simulate settlement (completion of payment processing) to generate deposit-reporting data.
- Create transactions in your sandbox account before running the simulation.
- Open Stax Pay > Reports > Deposit Report and select Simulate Settlements. Stax also provides this feature in the API Keys App.
- Retrieve the generated data through the Deposit Reporting API and check that you can connect deposits to the original transactions.
Simulate Settlements fires the
update_transaction_settledwebhook event after simulating settlement for sandbox transactions. Expect deposit-reporting data and the corresponding webhook events after running the simulation.
Reduce the risk of double-crediting when performing ACH refundsIf you refund an ACH payment before it completes settlement (payment processing), the original payment might still fail. You could then credit the customer for funds they never paid.
We recommend disabling refunds until the transaction completes settlement to reduce this risk. Afterward, use the Refund Transaction API resource to initiate a refund. This recommendation addresses payment risk; it does not guarantee a successful refund or a compliance outcome.
Handle ACH webhook events
A webhook is an HTTP notification that Stax sends to your application's target URL when an event occurs. Use these events to track ACH payment outcomes:
create_transactionfires when Stax creates an ACH or credit card transaction. For transactions withmethod: "bank", distinguish initial acceptance from final success, even whensuccessistrue. Avoid offering refunds or voids while the payment is still processing because the payment can fail before the merchant receives the funds.update_transaction_settledfires when an ACH payment either completes settlement (payment processing) or fails. The payload includes the transaction object and theis_transaction_settledboolean. Inspect that boolean and the transaction's final-state fields rather than treating receipt of the event alone as proof of success.
Use the Webhooks API documentation to configure these events.
The following valid JSON shows only the fields from the original example of an update_transaction_settled POST request body. It is a partial payload illustration, not a complete webhook schema or proof of a successful payment:
{
"id": "6f49149d-69a1-48e6-bec5-d63eb5816118",
"child_transactions": [],
"is_voided": false
}Stax supplies the transaction id in the webhook payload; you do not need to copy an ID from the Dashboard for this example. The UUID above is an illustrative response value, not an input to reuse for your own transactions.
In this excerpt, the transaction has no child transactions and is_voided is false. These fields alone do not confirm final success. In the full payload, check is_transaction_settled and the final-state fields described above: a completed payment has a settled_at value, while a rejected payment has an associated void transaction and no settled_at value.
Updated 4 days ago
