The UPIPayments API is a small REST API: JSON in, JSON out, GET and POST only.
Keys
Create keys under Developers › API keys. Staging keys start with sk_test_, live keys with sk_live_. The key’s mode decides which data a call sees. Send it as Authorization: Bearer sk_…, and only ever from your server.
Your first order
curl -X POST https://upipayments.demo.pepploweb.com/api/v1/orders \
-H "Authorization: Bearer sk_test_xxx" -H "Content-Type: application/json" \
-d '{"amount": 499, "order_id": "ORD-1001", "redirect_url": "https://shop.demo.pepploweb.com/thanks"}'
The reply includes the payment id, its status, the fee preview and a payment_url. Redirect your customer there.
Every reply has the same shape
{"success": true, "data": …} or {"success": false, "error": {"code": "…", "message": "…"}}. Branch on the code, show the message.
Next steps
Add a webhook endpoint, check payments with GET /orders/{id}, and read the full guide under Developers › Integration guide.
0 comments