Sandbox testing
Drive payment outcomes with POST /sandbox/simulate.
Sandbox testing
POST /sandbox/simulate drives a sandbox payment link to a chosen outcome, then delivers the matching webhook exactly as production would.
Available only to sk_test_ keys. Production keys receive 403 (sandbox_only).
Request
curl -X POST https://stggateway-sandbox.momen.co/v1/sandbox/simulate \-H "Authorization: Bearer sk_test_YOUR_KEY" \-H "Content-Type: application/json" \-d '{ "payment_link_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "event": "paid", "payment_method": "VA_BRI"}'| Field | Required | Notes |
|---|---|---|
payment_link_id | yes | UUID of a sandbox payment link |
event | yes | paid, failed, or expired |
payment_method | no | Defaults to VA_BRI. One of VA_BRI, VA_BNI, VA_MANDIRI, VA_BSI, QRIS |
What each event does
event | Link status | Webhook |
|---|---|---|
paid | Settles to succeeded | payment_link.succeeded |
failed | Stays pending (still payable) | None — status did not change |
expired | Moves to expired | payment_link.expired |
Simulating against a link that is already terminal returns 409 (payment_link_terminal).
Why not open checkout?
Sandbox checkout pages cannot be opened yet. /sandbox/simulate is the supported way to test end-to-end without a payment provider.