Skip to content

Testing Scenarios Guide

This is a comprehensive guide for testing Flute payment integrations. It covers using test credit and debit cards, error conditions, edge cases, load testing, and automated testing best practices.

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

Prerequisites

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, use the card below. Any card number not listed in the Decline or Processor Error tables is also approved.

CNP card numberCP amountResult
Any PAN not listed in specific scenarios. Use any future expiration date and any valid CVV code.

PAN example: 4111 1111 1111 1111
Any amount not listed in specific scenarios. Amounts above $5.00 will always get approved.

Example: $12.45
Approved

Use any future expiration date and any numeric value for the CVV.

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 any of these PANs (primary account numbers) to replicate using 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. Any values or value pairings not listed here is returned as verified.

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.

ACH Testing

The sandbox allows testing transactions during app development. This includes being able to replicate specified errors and incomplete transactions.

The following list are test account numbers to simulate specific transaction outcomes in the sandbox environment. Each account number is mapped to a predefined response. This allows you to validate error handling, status transitions, and business logic. Submit a transaction using one of the values below to reproduce an outcome you want to test.

For testing ACH transactions, the following cases apply:

  • Verify account (Positive / Negative / Error)
  • Payment (debit or credit)
  • Refund a cleared payment
  • Void a payment before being submitted
  • Hold a scheduled payment and remove the hold to release it
  • Lifecycle statuses. The sandbox reduces the time required to change or advance the status of an ACH transaction.

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: ScheduledIn ProgressCleared

A declined payment progresses through: ScheduledDeclined

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
900000000900000000Approved

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. However, an actual payment with that 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 processorScheduledIn ProgressHeld by Processor
110000000900000300Charged backScheduledIn ProgressClearedCharged Back

Status Guards

Hold / Remove Hold / Void / Refund only apply in the right state. If you try them at the wrong moment, the sandbox declines with an explanatory message. You can also test the unhappy paths:

  • 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

A duplicate transaction is a transaction that appears to have been submitted more than once for the same payment event. To help prevent this, Flute uses duplicate controls. This is a configurable feature, called duplicate controls, that helps prevent duplicate transactions that may lead to double-charging customers. It is available at the merchant account level.

When enabled, duplicate controls automatically validate incoming payment transactions. It uses customizable criteria to check for possible duplicates. The duplicate controls configuration can be enabled and customized in the Merchant account dashboard.

When a new payment transaction is received, duplicate controls compare it against other, recent transactions from the same merchant. If a transaction with matching details is found within a specified validation period, the system flags it. It is marked as a duplicate and prevents it from being processed again.

A transaction marked as a duplicate returns an HTTP response of 400 and a V0000 validation error (ValidationException).

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

  • Operator ID, such as API client ID, terminal ID, user ID
  • Merchant ID
  • Amount
  • Operation type (Auth or Sale)
  • Card number (the 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, the merchant can either:

  • Wait for the validation period and resubmit it, or
  • Set a different reference ID and resend the transaction immediately. The new reference ID prevents the transaction from being flagged as a duplicate.

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