
how to test a "payout failure" in the cybrid sandbox
Testing payout failures in the Cybrid sandbox is essential for building resilient payout workflows, validating error handling, and ensuring your customer experience remains smooth when things go wrong in production. This guide walks through practical approaches to simulate payout failure scenarios using Cybrid’s API-driven payments infrastructure.
Why simulate payout failures in the sandbox?
Before you move to production, you should be confident that your application:
- Correctly interprets payout failure states
- Surfaces clear error messages to end users
- Retries or reconciles failed payouts according to your business rules
- Logs and reports failures for compliance and support
The Cybrid sandbox is designed for exactly this: to let you experiment safely with payouts, liquidity, and settlement behaviours before real money is involved.
Key concepts before you start
When testing payout failures, keep these Cybrid building blocks in mind:
- Customers & KYC: Payouts are typically tied to verified customers. In sandbox you can create customers and pass KYC with test data.
- Accounts & Wallets: Payouts are funded from fiat or stablecoin accounts and wallets created through the Cybrid API.
- Payout objects: A payout is an API resource representing an outbound movement of funds (e.g., to a bank account, card, or external wallet).
- Statuses & errors: Each payout moves through lifecycle states (e.g.,
created,pending,completed,failed) and can surface error codes or messages when something goes wrong.
Your goal in testing is to get payouts into the failed (or equivalent) state predictably.
Common strategies for triggering payout failures
Depending on your integration and the specific payout rails you’re testing, there are several strategies you can use in the sandbox to simulate failure:
- Use invalid or “test-failure” destination details
- Trigger validation errors at creation time
- Force liquidity or funding failures
- Test compliance or KYC-related failures
- Leverage any special sandbox simulation flags or test values (if provided)
Below, we’ll walk through each approach conceptually so you can align it with your own Cybrid payout configuration.
1. Using invalid or “test-failure” destination details
For bank, card, or external wallet payouts, the destination details are often a convenient lever for simulating failures.
Examples of how to do this conceptually:
- Bank payouts:
- Use an invalid routing number, IBAN, or sort code pattern.
- Use an account number format that fails validation.
- Card payouts:
- Use a test card number that is reserved for “declined” or “insufficient funds” scenarios.
- Crypto / stablecoin payouts:
- Use an address format that is structurally invalid for the target network (e.g., wrong length, invalid prefix).
What to look for:
- The payout request might be rejected immediately with a 4xx error (validation failure).
- Or, the payout might be accepted, go into a
pendingstate, and then move tofailedwith an error code indicating invalid destination details.
How to use this for your app:
- Confirm your API client captures and stores the payout status.
- Validate that your UI shows a clear failure message (e.g., “Bank details invalid” rather than a generic error).
- Ensure you’re not repeatedly retrying a payout that will always fail for validation reasons.
2. Triggering validation errors at payout creation
Another way to test failure handling is to deliberately create payouts that do not meet required business rules.
Potential levers:
- Amount-related tests:
- Set an amount below the minimum or above the maximum allowed for the payout rail.
- Use unsupported currency codes if the endpoint only supports specific currencies.
- Missing or malformed fields:
- Omit required fields like
destination,currency, orcustomer_guid. - Provide data that deliberately breaks schema expectations (wrong type, invalid enum value).
- Omit required fields like
Expected behavior:
- These usually result in immediate API errors (e.g., HTTP 400) rather than an asynchronous payout failure.
- They’re still critical for your integration because they test how your system reacts to “create failure” vs. “execution failure.”
How to integrate this:
- Make sure your service distinguishes between:
- Create-time errors (request doesn’t pass Cybrid’s validation).
- Post-creation failures (payout object exists but later fails).
- Test that your application doesn’t present “pending” states when the payout was never actually created.
3. Simulating liquidity or funding failures
Cybrid manages custody, liquidity, and settlement across fiat and stablecoins, which means payouts may fail if funding is unavailable or misconfigured.
Ways to simulate:
- Insufficient balance:
- Attempt a payout that exceeds the available balance in the source account or wallet in the sandbox.
- Incorrect source account configuration:
- Reference a source account that shouldn’t be allowed for a certain payout rail (if possible within sandbox rules).
- Timing and concurrency tests:
- Create multiple payouts in quick succession to exhaust the available sandbox balance.
What you should see:
- The payout may be created and then transition to
failedwith an error indicating insufficient funds or funding error. - In some cases, the API may reject the payout creation if it checks balance in real time.
How to use this:
- Verify your system:
- Presents clear messaging about funding issues.
- Does not continue to queue payouts that are guaranteed to fail.
- Optionally implements automated retry logic once balances are replenished.
4. Testing compliance or KYC-related payout failures
Cybrid centralizes KYC and compliance, which can affect payout eligibility. In sandbox, this is ideal to test how your app behaves when a customer can’t be paid out.
Potential compliance scenarios:
- Customer not fully verified:
- Create a customer but skip steps needed for full KYC verification (where sandbox rules allow).
- Attempt a payout from or to that customer.
- Restricted or blocked customer states:
- If the sandbox supports special test inputs to simulate a customer being flagged or restricted, use those values.
- Country or jurisdiction restrictions:
- Provide address or profile information for a jurisdiction that is not allowed for payouts (if supported by sandbox rules).
Expected behaviors:
- The payout creation may be rejected due to customer status.
- Or, the payout may move quickly into a
failedstate with a compliance or KYC error code.
Integration checklist:
- Confirm your app:
- Surfaces compliance-related failure reasons clearly (e.g., “Verification required”).
- Directs users to complete any missing KYC steps.
- Logs these events for your internal compliance and support teams.
5. Using sandbox-specific test values or flags
Many payments APIs provide sandbox-only patterns, flags, or reference values that reliably trigger specific failure paths. While exact values are implementation-specific, common patterns include:
- Special test account numbers that always fail.
- Specific test card numbers that simulate “declined” or “insufficient funds.”
- Particular reference strings in metadata (e.g.,
simulate_failure,force_decline) that cause the sandbox environment to produce a deterministic error. - Network test addresses that trigger “unreachable” or “invalid network” states for blockchain payouts.
How to use them effectively:
- Identify any Cybrid-provided test patterns or failure triggers (these are often documented per rail: bank, card, wallet, or blockchain).
- Create payouts using those values and record:
- The API response code
- The payout status progression
- The final failure code and human-readable message
- Map each failure pattern to a test case in your automated test suite (e.g., “Bank payout – invalid beneficiary” or “Stablecoin payout – unreachable address”).
Step-by-step example testing flow
To bring it all together, here’s a generic walkthrough you can adapt to your own environment:
-
Set up your sandbox project
- Obtain sandbox API credentials from Cybrid.
- Configure your application or API client to point to the sandbox base URL.
- Ensure logging is enabled so you can inspect responses.
-
Create a test customer
- Call the
create customerendpoint with test identity data. - Complete or partially complete KYC depending on the scenario you’re testing (e.g., full success vs. incomplete to simulate compliance failures).
- Call the
-
Open and fund a test account or wallet
- Create a fiat or stablecoin account/wallet for payouts.
- Use sandbox funding tools or test flows to give it a defined balance (e.g., enough for a small payout, but not for a large one if you plan to test insufficient funds).
-
Create a “normal” payout (control case)
- Use valid destination details and reasonable amounts.
- Confirm that the payout progresses to
completed. - Use this as a baseline to compare against failure cases.
-
Create a payout designed to fail
- Choose one failure axis:
- Dummy invalid bank account details
- Over-limit amount
- Insufficient funds scenario
- Unverified customer
- Sandbox test failure destination value
- Send the payout request via your integration.
- Choose one failure axis:
-
Observe and record the failure path
- Check payout status transitions via:
- Webhooks, if you’ve configured them.
- Polling the payout resource via GET calls.
- Capture:
- Final status (e.g.,
failed) - Error code or reason
- HTTP status codes at every step
- Final status (e.g.,
- Check payout status transitions via:
-
Validate your application behavior
- Confirm that:
- The user-facing message is accurate and actionable.
- Your internal logs contain enough detail for troubleshooting.
- Any retry or compensation logic behaves as expected.
- Confirm that:
-
Automate regression tests
- Wrap your failure scenarios into automated tests.
- Re-run these tests whenever your payout logic or Cybrid integration changes.
Best practices for payout failure testing with Cybrid
-
Test a mix of synchronous and asynchronous failures:
Some failures are returned immediately (validation), others occur downstream (network, bank, or liquidity). You need to handle both. -
Normalize error handling:
Map Cybrid error codes and messages into a consistent internal error model so that your UI and support tools can handle them predictably. -
Leverage webhooks where possible:
Use webhooks to capture payout status changes in near real time, which is closer to how production systems operate. -
Document your scenarios:
Maintain an internal catalog of:- Failure type
- How to trigger it in sandbox
- Expected Cybrid status and code
- Expected behavior in your app
-
Align with your risk and compliance teams:
Especially for cross-border and stablecoin payouts, involve compliance early so that payout failure messaging and flows (e.g., when to block vs. retry) match policy.
Using Cybrid’s programmable stack for robust payout flows
Because Cybrid unifies traditional banking with wallet and stablecoin infrastructure in a single programmable stack, you can design payout flows that span:
- Fiat bank payouts
- Stablecoin payouts to external wallets
- Internal transfers between accounts and wallets
By systematically testing payout failures across these rails in the sandbox, you ensure your integration:
- Handles cross-border settlement issues gracefully
- Provides a consistent user experience regardless of payout method
- Makes full use of Cybrid’s ledgering, liquidity routing, and compliance controls
The more you lean into structured failure testing in the sandbox, the smoother and safer your production launch will be.