Environments and sandbox
Differences between test and live, and how to simulate each scenario.
Test and live
Both environments have the same API and are isolated: balance, charges, keys, webhook endpoints and signing secret are separate.
| Test | Live | |
|---|---|---|
| Key | sk_test_ | sk_live_ |
| Approved account | Not needed | Required |
| Pix | Simulated QR code, cannot be paid by a bank | Real Pix |
| Payouts | Sent without approval, no money leaves | By default, wait for approval |
| Webhooks | Real, with the test secret | Real, with the live secret |
Simulate payment and refund
Use POST /v1/sandbox/charges/{id}/pay to pay a pending charge and POST /v1/sandbox/charges/{id}/refund to refund a paid one. Both send the same webhooks as live mode. With a live key, they return 403 forbidden.
curl -X POST "https://api.raspay.io/v1/sandbox/charges/7c1e4f2a-3b58-4e0d-9a6c-2f8d1b7e5a10/pay" \
-H "Authorization: Bearer $GATEWAY_API_KEY"Simulate a payout failure
Test payouts end as paid within a few seconds. To test the error path, use an amount ending in 99 cents:
| amount | Result |
|---|---|
10000 | Payout completed, event payout.paid. |
10099 | Payout fails, held amount returned, event payout.failed with failureReason equal to sandbox_simulated_failure. |
Going live
- 1Submit your company data and documents in the dashboard, under Settings, on the Business screen.
- 2Once approved, generate an sk_live_ key.
- 3Register the live webhook endpoints and use the live secret.
- 4Make a real low-value charge and confirm the webhook.