PayU MCP Payments
Verify payments, list transactions, refunds and settlements, and create payment links on your PayU India account.
Quick start
- Add a PayU connection with the settings below, then click Test configuration.
- Create an API key for your agent.
- Paste the key below, click Test endpoint, and copy the configuration for your platform.
| Endpoint | https://market.oshaani.com/payu (your default connection) or https://market.oshaani.com/payu/<connection-id> |
|---|---|
| Transport | Streamable HTTP (stateless, JSON responses). MCP protocol versions 2024-11-05 to 2025-11-25 and 2026-07-28. |
| Authentication | Authorization: Bearer <API key>, using a key from the API keys page. |
Agent configuration
initialize and tools/list against the endpoint, exactly like an agent. No credits are charged.
Any MCP client that supports remote (Streamable HTTP) servers with custom headers.
{
"name": "payu",
"transport": "streamable-http",
"url": "https://market.oshaani.com/payu",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
~/.cursor/mcp.json (all projects) or .cursor/mcp.json in a project.
{
"mcpServers": {
"payu": {
"url": "https://market.oshaani.com/payu",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Settings > Developer > Edit Config (claude_desktop_config.json). Uses the mcp-remote bridge; needs Node.js.
{
"mcpServers": {
"payu": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://market.oshaani.com/payu",
"--header",
"Authorization:${AUTH_HEADER}"
],
"env": {
"AUTH_HEADER": "Bearer YOUR_API_KEY"
}
}
}
}
Run in your terminal, or put the JSON in .mcp.json at the project root.
claude mcp add --transport http payu https://market.oshaani.com/payu \
--header "Authorization: Bearer YOUR_API_KEY"
# .mcp.json
{
"mcpServers": {
"payu": {
"type": "http",
"url": "https://market.oshaani.com/payu",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
.vscode/mcp.json (GitHub Copilot agent mode). VS Code prompts for the key once and stores it securely.
{
"inputs": [
{
"type": "promptString",
"id": "oshaani-mcp-key",
"description": "oshaani MCP Marketplace API key",
"password": true
}
],
"servers": {
"payu": {
"type": "http",
"url": "https://market.oshaani.com/payu",
"headers": {
"Authorization": "Bearer ${input:oshaani-mcp-key}"
}
}
}
}
~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"payu": {
"serverUrl": "https://market.oshaani.com/payu",
"headers": {
"Authorization": "Bearer YOUR_API_KEY"
}
}
}
}
Responses API remote MCP tool (Python SDK).
from openai import OpenAI
client = OpenAI()
response = client.responses.create(
model="gpt-4.1",
tools=[{
"type": "mcp",
"server_label": "payu",
"server_url": "https://market.oshaani.com/payu",
"headers": {"Authorization": "Bearer YOUR_API_KEY"},
"require_approval": "never", # or "always" to approve each tool call
}],
input="What can you do with these tools?",
)
print(response.output_text)
Messages API MCP connector (Python SDK).
import anthropic
client = anthropic.Anthropic()
response = client.beta.messages.create(
model="claude-sonnet-4-5",
max_tokens=1024,
messages=[{"role": "user", "content": "What can you do with these tools?"}],
mcp_servers=[{
"type": "url",
"url": "https://market.oshaani.com/payu",
"name": "payu",
"authorization_token": "YOUR_API_KEY",
}],
betas=["mcp-client-2025-04-04"],
)
print(response.content)
Official MCP Python SDK 2.x (pip install mcp); works inside any agent framework.
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import create_mcp_http_client, streamable_http_client
async def main():
headers = {"Authorization": "Bearer YOUR_API_KEY"}
async with create_mcp_http_client(headers=headers) as http:
async with streamable_http_client("https://market.oshaani.com/payu", http_client=http) as (read, write, *_):
async with ClientSession(read, write) as session:
await session.initialize()
tools = await session.list_tools()
print([tool.name for tool in tools.tools])
asyncio.run(main())
Quick check from a terminal: lists the tools without charging credits.
curl -s https://market.oshaani.com/payu \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "MCP-Protocol-Version: 2025-06-18" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
Connection settings
Entered once per connection on market.oshaani.com. Secrets are encrypted and never shown again or sent to agents.
| Setting | Type | Description |
|---|---|---|
Merchant keymerchant_key
required |
string | Your PayU merchant key, shown with the salt in the PayU Dashboard's developer settings pattern ^[A-Za-z0-9]{4,32}$ |
Merchant saltsalt
required secret |
string | The salt (v1) paired with the merchant key |
Environmentenvironment
|
"production" | "test" default "production" |
'test' uses PayU's sandbox (test.payu.in) with test credentials |
Allow creating payment links and refundsallow_write_actions
|
boolean default false |
Off by default: agents can only read data until this is enabled |
Largest refund per call (₹)max_refund_amount
|
number | string | Refunds above this amount are refused. Leave empty for no limit. > 0.0 |
Tools (8)
verify_payment
read-only
Get the current status, amount, mode and failure reason of one or more payments by your txnid
| Argument | Type | Description |
|---|---|---|
txnids required |
array of string | Your transaction IDs (up to 25) |
list_transactions
read-only
List transactions created between two dates (inclusive, max 31 days), newest first
| Argument | Type | Description |
|---|---|---|
from_date required |
string (date) | YYYY-MM-DD |
to_date |
string (date) | YYYY-MM-DD; defaults to from_date |
status |
string | Only this status, e.g. captured, failed, bounced, userCancelled |
limit |
integer default 50 |
Maximum transactions to return min 1, max 200 |
get_payment_actions
read-only
List the capture, refund and cancellation actions on a payment, with refund and settlement status
| Argument | Type | Description |
|---|---|---|
payu_id required |
string | PayU's transaction ID (mihpayid), e.g. 403993715521937565 pattern ^\d{6,25}$ |
get_refund_status
read-only
Get the status of a refund by the request_id PayU returned when it was created
| Argument | Type | Description |
|---|---|---|
request_id required |
string | pattern ^\d{1,25}$ |
get_settlements
read-only
Get settlement details for a settlement date or a bank UTR number
| Argument | Type | Description |
|---|---|---|
settlement_date_or_utr required |
string | YYYY-MM-DD or the settlement UTR min length 6, max length 40, pattern ^[\w-]+$ |
limit |
integer default 50 |
min 1, max 200 |
create_payment_link
Create a payment link (PayU invoice) and optionally email or text it to the customer
| Argument | Type | Description |
|---|---|---|
amount required |
number | string | Amount in rupees, e.g. 499.00 > 0.0 |
description required |
string | What the customer is paying for min length 1, max length 100 |
customer_name required |
string | min length 1, max length 60 |
customer_email |
string | max length 100, pattern ^[^@\s]+@[^@\s]+\.[^@\s]+$ |
customer_phone |
string | 10-digit Indian mobile number pattern ^[6-9]\d{9}$ |
txnid |
string | Your unique ID for this link; generated if omitted min length 1, max length 64, pattern ^[\w\-.~]+$ |
validity_days |
integer default 7 |
Days until the link expires min 1, max 365 |
send_email |
boolean default false |
|
send_sms |
boolean default false |
expire_payment_link
destructive
Expire a payment link so it can no longer be paid
| Argument | Type | Description |
|---|---|---|
txnid required |
string | Your transaction ID (txnid) sent to PayU min length 1, max length 64, pattern ^[\w\-.~]+$ |
refund_payment
destructive
Refund a successful payment in full or in part. This moves real money.
| Argument | Type | Description |
|---|---|---|
txnid required |
string | Your transaction ID (txnid) sent to PayU min length 1, max length 64, pattern ^[\w\-.~]+$ |
amount |
number | string | Partial refund in rupees; omit to refund the full amount |
refund_token |
string | Unique ID for this refund; reuse it when retrying max length 23, pattern ^[A-Za-z0-9_-]+$ |
remarks |
string | max length 200, pattern ^[A-Za-z0-9 .,()_@!-]*$ |
Billing & errors
Each successful tool call costs 1 oshaani.com credit. initialize, tools/list, failed calls and timeouts are free.
| JSON-RPC code | Meaning |
|---|---|
-32054 (HTTP 401) | Missing, unknown or revoked API key |
-32053 (HTTP 404) | No PayU connection configured for your organisation, or the connection ID is wrong |
-32055 (HTTP 403) | Connection disabled or origin not allowed |
-32052 (HTTP 429) | Rate limit reached; retry after a minute |
-32050 | Not enough oshaani.com credits for the call |
-32051 | Billing temporarily unavailable; the call was not run |
Errors from PayU itself (bad IDs, permissions) come back as tool results with isError: true so the agent can read and correct them.
See the PayU API documentation.