API Documentation

UniWeb REST API for developers — payment links, transactions, refunds, webhooks.

OpenAPI 3.0 Specification (openapi.json) → Login for API Keys →

Quick Start

  1. Sign up and complete KYC (or use Test Mode with test API keys).
  2. Copy your API key (uw_test_… / uw_live_…) and secret (uws_…) from Dashboard → API Settings.
  3. POST JSON to https://uniweb.co.in/api.php with headers X-API-Key and X-API-Secret.
  4. Add an Idempotency-Key header for write calls (create_payment_link, create_refund) so retries never double-charge.
  5. Create a payment link and redirect customers to payment_url.
  6. Configure your webhook URL to receive 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"}'

Base URL & Authentication

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/json

Test 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.

Create Payment Link

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

Check Status

action: check_status

{"action":"check_status","txn_id":"TXN..."}

Transaction status and UTR

List Transactions

action: list_transactions

{"action":"list_transactions","limit":20}

Recent transactions (max 50)

Get Balance

action: get_balance

{"action":"get_balance"}

Collected, settled, available balance

Create Refund

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

List Refunds

action: list_refunds

{"action":"list_refunds","limit":20}

Refund history

List Payment Links

action: list_payment_links

{"action":"list_payment_links","limit":20}

Includes view_count analytics

Get Payment Link

action: get_payment_link

{"action":"get_payment_link","link_id":"LNK..."}

Single link with payment_url

Outbound Webhooks (to your server)

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

Gateway Webhooks (Admin)

  • Razorpay: https://uniweb.co.in/razorpay_webhook.php
  • Cashfree: https://uniweb.co.in/cashfree_webhook.php
  • PayU: https://uniweb.co.in/payu_webhook.php
  • Axis VA: https://uniweb.co.in/axis_webhook.php

Response Codes

200 — Success (success: true)
400 — Bad request (missing/invalid fields or JSON)
401 — Invalid or missing API key/secret
403 — Mode mismatch or origin not allowed
404 — Transaction or link not found
405 — Only POST is allowed
409 — Idempotency-Key reused with a different payload
429 — Rate limited (see Retry-After)

All responses are JSON. Errors include an error string.