Sandbox
The PayElect sandbox is a full-featured environment that mirrors production behaviour without moving real money. Every API endpoint, webhook, and redirect flow is available. The sandbox fires real webhook deliveries.
Sandbox credentials
| Field | Value |
|---|---|
| Payer email | sandbox@payelect.com |
| Payer username | payelect |
| Payer wallet balance | 100,000 (any currency) |
| Email OTP (when enabled) | 123456 |
| Base URL | https://api.payelecthq.com/pay/sandbox/api/v1 |
Test scenarios
You can trigger specific outcomes using the X-Sandbox-Scenario request header or the _scenario body parameter on POST /payment/create. The scenario is inherited by the payment confirm step — you do not need to resend it.
| Scenario key | Outcome | Webhook fired | Return URL type |
|---|---|---|---|
success (default) |
Payment completes successfully | payment.succeeded |
type=success |
failure |
Generic provider error | payment.failed |
type=error, code 402 |
declined |
Card or wallet declined | payment.failed |
type=error, code 402 |
insufficient_funds |
Payer's wallet balance too low | payment.failed |
type=error, code 402 |
timeout |
Provider did not respond — payment left PENDING | payment.pending |
type=pending, code 202 |
pending |
Async confirmation pending — no initial webhook | (none initially) | type=pending, code 202 |
Example: trigger a declined payment
curl -X POST https://api.payelecthq.com/pay/sandbox/api/v1/payment/create \
-H "Authorization: Bearer <access_token>" \
-H "Content-Type: application/json" \
-H "X-Sandbox-Scenario: declined" \
-d '{
"amount": "50000",
"currency": "GNF",
"country": "GN",
"return_url": "https://your-store.com/return",
"cancel_url": "https://your-store.com/cancel",
"idempotency_key": "test-declined-001"
}'
Alternatively, pass "_scenario": "declined" in the request body (useful from frontend code where custom headers aren't always possible).
Set scenario via dedicated endpoint
For test suites that reuse the same payment session, you can also set the active scenario explicitly:
curl -X POST https://api.payelecthq.com/pay/sandbox/api/v1/simulate/scenario \
-H "Content-Type: application/json" \
-d '{ "scenario": "insufficient_funds" }'
Webhook delivery in sandbox
The sandbox fires real webhook deliveries to your configured sandbox webhook URL. Register it separately from your production URL in the merchant portal under Developer → Webhooks.
pending scenario intentionally suppresses the initial webhook to let you test the poll-and-wait pattern. Manually resolve the payment from the merchant portal event log, or poll GET /payment/status until you call it resolved in your test suite.
Resetting sandbox state
Sandbox transaction records and wallet balances can be reset from the merchant portal under Developer → Sandbox → Reset. This is irreversible and only affects the sandbox environment.