Overview
Webhook simulators let you test offline payment flows in development without real money movement:- SPEI (STP/OPM): simulate bank deposits using a CLABE
- PayCash: simulate a cash deposit using the PayCash reference
- CIE Cash Net: simulate BBVA deposit reconciliation using the CIE reference
No Real Transfers
Test without moving real money
Instant Feedback
No waiting for actual bank processing
Test Failures
Simulate failed payments and refunds
Full Webhooks
Receive the same webhooks as production
How It Works
1
Create SPEI Payment
Create a SPEI payment using the payments API. The payment will be in
PENDING_CAPTURE status with a CLABE assigned.2
Trigger Simulator
Call the simulator endpoint with the CLABE and desired action (
pass or fail).3
Receive Webhook
Your webhook endpoint receives the same payment status change webhook as production.
Available Simulators
STP Simulator
OPM Simulator
PayCash Simulator
PayCash does not auto-complete in sandbox like SPEI. Use this simulator (or a full deposit webhook flow) to move the payment to
CAPTURED and receive payment.capture.success on your merchant webhook.CIE Cash Net Simulator
CIE Cash Net does not auto-complete in sandbox like SPEI. Use this simulator to mimic BBVA reconciliation, move the payment to
CAPTURED, and receive payment.capture.success on your merchant webhook.Available Actions
Payment Capture
Refunds (SPEI only)
Testing Payment Capture
Step 1: Create a SPEI Payment
Save the CLABE from
paymentMethod.speiDetails.clabe. You’ll need it to trigger the simulator.Step 2: Simulate Successful Deposit
Step 3: Receive Webhook
Your webhook endpoint will receive apayment.capture.success event:
Testing PayCash Capture
Step 1: Create a PayCash Payment Order
PayCash amount limit: For now, PayCash orders are supported up to 20,000 MXN only. Amounts in the API are in centavos, so the maximum
amount for MXN is 2000000 (20,000.00 MXN). Use card or SPEI for higher values.Save the reference from
paymentMethod.paycashDetails.reference. You’ll need it to trigger the simulator.Step 2: Simulate Successful Deposit
Step 3: Receive Webhook
Your webhook endpoint receivespayment.capture.success with data.paymentMethod.options.paycash.reference set to the same reference:
You may receive
payment.auth.pending earlier while the payment is still PENDING_CAPTURE. Fulfill the order only after payment.capture.success.Testing CIE Cash Net Capture
Step 1: Create a CIE Cash Net Payment Order
Save the reference from
paymentMethod.cieDetails.reference. You’ll need it to trigger the simulator.Step 2: Simulate Successful Reconciliation
Step 3: Receive Webhook
Your webhook endpoint receivespayment.capture.success with data.paymentMethod.options.cieCashNet set to the same reference, convenio, and CLABE:
Testing Failed Payments
Simulate a failed payment to test error handling:payment.auth.failed event (payments transitioning to FAILED emit payment.auth.failed; a distinct payment.capture.failed event is not emitted today).
Testing Refunds
Step 1: Request a Refund
First, create a refund for a captured payment:PENDING_REFUND.
Step 2: Simulate Refund Processing
Step 3: Receive Refund Webhook
Your webhook endpoint will receive apayment.refund.success event with the payment status as REFUNDED.
Simulator Behavior
Multiple Pending Payments
If you have multiple payments with the same CLABE inPENDING_CAPTURE status:
- The simulator sums all pending amounts
- Simulates a single deposit for the total amount
- All pending payments are captured
Already Captured Payments
If the payment is alreadyCAPTURED:
- The simulator detects it’s already processed
- Sends a webhook to your endpoint anyway (useful for testing webhook retry logic)
- Returns
success: true
Payment Not Found
If no payment matches the CLABE and status:STP vs OPM Differences
Complete Test Flow Example
Here’s a complete example testing a payment failure and retry:1
Create Payment
PENDING_CAPTURE2
Simulate Failure
FAILEDYour webhook receives: payment.auth.failed3
Customer Retries
Create a new payment with the same CLABEPayment status:
PENDING_CAPTURE4
Simulate Success
CAPTUREDYour webhook receives: payment.capture.successBest Practices
Test Both Success and Failure
Test Both Success and Failure
Always test both
pass and fail scenarios to ensure your error handling works correctly.Use Unique CLABEs
Use Unique CLABEs
Use different CLABEs for different test scenarios to avoid confusion.
Test Webhook Handling
Test Webhook Handling
Verify your webhook endpoint correctly processes all payment status changes.
Test Idempotency
Test Idempotency
Trigger the simulator multiple times with the same CLABE to test duplicate webhook handling.
Common Testing Scenarios
Scenario 1: Successful Payment Flow
Test the happy path from payment creation to capture:Scenario 2: Payment Failure
Test error handling when deposits fail:Scenario 3: Refund Flow
Test complete refund processing:Limitations
Next Steps
Webhooks Guide
Learn how to handle production webhooks
SPEI Payments
Understand SPEI payment flows
PayCash Payments
Understand PayCash payment flows
CIE Cash Net Payments
Understand CIE Cash Net payment flows
Testing Guide
Complete testing best practices
Error Handling
Handle payment failures gracefully