Quickstart
Create and pay your first charge in the sandbox in 5 minutes.
1. Create a test key
Create an account in the dashboard, keep the environment selector on Test and generate a key under Developers, on the API keys screen. The sandbox works before your account is approved, and no real money is moved.
export GATEWAY_API_KEY="sk_test_..."2. Create a charge
The response has the Pix copy and paste code in pix.copyPaste, the QR code in pix.qrCodeBase64 and a ready-made page in checkoutUrl. The charge starts with status pending.
curl -X POST "https://api.raspay.io/v1/charges" \
-H "Authorization: Bearer $GATEWAY_API_KEY" \
-H "Idempotency-Key: order-0001" \
-H "Content-Type: application/json" \
-d '{
"amount": 15000,
"reference": "ORDER-0001",
"description": "Annual plan",
"customer": {
"name": "Ana Souza",
"document": "12345678909",
"email": "ana@example.com"
}
}'3. Simulate the payment
Nobody really pays in the sandbox. Call the simulation endpoint with the charge id, or use the button on the charge screen in the dashboard.
curl -X POST "https://api.raspay.io/v1/sandbox/charges/7c1e4f2a-3b58-4e0d-9a6c-2f8d1b7e5a10/pay" \
-H "Authorization: Bearer $GATEWAY_API_KEY"4. Check the balance
The charge is now paid, and the amount minus the fee was added to available.
curl "https://api.raspay.io/v1/balance" \
-H "Authorization: Bearer $GATEWAY_API_KEY"5. Receive the event
In live mode you do not poll the API: you register an endpoint and receive charge.paid as soon as the Pix is confirmed. See Webhooks. To go live, submit your company data in the dashboard and, once approved, replace sk_test_ with sk_live_.