PayU India API
PayU India: hashed _payment checkout, verify, refunds, transaction reports and payment links with SHA-512 signing scripts.
PaymentsGuided#payments#india#upi#refunds#hash#payment-links
Fork copies the collection into your workspace, without the publisher's secrets, so you can add your own key and send requests. Star saves it to your starred APIs (Account › Marketplace) and helps others find it.
Overview
What this is
PayU India is a payment gateway. This collection covers the classic merchant key and salt integration: collecting a payment with the _payment endpoint, then reconciling it, looking up transactions and refunding through the postservice command API. It also includes the OAuth based Payment Links API.
Get credentials
- Create a PayU merchant account at https://payu.in and sign in to the PayU dashboard.
- Test keys: follow https://docs.payu.in/docs/generate-test-merchant-key-and-salt. Production keys: https://docs.payu.in/docs/generate-merchant-key-and-salt-on-payu-dashboard.
- For Payment Links you also need an OAuth client ID and secret: https://docs.payu.in/docs/get-client-id-and-secret-from-dashboard, plus your numeric merchant ID.
Authentication
There is no bearer token for the main APIs. Every request carries your public key and a hash, a SHA-512 digest that includes your private salt. Never send the salt. The collection computes each hash in a pre-request script from the variables, so you only fill in values.
_payment:sha512(key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5||||||SALT). The five empty fields after udf5 are literal, so there are six pipes in a row before the salt.- postservice commands (verify_payment, check_payment, cancel_refund_transaction, check_action_status, getAllRefundsFromTxnIds, get_Transaction_Details, get_transaction_info):
sha512(key|command|var1|salt). - Payment Links: OAuth 2.0 client credentials against the accounts host, then
Authorization: Bearerplus amerchantIdheader.
Hosts
| Purpose | Test | Production |
|---|---|---|
_payment | https://test.payu.in | https://secure.payu.in |
| postservice commands | https://test.payu.in | https://info.payu.in |
| OAuth token | https://uat-accounts.payu.in | https://accounts.payu.in |
| Payment Links | https://uatoneapi.payu.in | https://oneapi.payu.in |
Change paymentBase, infoBase, accountsBase and linksBase together when you go live. Test and production use different keys.
Run order
- Set
merchantKeyandmerchantSalt(secret). - Folder 1: start a payment with a fresh
txnid(it is generated for you), open the response URL in a browser and pay with a PayU test instrument. - Verify with
verify_paymentusing the sametxnid; copy themihpayidintopayuId. - Folder 2 and 3: transaction lookups and refunds. Folder 4: payment links.
Limits
PayU does not publish one global rate limit; throttle polling and prefer webhooks (surl/furl callbacks) over loops. See https://docs.payu.in for current limits.
Common errors
| Symptom | Likely cause |
|---|---|
| Hash mismatch / invalid hash | Wrong field order, trailing spaces, different amount formatting between hash and body, or wrong salt |
status: 0 with "Not Found" | txnid not found on that environment (test vs production) |
| Refund rejected | Transaction not captured yet, amount above the captured amount, or reused refund token (var2) |
| invalid_scope on token | Scope not enabled for your client; request only create_payment_links, update_payment_links or read_payment_links |
Docs: https://docs.payu.in/reference/introduction
Endpoints 13
1. Start here
- POSTStart a payment (_payment)
{{paymentBase}}/_paymentCreates a hosted checkout payment. The pre-request script generates a fresh txnid and computes the SHA-512 hash from key, txnid, amount, productinfo,… - POSTVerify payment by txnid
{{infoBase}}/merchant/postservice?form=2Asks PayU for the current status of a transaction using your own txnid (var1). PayU recommends this call to reconcile after the customer returns, instead of… - POSTCheck payment by PayU id
{{infoBase}}/merchant/postservice?form=2Works like verify_payment but takes the PayU transaction id (mihpayid) as var1 instead of your own txnid. Use it when you only stored the PayU id, for example…
2. Transaction reports
- POSTGet transactions for a date range
{{infoBase}}/merchant/postservice?form=2Lists transactions between two dates: var1 is the start date and var2 the end date in YYYY-MM-DD form. The hash still uses only key, command, var1 and salt.… - POSTGet transactions for a time window
{{infoBase}}/merchant/postservice?form=2Like get_Transaction_Details but with exact times, so you can reconcile a narrow window. var1 and var2 are start and end timestamps in YYYY-MM-DD HH:MM:SS…
3. Refunds
- POSTRefund or cancel a transaction
{{infoBase}}/merchant/postservice?form=2Refunds a captured transaction, or cancels one still in the auth state. var1 is the PayU id (mihpayid), var2 is a unique refund token you invent… - POSTCheck refund status by request id
{{infoBase}}/merchant/postservice?form=2Returns the current state of one refund using the request id from the refund call (var1). States include queued, in progress, requested (processed offline,… - POSTCheck all actions by PayU id
{{infoBase}}/merchant/postservice?form=2Returns every action recorded against one transaction (capture, refunds, cancellations) when you pass the PayU id as var1 and the literal text payuid as var2.… - POSTGet all refunds for a txnid
{{infoBase}}/merchant/postservice?form=2Retrieves the full refund history of a transaction identified by your own transaction id (var1), including failed attempts. Useful when you lost the request…
4. Payment links
- POSTGet payment links access token
{{accountsBase}}/oauth/tokenExchanges your OAuth client id and secret for a bearer token (client credentials flow) on the accounts host. The scope lists what the token may do:… - POSTCreate a payment link
{{linksBase}}/payment-links/Creates a shareable payment link. The documented minimal body is subAmount (the amount), isPartialPaymentAllowed, description and source set to API. Requires… - GETGet a single payment link
{{linksBase}}/payment-links/{{invoiceNumber}}Fetches one payment link by its invoice number. Needs a token with the read_payment_links scope. Use it to check whether a link is still active or expired.… - GETGet transactions of a payment link
{{linksBase}}/payment-links/{{invoiceNumber}}/txnsLists payments made against one link, filtered by dateFrom and dateTo (YYYY-MM-DD) with pageSize paging. Each row has the PayU transaction id, status, mode,…
API details
- Base URL
https://test.payu.inhttps://secure.payu.inhttps://info.payu.inhttps://uatoneapi.payu.inhttps://oneapi.payu.in- Authentication
- An API key in the hash query parameter
OAuth 2.0 (client credentials flow) with 3 scopes - Operations
- 13 operations on 13 pathsPOST 11GET 2
- Main resources
- 1. Start here 32. Transaction reports 23. Refunds 44. Payment links 4
- Description format
- Swastik Codes guided collection, API version
checked against the docs on 2026-11-18 - Links
- Documentation
How to test the PayU India API in Swastik Codes
- Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
- Fork it into your workspaceChoose a workspace. You get your own copy of the PayU India API collection, without the publisher's secrets.
- Add your credentialsThis API uses an API key in the hash query parameter. Add yours in the collection's variables or an environment; the requests already reference it.
- Send a requestPick an endpoint, for example “Start a payment (_payment)” (POST {{paymentBase}}/_payment), and press Send. Check the response, add tests and run the whole collection with the runner.
Frequently asked questions
What is the PayU India API?
PayU India: hashed _payment checkout, verify, refunds, transaction reports and payment links with SHA-512 signing scripts. It is listed under Payments and has 13 endpoints.
Who publishes the PayU India API?
It is listed from PayU India's public API description (an OpenAPI document), not published by PayU India on Swastik Codes. Anyone who controls payu.in can claim the profile by adding a DNS TXT record.
What is the base URL of the PayU India API?
Its description lists 5 base URLs: https://test.payu.in, https://secure.payu.in, https://info.payu.in, https://uatoneapi.payu.in, https://oneapi.payu.in. The first is the usual one; the others are typically sandbox or regional servers.
How do I authenticate with the PayU India API?
It accepts 2 methods: an API key in the hash query parameter; OAuth 2.0 (client credentials flow) with 3 scopes.
How many endpoints does the PayU India API have?
13 operations on 13 paths (11 POST, 2 GET). The largest groups are 1. Start here, 2. Transaction reports, 3. Refunds, 4. Payment links.
Is forking the PayU India API free?
Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.