1) Set up your Waftpay environment
Create Sandbox credentials
Create Sandbox credentials
- Open the Waftpay Dashboard and create a Client ID and Client Secret for Sandbox.
- Store them securely (e.g., environment variables, secrets manager).
Generate signing keys (RSA‑2048)
Generate signing keys (RSA‑2048)
We sign requests with a 2048‑bit RSA private key.Upload the public key in Dashboard. Keep the private key on your server only.
Pick your base URL
Pick your base URL
- Sandbox:
https://sandbox.waftpay.io/api - Production:
https://api.waftpay.io
2) Get an access token
Exchange client credentials for a short‑lived Bearer token. cURL (Sandbox)access_token and expires_in.
3) Sign your request
Each write operation must includeX-Custom-Signature. The signature is computed from a canonical string derived from the request (method, path, timestamp, body hash). See full rules in /api-reference/signatures/signature-generate.
Pseudo (Node.js)
4) Create your first payout (Sandbox)
EndpointPOST /payments-api-service/v1/payouts
Complete cURL (Sandbox)
- 202 Accepted with code
200.001.000→ request queued; final result is delivered to yourcallback_url. - 4xx/5xx → see /errors for how to interpret extended codes (e.g.,
400.001.300missing field).
5) Handle the webhook
Yourcallback_url receives the final delivery state. Respond with 2xx quickly.
transaction.reference and request_id.
Language examples (server‑side)
- Node.js (fetch)
- Python (requests)
6) What to expect & next steps
- 202 Accepted → Track the final outcome via webhook.
- 4xx/5xx → See /errors. Fix the payload for 4xx; retry with backoff for 5xx.
- Use unique
transaction.referenceper attempt and idempotency on retries.
You’ve made your first Sandbox payout! When you’re ready for live funds, switch base URL & credentials — see /environments.
