UniWeb REST API for developers — payment links, transactions, refunds, webhooks.
OpenAPI 3.0 Specification (openapi.json) → Login for API Keys →uw_test_… / uw_live_…) and secret (uws_…) from Dashboard → API Settings.https://uniweb.co.in/api.php with headers X-API-Key and X-API-Secret.Idempotency-Key header for write calls (create_payment_link, create_refund) so retries never double-charge.payment_url.payment.success events.Example — get wallet balance (read call, no idempotency key needed):
curl -X POST 'https://uniweb.co.in/api.php' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: uw_test_your_key_here' \
-H 'X-API-Secret: uws_your_secret_here' \
-d '{"action":"get_balance"}'
Example — create payment link (write call, send a unique Idempotency-Key):
curl -X POST 'https://uniweb.co.in/api.php' \
-H 'Content-Type: application/json' \
-H 'X-API-Key: uw_test_your_key_here' \
-H 'X-API-Secret: uws_your_secret_here' \
-H 'Idempotency-Key: order-123-attempt-1' \
-d '{"action":"create_payment_link","amount":500,"description":"Order #123","customer_phone":"9876543210"}'
POST https://uniweb.co.in/api.php
X-API-Key — your key, e.g. uw_test_… or uw_live_… (required)X-API-Secret — your secret, e.g. uws_… (required)Idempotency-Key — unique per write request (required for create_payment_link & create_refund)Content-Type: application/jsonTest keys only work in Test Mode; live keys require completed KYC and an activated account. Rate limited — a 429 response includes a Retry-After header (seconds). If you send requests from a browser, allowlist your origin under Dashboard → API Settings.
action: create_payment_link
{"action":"create_payment_link","amount":500,"description":"Order #123","customer_phone":"9876543210"}
Write call — send a unique Idempotency-Key header. Returns payment_url on success
action: check_status
{"action":"check_status","txn_id":"TXN..."}
Transaction status and UTR
action: list_transactions
{"action":"list_transactions","limit":20}
Recent transactions (max 50)
action: get_balance
{"action":"get_balance"}
Collected, settled, available balance
action: create_refund
{"action":"create_refund","txn_id":"TXN...","amount":100,"reason":"Customer request"}
Write call — send a unique Idempotency-Key header. Amount optional — full refund if omitted
action: list_refunds
{"action":"list_refunds","limit":20}
Refund history
action: list_payment_links
{"action":"list_payment_links","limit":20}
Includes view_count analytics
action: get_payment_link
{"action":"get_payment_link","link_id":"LNK..."}
Single link with payment_url
Configure your webhook URL in Dashboard → API Settings. UniWeb POSTs JSON on payment events.
{
"event": "payment.success",
"timestamp": 1710000000,
"data": { "txn_id": "TXN...", "amount": 500, "utr": "..." }
}
Verify signature header X-UniWeb-Signature:
hash_hmac('sha256', $rawRequestBody, $your_webhook_signing_secret)
Events: payment.success · payment.failed · refund.completed · webhook.test
success: true)Retry-After)All responses are JSON. Errors include an error string.