ACH Payment Testing
An ACH payment will initially have the status pending when it was successfully submitted to JustiFi. Only when it was transferred to the bank will the status update to succeeded or failed which can take a few business days (depending on the chosen settlement strategy). Subscribing to the payment related webhook events is the best way to get notified when the status of an ACH payment changes.
The test environment simulates this behavior. In the response of the payment request the status will be pending. It will then immediately update to succeeded or failed depending on the chosen testing scenario.
To simulate different scenarios (success and failure) create a payment via API and pass the test scenario in the metadata property. Here's an example of how to create a test payment using cURL:
curl -X POST https://api.justifi.tech/v1/payments \
-H "Authorization: Bearer your_api_key" \
-H "Content-Type: application/json" \
-d '{
"amount": 1000,
"currency": "usd",
"payment_method": {
"bank_account": {
"acct_last_four": "1234",
"token": "fake_token_for_testing",
"account_owner_name": "John Doe",
"bank_name": "Test Bank",
"payment_method_type": "bank_account"
}
},
"metadata": {
"payment_test": {
"scenario": "succeeded"
}
}
}'
Successful ACH Payment
success
Simulates a successful ACH payment transaction.
Expected Recorded ACH Payment Containing:
{
"status": "succeeded",
"error": null
"error_description": null
}
Failed ACH Payment Scenarios
account_closed
Simulates an ACH payment declined due to account closed
Expected Recorded ACH payment Containing:
{
"error": {
"status": "failed",
"error_code": "account_closed",
"error_description": "The customer's bank account has been closed.",
}
}
account_frozen
Simulates an ACH payment declined due to account frozen
Expected Recorded ACH payment Containing:
{
"error": {
"status": "failed",
"error_code": "account_frozen",
"error_description": "The customer's bank account is frozen.",
}
}
bank_account_restricted
Simulates an ACH payment declined due to bank account restricted
Expected Recorded ACH payment Containing:
{
"error": {
"status": "failed",
"error_code": "bank_account_restricted",
"error_description": "This payment could not be processed.",
}
}
insufficient_funds
Simulates an ACH payment declined due to insufficient_funds
Expected Recorded ACH payment Containing:
{
"error": {
"status": "failed",
"error_code": "insufficient_funds",
"error_description": "The customer's account has insufficient funds to cover this payment.",
}
}
invalid_account_number
Simulates an ACH payment declined due to invalid account number
Expected Recorded ACH payment Containing:
{
"error": {
"status": "failed",
"error_code": "invalid_account_number",
"error_description": "The account number specified does not have the correct number structure.",
}
}
no_account
Simulates an ACH payment declined due to insufficient_funds
Expected Recorded ACH payment Containing:
{
"error": {
"status": "failed",
"error_code": "no_account",
"error_description": "The customer's bank account could not be located.",
}
}
Webhook Events
The events related to each test payment created will be sent to the configured webhooks on the test account.