# Alipay Open Platform MCP for AI Agents AI Agent Connect

> Alipay Open Platform MCP automates payment workflows like creating trades, processing refunds, and handling fund transfers from your AI agent. It handles the heavy lifting of Alipay's financial infrastructure so you can manage transactions without manual intervention.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_YSH60sE9Sc8eAK35BSmhS2zRcSgL05odTND5FLN5/ai-agent-connect
- **Tags:** digital-payments, trade-management, refunds, fund-transfers, billing-reconciliation, mobile-commerce

## Description

The Alipay Open Platform MCP bridges your intelligent agents directly into the financial infrastructure of Alipay. You can connect your agent to handle complex financial tasks without touching a dashboard. Instead of jumping between tabs to manage orders, your agent can now handle the entire lifecycle of a transaction. It can create new trades, query their current status, or cancel them if a customer changes their mind. If a customer needs a refund, the agent handles the request and tracks the settlement status for you. For business operations, it can dispatch B2C payouts to individual accounts and pull down daily transaction summaries for your accounting records. This means you can manage high-volume commerce or complex billing cycles through simple natural language commands. By using this Connector via the Vinkius marketplace, you skip the headache of manual API signature generation because the engine takes care of the RSA-SHA256 cryptography for every request. You get a way to move money and manage orders with the same precision as a dedicated backend, but with the speed of a conversational interface.

## Tools

### refund_trade
Refund an Alipay transaction. This handles both full and partial returns for your customers.

### cancel_trade
Roll back a specific trade. Use this to stop a transaction before it is finalized.

### close_trade
Close an unpaid Alipay trade. This helps clean up pending orders that will not be completed.

### create_trade
Create a new transaction or order. Use this to initiate a payment flow for a customer.

### get_oauth_token
Exchange an authorization code for an OAuth token. This allows the agent to access secure user data.

### query_bill_download_url
Get the URL for accounting bills. Use this to fetch the files needed for your daily reconciliation.

### query_trade
Check the status of an existing trade. This lets the agent see if a payment was successful or is still pending.

### query_transfer
Check the status of a fund transfer. Use this to verify that a B2C payout reached the correct account.

### query_user_info
Query authorized Alipay user info. This helps the agent see verified customer details securely.

### transfer_fund
Transfer funds to an Alipay user account. This is the primary tool for sending out B2C payouts.

## Prompt Examples

**Prompt:** 
```
Refund order AP2024040112345 for 15.50 CNY because the item was damaged.
```

**Response:** 
```
Refund processed successfully! 

**Trade Details:**
- **Order ID:** 2024040112345
- **Refund Amount:** 15.50 CNY
- **Refund ID:** RF20240401X9A3

The settlement will reflect in the buyer's account within 3–5 business days. Would you like me to query the refund status for confirmation?
```

**Prompt:** 
```
Create a trade for 299.00 CNY for a 'Premium Subscription'.
```

**Response:** 
```
Trade created successfully! 

**Order Summary:**
- **Order ID:** AP2024041200987
- **Amount:** 299.00 CNY
- **Subject:** Premium Subscription

The payment link has been generated and the notify URL is configured to ping your webhook upon completion. The trade will auto-close in 30 minutes if unpaid. Shall I monitor the payment status?
```

**Prompt:** 
```
What was my net settlement from yesterday's bills?
```

**Response:** 
```
I have downloaded the settlement bill for 2024-04-11. Here is the summary:

| Category | Amount |
| :--- | :--- |
| **Gross Revenue** | 48,720.50 CNY |
| **Total Refunds** | 1,230.00 CNY |
| **Net Settlement** | **47,490.50 CNY** |

The detailed CSV has been parsed and is ready for export. Would you like me to flag any transactions above 5,000 CNY for review?
```

## Capabilities

### Manage trade lifecycles
Create, query, and cancel Alipay transactions directly through your agent.

### Process customer refunds
Execute full or partial refunds and track their settlement status automatically.

### Dispatch B2C payouts
Send funds to individual Alipay accounts with automated completion verification.

### Download settlement bills
Fetch daily transaction summaries to pull structured data for your accounting records.

### Access verified user profiles
Exchange authorization codes to securely retrieve customer identity information.

## Use Cases

### Refund a defective item
A customer reports a broken product. The agent uses refund_trade to issue a partial refund and confirms the settlement status.

### Bulk order creation
A merchant needs to set up 50 new subscription orders. The agent uses create_trade to generate all payment links in one go.

### Daily reconciliation
A controller asks for yesterday's revenue. The agent uses query_bill_download_url to get the CSV and summarizes the totals.

### Payout automation
A business needs to pay 100 contractors. The agent uses transfer_fund to dispatch the payments and checks status with query_transfer.

## Benefits

- Automate order management by using create_trade and query_trade to handle the full transaction lifecycle without manual dashboard entries.
- Simplify customer service by using refund_trade to process returns instantly while the agent tracks the settlement status for you.
- Speed up bookkeeping by using query_bill_download_url to pull daily summaries directly into your accounting system.
- Securely manage payouts with transfer_fund to send B2C payments while the Connector handles all the complex RSA-SHA256 signing.
- Streamline user verification by using get_oauth_token and query_user_info to access verified customer profiles safely.

## How It Works

The bottom line is you get a secure bridge to Alipay's tools without writing any custom signing logic.

1. Register as a developer on the Alipay Open Platform and create an application to get your App ID.
2. Generate an RSA2 key pair and upload your public key to the Alipay console.
3. Provide your App Private Key to the Connector to enable automatic RSA-SHA256 signature generation.

## Frequently Asked Questions

**Can the Alipay Open Platform MCP handle partial refunds?**
Yes, it can process both full and partial refunds for your transactions. Your agent will handle the request and can even track the settlement status for you.

**How does this Connector handle the complex security signatures for Alipay?**
You do not have to worry about it. The Connector handles all RSA-SHA256 signature generation automatically so your agent can interact with the API securely.

**Can I use this to send payouts to individual users?**
Yes, the Connector includes a tool to dispatch B2C payouts to Alipay user accounts. It also lets your agent verify that the transfers were completed successfully.

**How do I get my daily settlement data?**
Your agent can query the download URL for your accounting bills. It can then pull those summaries to help you reconcile your books automatically.

**Is this Connector suitable for high-volume e-commerce?**
It is built for that exact purpose. It bridges your agent to the Alipay infrastructure to manage trades, refunds, and payouts at scale.

**Does the Alipay Open Platform MCP support user identity verification?**
It can exchange authorization codes for verified customer profiles. This lets your agent access secure user info without you having to manage the OAuth flow manually.

**Can my agent check if a specific payment was successful?**
Yes, it can query the status of any specific trade. This is great for real-time updates on whether a customer's payment went through.

**Do I need to generate RSA signatures manually for each API call?**
No! Simply provide your App Private Key in PKCS1 or PKCS8 format. The engine handles all RSA-SHA256 signing, timestamping, and parameter encoding under the hood automatically on every request — you never touch signature logic directly.

**Can I process partial refunds specifying only a fraction of the original order amount?**
Yes! The `refund_trade` tool supports both full and partial refunds. Specify the original trade number, the refund amount, and a reason string. The engine will dispatch the correctly signed request and return the settlement confirmation with a unique refund ID for tracking.

**Is there any risk of accidental payments or unauthorized fund transfers through this integration?**
Every transactional action requires explicit parameters — trade amounts, recipient accounts, and refund values must all be specified deliberately. The RSA2 signature layer ensures that no request can be forged or replayed. Additionally, all operations are scoped to your registered App ID and sandbox/production environment.