paytm-api


Namepaytm-api JSON
Version 1.2.4 PyPI version JSON
download
home_pagehttps://github.com/DragoServer/paytm_api
SummarySimple Python library to verify Paytm Merchant transaction status
upload_time2025-11-08 23:34:32
maintainerNone
docs_urlNone
authorDragoServer
requires_python>=3.7
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Paytm API

A simple and reliable Python library to **verify Paytm transaction status** using your Merchant ID (MID) and Order ID.

---

## 📘 Overview

**Paytm API** provides a direct interface to Paytm’s merchant gateway so you can instantly check payment status, transaction type, and response messages — all with a single function call.

---

## 📦 Installation

```bash
pip install paytm-api
````

---

## ⚙️ Usage Example

### ✅ Basic Example

```python
from paytm_api import verify_payment

result = verify_payment("YOUR_MID", "YOUR_ORDER_ID")
print(result)
```

---

## 🧾 Example Output (Success)

Here’s an example of a real Paytm API response for a successful transaction:

```json
{
  "TXNID": "202511090110400001085612669023341",
  "BANKTXNID": "0109851755",
  "ORDERID": "ORD9587488",
  "TXNAMOUNT": "100.00",
  "STATUS": "TXN_SUCCESS",
  "TXNTYPE": "SALE",
  "GATEWAYNAME": "PPBL",
  "RESPCODE": "01",
  "RESPMSG": "Txn Success",
  "MID": "sndhMJASHA214512",
  "PAYMENTMODE": "UPI",
  "REFUNDAMT": "0.0",
  "TXNDATE": "2025-11-09 01:09:55.0",
  "POS_ID": "DEFAULT",
  "UDF_1": "DEFAULT",
  "currentTxnCount": "1"
}
```

---

## ⚠️ Example Output (Missing or Invalid Parameters)

```json
{
  "RESPCODE": "335",
  "RESPMSG": "Missing parameters 'mid' or 'order_id'"
}
```

---

## 🧩 Parameters

| Name       | Type | Required | Description                           |
| ---------- | ---- | -------- | ------------------------------------- |
| `mid`      | str  | ✅        | Your Paytm Merchant ID                |
| `order_id` | str  | ✅        | The Paytm Order ID you want to verify |

---

## 🔁 Response Object

The function returns a Python dictionary with fields such as:

| Field         | Description                                                    |
| ------------- | -------------------------------------------------------------- |
| `RESPCODE`    | Response code (`01` for success, `335` for missing parameters) |
| `RESPMSG`     | Response message (e.g., “Txn Successful”, “Invalid Order Id.”) |
| `ORDERID`     | The Order ID you supplied                                      |
| `TXNAMOUNT`   | Transaction amount                                             |
| `STATUS`      | Transaction status (`TXN_SUCCESS`, `TXN_FAILURE`, etc.)        |
| `PAYMENTMODE` | Payment method used (`UPI`, `CARD`, `NB`, etc.)                |
| `TXNDATE`     | Transaction date and time                                      |
| `REFUNDAMT`   | Refunded amount (if applicable)                                |

Additional fields may appear based on Paytm’s API response.

---

## ❗ Error Handling

If required parameters are missing or invalid, the function returns a clean JSON response indicating the issue.

```python
from paytm_api import verify_payment

result = verify_payment("", "")
print(result)
# Output: {'RESPCODE': '335', 'RESPMSG': "Missing parameters 'mid' or 'order_id'"}
```

---

## 🔌 Integrations

You can easily integrate this library with:

* Telegram bots (for checking payment status)
* Django / Flask / FastAPI apps
* Admin dashboards or back-end systems
* Automation scripts and cron jobs

---

## 👤 Author

**Author:** DragoServer

**GitHub:** [https://github.com/DragoServer](https://github.com/DragoServer)

---

## 🪪 License

**License:** MIT License
You’re free to use, modify, and distribute this package with proper credit.

---

### ⭐ Thank you for using Paytm API

If you encounter any issues or want to contribute improvements, please open an issue.



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/DragoServer/paytm_api",
    "name": "paytm-api",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": null,
    "keywords": null,
    "author": "DragoServer",
    "author_email": "drago.ftw@litedns.xyz",
    "download_url": "https://files.pythonhosted.org/packages/52/5a/1f0f531e1e796eb24bd04fa69705f8d448c3a18f42ba48bb3f9c28430d65/paytm_api-1.2.4.tar.gz",
    "platform": null,
    "description": "# Paytm API\n\nA simple and reliable Python library to **verify Paytm transaction status** using your Merchant ID (MID) and Order ID.\n\n---\n\n## \ud83d\udcd8 Overview\n\n**Paytm API** provides a direct interface to Paytm\u2019s merchant gateway so you can instantly check payment status, transaction type, and response messages \u2014 all with a single function call.\n\n---\n\n## \ud83d\udce6 Installation\n\n```bash\npip install paytm-api\n````\n\n---\n\n## \u2699\ufe0f Usage Example\n\n### \u2705 Basic Example\n\n```python\nfrom paytm_api import verify_payment\n\nresult = verify_payment(\"YOUR_MID\", \"YOUR_ORDER_ID\")\nprint(result)\n```\n\n---\n\n## \ud83e\uddfe Example Output (Success)\n\nHere\u2019s an example of a real Paytm API response for a successful transaction:\n\n```json\n{\n  \"TXNID\": \"202511090110400001085612669023341\",\n  \"BANKTXNID\": \"0109851755\",\n  \"ORDERID\": \"ORD9587488\",\n  \"TXNAMOUNT\": \"100.00\",\n  \"STATUS\": \"TXN_SUCCESS\",\n  \"TXNTYPE\": \"SALE\",\n  \"GATEWAYNAME\": \"PPBL\",\n  \"RESPCODE\": \"01\",\n  \"RESPMSG\": \"Txn Success\",\n  \"MID\": \"sndhMJASHA214512\",\n  \"PAYMENTMODE\": \"UPI\",\n  \"REFUNDAMT\": \"0.0\",\n  \"TXNDATE\": \"2025-11-09 01:09:55.0\",\n  \"POS_ID\": \"DEFAULT\",\n  \"UDF_1\": \"DEFAULT\",\n  \"currentTxnCount\": \"1\"\n}\n```\n\n---\n\n## \u26a0\ufe0f Example Output (Missing or Invalid Parameters)\n\n```json\n{\n  \"RESPCODE\": \"335\",\n  \"RESPMSG\": \"Missing parameters 'mid' or 'order_id'\"\n}\n```\n\n---\n\n## \ud83e\udde9 Parameters\n\n| Name       | Type | Required | Description                           |\n| ---------- | ---- | -------- | ------------------------------------- |\n| `mid`      | str  | \u2705        | Your Paytm Merchant ID                |\n| `order_id` | str  | \u2705        | The Paytm Order ID you want to verify |\n\n---\n\n## \ud83d\udd01 Response Object\n\nThe function returns a Python dictionary with fields such as:\n\n| Field         | Description                                                    |\n| ------------- | -------------------------------------------------------------- |\n| `RESPCODE`    | Response code (`01` for success, `335` for missing parameters) |\n| `RESPMSG`     | Response message (e.g., \u201cTxn Successful\u201d, \u201cInvalid Order Id.\u201d) |\n| `ORDERID`     | The Order ID you supplied                                      |\n| `TXNAMOUNT`   | Transaction amount                                             |\n| `STATUS`      | Transaction status (`TXN_SUCCESS`, `TXN_FAILURE`, etc.)        |\n| `PAYMENTMODE` | Payment method used (`UPI`, `CARD`, `NB`, etc.)                |\n| `TXNDATE`     | Transaction date and time                                      |\n| `REFUNDAMT`   | Refunded amount (if applicable)                                |\n\nAdditional fields may appear based on Paytm\u2019s API response.\n\n---\n\n## \u2757 Error Handling\n\nIf required parameters are missing or invalid, the function returns a clean JSON response indicating the issue.\n\n```python\nfrom paytm_api import verify_payment\n\nresult = verify_payment(\"\", \"\")\nprint(result)\n# Output: {'RESPCODE': '335', 'RESPMSG': \"Missing parameters 'mid' or 'order_id'\"}\n```\n\n---\n\n## \ud83d\udd0c Integrations\n\nYou can easily integrate this library with:\n\n* Telegram bots (for checking payment status)\n* Django / Flask / FastAPI apps\n* Admin dashboards or back-end systems\n* Automation scripts and cron jobs\n\n---\n\n## \ud83d\udc64 Author\n\n**Author:** DragoServer\n\n**GitHub:** [https://github.com/DragoServer](https://github.com/DragoServer)\n\n---\n\n## \ud83e\udeaa License\n\n**License:** MIT License\nYou\u2019re free to use, modify, and distribute this package with proper credit.\n\n---\n\n### \u2b50 Thank you for using Paytm API\n\nIf you encounter any issues or want to contribute improvements, please open an issue.\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple Python library to verify Paytm Merchant transaction status",
    "version": "1.2.4",
    "project_urls": {
        "Homepage": "https://github.com/DragoServer/paytm_api"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "a82ffb68f82d12ecc6932c52962796edb747b64009f6e093d3ca9e6a0454fdd1",
                "md5": "7c1088b16fc25c7e28cf4788852ec711",
                "sha256": "f1c9a30f80a119e8084fc14904e10f1009a9445845ddc060c2de4f26867f3846"
            },
            "downloads": -1,
            "filename": "paytm_api-1.2.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7c1088b16fc25c7e28cf4788852ec711",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 3533,
            "upload_time": "2025-11-08T23:34:31",
            "upload_time_iso_8601": "2025-11-08T23:34:31.488990Z",
            "url": "https://files.pythonhosted.org/packages/a8/2f/fb68f82d12ecc6932c52962796edb747b64009f6e093d3ca9e6a0454fdd1/paytm_api-1.2.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "525a1f0f531e1e796eb24bd04fa69705f8d448c3a18f42ba48bb3f9c28430d65",
                "md5": "f223c328c3b0f918acabaade1bc0982a",
                "sha256": "3cc8ddc8f090a4cb87bd68ad0fa4279cc9c479e7e73f2e9984baaef3708b69a0"
            },
            "downloads": -1,
            "filename": "paytm_api-1.2.4.tar.gz",
            "has_sig": false,
            "md5_digest": "f223c328c3b0f918acabaade1bc0982a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 3259,
            "upload_time": "2025-11-08T23:34:32",
            "upload_time_iso_8601": "2025-11-08T23:34:32.505232Z",
            "url": "https://files.pythonhosted.org/packages/52/5a/1f0f531e1e796eb24bd04fa69705f8d448c3a18f42ba48bb3f9c28430d65/paytm_api-1.2.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-08 23:34:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "DragoServer",
    "github_project": "paytm_api",
    "github_not_found": true,
    "lcname": "paytm-api"
}
        
Elapsed time: 2.09289s