Skip to content

Testing Scenarios Guide

This guide covers how to test Flute payment integrations using the sandbox, including test cards, ACH accounts, error conditions, and load testing.

The Flute sandbox is a fully isolated environment that mirrors production behavior without processing real transactions. Use it to validate your integration before going live.

All examples in this guide use the sandbox base URL: https://sandbox.api.flute.com

Test Environment Setup

Before running tests, ensure you have:

  1. A sandbox merchant account provided by Flute. See Creating a Flute Sandbox Account.
  2. A sandbox API key that includes the clientId and client secret. See Creating an API Key.
  3. An API token generated from your sandbox environment credentials. See API Tokens.

Credit and Debit Card Testing

The sandbox supports two simulation modes depending on how the card is presented.

Card Not Present (CNP): The result is determined by the card number submitted. Use the test PANs listed in the tables below.

Card Present (CP): Because the PAN rides inside track or EMV data that the sandbox does not parse, the result is determined by the transaction amount instead. Use any card and set the amount to one of the values in the tables below. Applies to Swipe, EMV, NFC, EMVContactless, and FallbackSwipe data sources. Manual keyed entry is treated as CNP.

Approved Scenarios

For CNP, any card number not listed in the Decline or Processor Error tables is approved. For CP, any amount not listed in those tables is approved.

CNP card numberCP amountResult
Any PAN not listed in the Decline or Processor Error tables.

Example: 4111 1111 1111 1111
Any amount not listed in the Decline or Processor Error tables. Amounts above $5.00 will always get approved.

Example: $12.45
Approved
  • Expiration date: Any future date (e.g. 12/34)
  • CVV: Any 3- or 4-digit numeric value (e.g. 123)

AVS note: Even with an approval card number or amount, a transaction may still be declined if the merchant has AVS configured to Moderate or Strict and the submitted billing address does not match.

To simulate a full AVS match, use Street: 123 Test St and Postal code: 10001. See Address Verification.

Decline Scenarios

Use the CNP card number or the CP amount to trigger a specific issuer decline.

ResultCNP card numberCP amount
Decline - Do not honor4000 0000 1005 0005$1.05
Decline - Insufficient funds4000 0000 1051 0008$1.51
Decline - Invalid card number4000 0000 1014 0004$1.14
Decline - Expired card4000 0000 1054 0005$1.54
Decline - Pickup card (lost)4000 0000 1004 0006$1.04
Decline - Stolen card4000 0000 1043 0009$1.43
Decline - Card restricted4000 0000 1062 0005$1.62
Decline - Transaction not permitted4000 0000 1057 0002$1.57
Decline - CVV mismatch4000 0000 1099 0002N/A

Processor Errors

Use the CNP card number or the CP amount to trigger a specific processor error.

ResultCNP card numberCP amount
Error - Timeout / no response4000 0000 2091 0008$2.91
Error - System error4000 0000 2096 0003$2.96
Decline - Referral required4000 0000 2001 0007$2.01
Error - Re-enter transaction4000 0000 2019 0007$2.19

Partial Approval (CP only)

The sandbox can simulate a partial approval, where the issuer approves only a portion of the requested amount. This scenario is only available for CP transactions.

CP amountResult
$4.01Approves exactly $2.00 regardless of the requested amount

Transaction Qualification (CNP only)

Use the following PAN to replicate a Level 3 commercial card.

Card numberResult
4000 0000 3001 0005Approved as a Visa Level 3 commercial card - exercises the Level 3 processing path in the platform.

Address Verification (CNP only)

Use any of these addresses to replicate an AVS (address verification system) check.

The sandbox decides the AVS result from the billing street and zip on the request. The AVS check itself always succeeds.

To simulate a full AVS match, use:

  • Street: 123 Test St
  • Postal code: 10001

All street and postal code combinations are covered in the table below.

StreetPostal codeAVS result
123 Test St10001Full match
any other street10001Partial match - postal code only
123 Test Stany other postal codePartial match - street only
any other streetany other postal codeNo match
any10005Unavailable
any10009Incompatible. Whether the transaction is then accepted depends on the merchant's AVS policy.

AVS Profile and Transaction Outcome. The AVS result alone does not determine whether a transaction is approved or declined. The final outcome also depends on the merchant's AVS Profile, configured in the merchant dashboard settings.

ProfileApproves onDeclines on
StrictFull matchAny other AVS result
ModeratePartial match, Unavailable, or IncompatibleNo match
TolerantAny AVS result—

ACH Testing

ACH (Automated Clearing House) is the network used to process bank account payments, including direct debits and credits between bank accounts. The sandbox supports full ACH testing, including specific return codes, lifecycle status transitions, and edge cases such as holds and chargebacks.

Use the bank routing and account number combinations below to simulate specific outcomes. Each combination maps to a predefined response, allowing you to validate error handling, status transitions, and business logic.

The following operations can be tested:

  • Verify account (positive, negative, or error)
  • Payment (debit or credit)
  • Refund a cleared payment
  • Void a payment before submission
  • Hold a scheduled payment and release it
  • Lifecycle status transitions

Sandbox Lifecycle Emulation

Real-world ACH processing is asynchronous and takes up to three business days to clear, updating statuses up to four times a day. To help with testing, sandbox lifecycle status changes are shortened.

The ACH sandbox triggers status changes automatically every 15 minutes. This compresses the end-to-end testing window to approximately one hour.

A typical approved payment progresses through: Scheduled → In Progress → Cleared

A declined payment progresses through: Scheduled → Declined

Approved Scenarios

Use the following routing and account number to simulate a successful ACH transaction. Any routing and account number combination not listed in the Decline Scenarios table below is also approved.

RoutingAccountResult
110000000123456789Approved

Decline Scenarios

The sandbox triggers ACH return codes when the routing and account number pairings match from the list below.

"Soft returns" describe the state of the transaction, not the account. For example, Verify Account still reports the account as usable, but an actual payment with the same routing and account values is declined with the appropriate R-code.

RoutingAccountReturn codeVerify Account result
110000000900000101R01: Insufficient fundsPositive (soft return)
110000000900000102R02: Account closedNegative
110000000900000103R03: No account / unable to locateNegative
110000000900000104R04: Invalid account numberNegative
110000000900000107R07: Authorization revokedNegative
110000000900000108R08: Payment stoppedPositive (soft return)
110000000900000109R09: Uncollected fundsPositive (soft return)
110000000900000110R10: Customer advises unauthorizedNegative
110000000900000116R16: Account frozenNegative
110000000900000120R20: Non-transaction accountNegative

Processor-Driven Statuses

Once an ACH payment is approved, the routing and account numbers also decide the path it will take through its lifecycle.

RoutingAccountConditionACH Transaction Lifecycle
110000000900000200Held by processorScheduled → In Progress → Held by Processor
110000000900000300Charged backScheduled → In Progress → Cleared → Charged Back

Status Guards

Hold, Remove Hold, Void, and Refund only apply in the correct state. If you attempt them at the wrong moment, the sandbox declines with an explanatory message.

  • Void requires status Scheduled
  • Hold requires status Scheduled
  • Remove Hold requires status Held
  • Refund requires the parent transaction to be Cleared

Error Condition Testing

Test each error type to ensure your integration handles failures gracefully and communicates clearly with end users.

HTTP Error Codes

HTTP StatusError CodeCommon CauseHandling Recommendation
400VALIDATION_ERRORMissing or malformed request fieldDisplay field-level validation messages to the user
401UNAUTHORIZEDMissing, expired, or invalid API tokenRefresh the API token and retry the request once
403FORBIDDENAPI token lacks required permissionCheck API key permissions in the merchant dashboard
404NOT_FOUNDResource does not exist or belongs to another merchantVerify the resource ID and merchant scope
429RATE_LIMITEDToo many requests in a short periodImplement exponential backoff with jitter
500INTERNAL_ERRORUnexpected server errorRetry with exponential backoff; alert if persistent
503SERVICE_UNAVAILABLEFlute service temporarily unavailableRetry after a delay; do not retry immediately

Duplicate Transactions

Duplicate controls is a configurable feature that prevents duplicate transactions from being processed, reducing the risk of double-charging customers. It is available at the merchant account level and can be enabled and customized in the merchant dashboard.

When enabled, each incoming payment transaction is compared against recent transactions from the same merchant. If a match is found within the validation period, the transaction is flagged as a duplicate and rejected.

A duplicate transaction returns HTTP 400 with a V0000 validation error (ValidationException).

A transaction is considered a duplicate if all the following fields match:

  • Operator ID (API client ID, terminal ID, or user ID)
  • Merchant ID
  • Amount
  • Operation type (Auth or Sale)
  • Card number (last four digits)
  • Reference ID (if provided)

The duplicate check applies within a configurable validation period (default: 10 minutes).

If the new transaction is legitimate, you can either:

  • Wait for the validation period to expire and resubmit, or
  • Set a different reference ID and resend immediately.

Load Testing

Coordinate with Flute before running load tests against the sandbox environment. High traffic against the shared sandbox infrastructure can affect other merchants using the same environment. Contact developer@flute.com to schedule a load test window.

What to Measure

Focus your load tests on the endpoints your integration uses most heavily. For each endpoint, measure:

MetricAcceptable TargetNotes
P95 latency< 2 secondsFor API token creation and payment session endpoints
P99 latency< 5 secondsUnder sustained load
Error rate< 0.1%Excluding intentional decline scenarios
ThroughputMatch expected peak TPSRamp up gradually; do not start at peak
API token refresh success rate100%API tokens must never silently fail to refresh