Test payment scenarios with deterministic outcomes in our sandbox environment
config
object with its sandbox_outcome
field. Think of this as your way to instruct the sandbox exactly how a test transaction should behave, while still maintaining the proper asynchronous flow that mirrors production behavior.
customer
, paykey
, charge
, or payout
) in the sandbox, you can include a config
object that specifies your desired outcome:
"sandbox_outcome": "paid"
on a charge causes it to:
scheduled
->pending
statuspaid
status within a few minutesOutcome | Description | Use Case |
---|---|---|
standard | Customer undergoes normal review process | Testing standard onboarding flow |
verified | Customer automatically becomes verified | Testing post-verification features |
rejected | Customer automatically gets rejected | Testing rejection handling |
review | Customer enters manual review status | Testing review queue workflows |
Create a verified customer
customer_id
from the response—you’ll need it for the next steps.Create an active paykey
paykey
that you’ll use to create charges.Create a successful charge
created
pending
as it enters processingpaid
within a few minutesMonitor webhook events
created
- Initial charge creationscheduled
- Transaction verified and queued for originatonpending
- Charge delivered to networkpaid
- Funding completeCreate test entities
customer
and paykey
creation process from Example 1, or reuse existing test entities.Create a charge flagged for fraud
Handle the cancellation
cancelled
webhook statusCreate a customer with review status
Create a paykey
Create a charge that will reverse
Track the complete lifecycle
paid
statusreversed
statuson_hold
status. You can then test releasing the hold through your admin interface or API endpoints.
sandbox_outcome
field is nullable at the API level"standard"
to pass validationSimulation not working as expected
https://sandbox.straddle.io
config
object is properly formatted in your JSON requestTiming seems incorrect
Webhook events missing or duplicated
Production code includes sandbox config