SPay Developers

Developer Documentation

Authentication

Send your Test API Key in X-API-KEY from your backend only. Never expose credentials in browser JavaScript.

Create an order

POST /api/v1/router.php?route=create-order Content-Type: application/json X-API-KEY: YOUR_TEST_API_KEY\nX-API-SECRET: YOUR_TEST_API_SECRET\nX-API-SECRET: YOUR_TEST_API_SECRET {"amount":"49.00","order_reference":"INV-1001","customer_name":"Test","customer_email":"test@example.com","customer_phone":"9000000000"}

Check status

GET /api/v1/router.php?route=payment-status&order_id=SP_ORDER_ID X-API-KEY: YOUR_TEST_API_KEY\nX-API-SECRET: YOUR_TEST_API_SECRET\nX-API-SECRET: YOUR_TEST_API_SECRET

Webhook security

Verify HMAC-SHA256 against the exact raw request body and timestamp. Enforce replay protection and process each event ID once.

Live processing

Live UPI payments are disabled in this package. You must onboard with an authorized PSP/acquirer and integrate its actual create-order, status-query, callback-signature, settlement and refund APIs before accepting money.