Paytm

Paytm Payment Gateway API

Paytm PG with working checksum signing: initiate transaction, payment page, status, refunds and payment links on staging.

PaymentsGuided#payments#upi#india#refunds#payment-links#checksum

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

Paytm Payment Gateway (run by Paytm Payments Services Limited; docs now at paytmpayments.com) accepts UPI, cards, net banking, Paytm wallet and EMI from Indian customers. Its server APIs follow one pattern: a JSON envelope {"head": {...}, "body": {...}}, where head.signature is a checksum of body made with your merchant key. This guided collection covers the core one-time payment flow, transaction status, refunds and payment links, starting on staging.

Get credentials

  1. Create a business account at dashboard.paytmpayments.com and open Developer Settings > API Keys.
  2. Generate the staging (test) keys: you get a test MID and Merchant Key. Production keys appear after account activation (KYC).
  3. Fill mid and the secret merchantKey. Keep websiteName as WEBSTAGING on staging (production normally uses DEFAULT).
  4. Set callbackUrl to an HTTPS page on your server that receives the payment result.

Authentication: the checksum signature

Signed requests carry head.signature, computed over the exact JSON string of body: take SHA256(body + "|" + salt) as hex, append the 4-character salt, then AES-128-CBC encrypt with the merchant key (IV @@@@&&&&####$$$$) and Base64 the result. This collection's pre-request scripts do this with CryptoJS (checked against Paytm's official Node library) and send the compact JSON that was signed, so whitespace cannot break the checksum. In your own backend use Paytm's checksum library (Node, Python, Java, PHP) and also verify the CHECKSUMHASH Paytm sends to your callback. Calls made after Initiate a transaction (payment options, VPA check, process transaction) are authorised by the txnToken instead.

Base URLs (staging first)

VariableStagingProduction
theiaUrl (initiate, checkout, links)https://securestage.paytmpayments.comhttps://secure.paytmpayments.com
gwUrl (status, refunds)https://securegw-stage.paytmpayments.inhttps://securegw.paytmpayments.in

Run order

  1. 1. Start here: Initiate a transaction (new orderId each send, saves txnToken).
  2. 2. Checkout: open the payment page in a browser (or use the Custom Checkout calls), pay with a staging test instrument from the testing guide.
  3. 3. Status: Transaction status saves txnId.
  4. 4. Refunds, then the optional 5. Payment links.

Limits and pricing

Paytm applies per-merchant transaction limits and MDR pricing agreed at onboarding; see paytmpayments.com and your dashboard. Poll status sparingly; prefer the callback and webhooks (Callback and webhook docs).

Common errors

ResultMeaning / fix
resultStatus: F, checksum/signature errorWrong merchantKey, wrong MID, or the body changed after signing
334 Invalid Order IdNo such order for this MID and environment
400 / 402 PENDINGNot final yet; check status again
227, 810 TXN_FAILUREDeclined or failed payment
607, 636 on refundTransaction cancelled, or older than one year

Links

Endpoints 14

1. Start here

  • POSTInitiate a transaction (get txnToken){{theiaUrl}}/theia/api/v1/initiateTransactionCreates a payment session for one order and returns a txnToken. Every checkout flow (JS Checkout, All-in-One SDK, the hosted payment page, Custom Checkout)…

2. Checkout

  • POSTOpen the hosted payment page (form post){{theiaUrl}}/theia/api/v1/showPaymentPageOn a website, the customer's browser normally posts mid, orderId and txnToken as a form to this URL to open Paytm's payment page. Sending it here returns that…
  • POSTFetch payment options{{theiaUrl}}/theia/api/v2/fetchPaymentOptionsLists the payment methods this order can use (UPI, cards, net banking, wallet, EMI, with merchant details). Custom Checkout uses it to draw its own payment…
  • POSTValidate a UPI ID{{theiaUrl}}/theia/api/v1/vpa/validateChecks that a customer's UPI ID (VPA) exists before you start a UPI collect payment. Authorised by the txnToken from Initiate a transaction; no signature.…
  • POSTPay by UPI collect (process transaction){{theiaUrl}}/theia/api/v1/processTransactionCustom Checkout: pays the initiated order with a chosen method. Here paymentMode: UPI with payerAccount (the customer's VPA) sends a collect request to their…
  • POSTUpdate the order amount{{theiaUrl}}/theia/api/v1/updateTransactionDetailChanges the amount (and user info) of an initiated order before it is paid, for example after the customer applies a coupon. The head carries both the…

3. Status

  • POSTTransaction status{{gwUrl}}/v3/order/statusThe authoritative result of an order. Call it after the callback reaches your server (never trust the browser redirect alone) and to reconcile pending orders.…

4. Refunds

  • POSTRefund a transaction{{gwUrl}}/refund/applyRefunds all or part of a successful transaction. Needs the order's orderId and Paytm txnId (saved by Transaction status); the pre-request script creates a new…
  • POSTRefund status{{gwUrl}}/v2/refund/statusReturns the state of a refund by orderId and your refId. TXN_SUCCESS means the money is on its way back; refundDetailInfoList shows the method and the…

5. Payment links

  • POSTCreate a payment link{{theiaUrl}}/link/createCreates a shareable payment link. Head uses tokenType: AES plus the signature. Link types: FIXED (set amount), GENERIC (customer enters the amount) and…
  • POSTFetch payment links{{theiaUrl}}/link/fetchLists your payment links, or one link when you pass linkId. Supports paging (pageNo, pageSize) and a searchFilterRequestBody with fromDate, toDate and…
  • POSTFetch a link's transactions{{theiaUrl}}/link/fetchTransactionReturns the orders paid (or attempted) through one payment link: orderId, txnId, orderStatus, amount and masked customer contact. Set fetchAllTxns: true to…
  • POSTResend a payment link{{theiaUrl}}/link/resendNotificationAsks Paytm to send an existing link again by SMS and/or email. Put the number or address in notifyContact (customerMobile, customerEmail) and set sendSms /…
  • POSTExpire a payment link{{theiaUrl}}/link/expireDeactivates a link immediately so it can no longer be paid. Use it when an order is cancelled or a link was sent by mistake. Returns resultStatus: SUCCESS…

API details

Base URL
https://securestage.paytmpayments.com
https://secure.paytmpayments.com
https://securegw-stage.paytmpayments.in
https://securegw.paytmpayments.in
Authentication
A provider-specific scheme
Operations
14 operations on 14 pathsPOST 14
Main resources
1. Start here 12. Checkout 53. Status 14. Refunds 25. Payment links 5
Description format
Swastik Codes guided collection, API version checked against the docs on 2026-11-18

How to test the Paytm Payment Gateway API in Swastik Codes

  1. Open the APISelect “Fork & run in Swastik Codes” on this page. Sign in or create a free account if asked.
  2. Fork it into your workspaceChoose a workspace. You get your own copy of the Paytm Payment Gateway API collection, without the publisher's secrets.
  3. Add your credentialsThis API uses A provider-specific scheme. Add yours in the collection's variables or an environment; the requests already reference it.
  4. Send a requestPick an endpoint, for example “Initiate a transaction (get txnToken)” (POST {{theiaUrl}}/theia/api/v1/initiateTransaction), and press Send. Check the response, add tests and run the whole collection with the runner.

Frequently asked questions

What is the Paytm Payment Gateway API?

Paytm PG with working checksum signing: initiate transaction, payment page, status, refunds and payment links on staging. It is listed under Payments and has 14 endpoints.

Who publishes the Paytm Payment Gateway API?

It is listed from Paytm's public API description (an OpenAPI document), not published by Paytm on Swastik Codes. Anyone who controls paytm.com can claim the profile by adding a DNS TXT record.

What is the base URL of the Paytm Payment Gateway API?

Its description lists 4 base URLs: https://securestage.paytmpayments.com, https://secure.paytmpayments.com, https://securegw-stage.paytmpayments.in, https://securegw.paytmpayments.in. The first is the usual one; the others are typically sandbox or regional servers.

How do I authenticate with the Paytm Payment Gateway API?

With A provider-specific scheme.

How many endpoints does the Paytm Payment Gateway API have?

14 operations on 14 paths (14 POST). The largest groups are 1. Start here, 2. Checkout, 3. Status, 4. Refunds.

Is forking the Paytm Payment Gateway API free?

Yes. Forking copies the collection into your workspace for free. It has been starred 0 times and forked 0 times.

Suggest an API

Tell us which public API is missing. We check it, then add it here with its endpoints when it has an OpenAPI (Swagger) description.