---
name: phonepe-db0b2f4fb922
description: "Process UPI payments via PhonePe — initiate collect requests, generate QR codes, check transaction status, and handle refunds. Use when the user asks about PhonePe payments, UPI integration, Indian mobile payments, or UPI collect/QR payment flows."
metadata:
  author: ankitjh4
  display-name: PhonePe UPI Payments
---

# PhonePe UPI Payment Gateway

Accept UPI payments via PhonePe — India's leading UPI platform.

## Setup

1. Register at https://business.phonepe.com
2. Get API credentials from merchant dashboard

```bash
export PHONEPE_MERCHANT_ID="your_merchant_id"
export PHONEPE_SALT_KEY="your_salt_key"
export PHONEPE_SALT_INDEX=1
export PHONEPE_ENV="preprod"  # "preprod" for testing, "production" for live
```

| Variable | Required | Description |
|----------|----------|-------------|
| PHONEPE_MERCHANT_ID | Yes | Merchant ID from PhonePe |
| PHONEPE_SALT_KEY | Yes | Salt key for signing requests |
| PHONEPE_SALT_INDEX | Yes | Salt index (usually 1) |
| PHONEPE_ENV | No | "preprod" or "production" (default: preprod) |

## Payment Workflow

1. **Initiate payment** — use `collect` (UPI request) or `qr` (QR code) command
2. **Customer authorises** — customer approves on their UPI app
3. **Check status** — `python3 scripts/phonepe.py status "txn_id"` to confirm payment
4. **Handle result** — status returns SUCCESS, PENDING, or FAILED; retry status check if PENDING

## Usage

```bash
# Initiate UPI collect request (amount in INR)
python3 scripts/phonepe.py collect "user@upi" 100 "order123"

# Generate QR code payment
python3 scripts/phonepe.py qr 500 "order456"

# Check transaction status
python3 scripts/phonepe.py status "txn_id"

# Process refund
python3 scripts/phonepe.py refund "txn_id" 100
```

## Features

- UPI Collect (request payment from VPA)
- QR Code payments
- Transaction status checks
- Refunds

## API Endpoints

- Sandbox: `https://api-preprod.phonepe.com`
- Production: `https://api.phonepe.com`
- Docs: https://developer.phonepe.com/


---
Source attribution: ankitjh4
Original project: https://github.com/ankitjh4/indic-ai-skills/blob/cc1e36c3cba33db7949d0cc2ebd0fe69af135d49/skills/phonepe/SKILL.md
License: MIT
License information: https://opensource.org/license/mit
Original upstream instructions; downloaded from Mega AI Hub.

## Upstream license notice

MIT License

Copyright (c) 2026 Ankit (ankitjh4)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.



# Mega AI Hub resource metadata

Creator / publisher: ankitjh4
Original project: https://github.com/ankitjh4/indic-ai-skills/blob/cc1e36c3cba33db7949d0cc2ebd0fe69af135d49/skills/phonepe/SKILL.md
Attribution basis: Source repository record

Fields of work: Marketing, Sales
Roles: Business Development, Customer Success Manager, Growth Marketer, Product Marketer, Sales Development Rep (SDR)
Specialties: API
Tools: Phonepe
Country applicability: India
Classification basis: Source catalog labels
Instruction SHA-256: 79de79d3f3148ef76078265c25de6cb0f1e64c1b743c092f8f229bd51012b871
