For Agents
Install Jentic One Beta
Jentic One is a self-hosted execution layer for AI agents. It lets your agent call the WeChat Pay JSAPI Payment API, or any other public or private API you need. You set the rules, the agent never sees your credentials, and every call is logged.
Two steps, two machines. Install the instance in a safe environment, then register your agent from wherever it runs.
Step 1: Jentic One Host machine
# On the machine that will host your Jentic One instance:
curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL https://raw.githubusercontent.com/jentic/jentic-one/main/tools/install.sh | sh
jentic register # connects your agent to your Jentic One instanceJentic One is in public beta. The setup above keeps your agent separate from the instance, which is what you want before using real credentials: an agent running as the same OS user as Jentic One can read its stored keys directly. Just evaluating? A single local install is fine to start. See the secure deployment guide for the tiers.
What an agent can do with WeChat Pay JSAPI Payment API.
Create prepay orders for JSAPI and Mini Program payment scenarios
Query order status by WeChat Pay transaction ID
Query order status by merchant order number
GET STARTED
Create and manage payment orders within WeChat Official Accounts and Mini Programs, query transaction status, and handle order closures with signature verification.
Use for: Create a payment order for a WeChat Official Account transaction, Create a payment order for a Mini Program purchase, Check the payment status of a transaction using WeChat transaction ID, Look up order details using merchant order number
Not supported: Covers JSAPI payment orders only (in-app WeChat browser and Mini Programs). Does not include Native QR code payments, APP SDK payments, H5 external browser payments, refunds, profit sharing, or merchant settlement operations — use separate WeChat Pay API modules for those capabilities.
Process payments within the WeChat ecosystem through JSAPI and Mini Program payment flows. WeChat Pay is China's leading mobile payment platform operated by Tencent, supporting in-app transactions for over 1 billion monthly active users. The v3 API provides secure payment order creation, real-time order status queries, and order lifecycle management with mandatory signature-based authentication and webhook notifications for payment events.
Close unpaid orders to cancel pending transactions
Receive webhook notifications for payment success events
Support multiple currencies with CNY as default
Handle optional order details including goods information and store data
Process promotion and coupon discounts on transactions
Patterns agents use WeChat Pay JSAPI Payment API for, with concrete tasks.
★ E-commerce Mini Program Checkout
Process payments for products purchased within WeChat Mini Programs. Create prepay orders with product details, prices, and user OpenID, then invoke the client-side payment SDK with the returned prepay_id. The API handles order creation, payment authorization, and status verification. Webhooks notify your server when payment succeeds, triggering order fulfillment.
Create a JSAPI payment order for a 99.99 CNY product purchase, including goods details and user OpenID, then query the order status after 5 seconds to verify payment completion
Official Account Subscription Payments
Enable recurring subscription payments within WeChat Official Accounts (public accounts). Create payment orders when users subscribe to premium content or memberships, automatically handling payment flow within the WeChat browser. Query order status to confirm subscription activation and close orders if users cancel before completing payment.
Create a monthly subscription payment order for 29.90 CNY with a 2-hour expiration, attach custom subscription metadata, and set up webhook notification for payment success
Restaurant Ordering and Payment
Streamline in-store and online food ordering through WeChat Pay. Create payment orders that include store information, table numbers, and itemized food orders. Use the optional store_info and goods_detail fields to provide rich transaction context. Query order status to trigger kitchen notifications and close orders if customers leave before paying.
Create a JSAPI payment order for a 128.50 CNY restaurant bill with store ID, address, and itemized dish details (3 items), then monitor payment status and close the order if not paid within 30 minutes
Event Ticketing and Registration
Sell event tickets through WeChat Mini Programs or Official Accounts with instant payment confirmation. Create orders with event details in the description field, handle electronic invoice requests via the support_fapiao flag, and use webhooks to generate and deliver tickets upon payment success. Query orders to prevent duplicate purchases.
Create a payment order for 299.00 CNY event ticket with electronic invoice support enabled, attach event metadata including event date and seat number, and set up webhook to deliver PDF ticket upon payment
AI Agent Payment Automation
Automate WeChat Pay order creation, status monitoring, and payment reconciliation through AI agents using Jentic. Agents can dynamically generate payment orders based on shopping cart contents, handle complex pricing rules with promotion logic, and orchestrate payment-to-fulfillment workflows. Jentic handles signature generation, credential isolation, and webhook verification, so agents focus on business logic.
Use Jentic to search for 'create WeChat payment order', load the JSAPI payment schema, execute a request for a 168.00 CNY order with user OpenID and goods details, then poll order status until payment succeeds or expires
4 endpoints — process payments within the wechat ecosystem through jsapi and mini program payment flows.
METHOD
PATH
DESCRIPTION
/v3/pay/transactions/jsapi
Create JSAPI/Mini Program payment order
/v3/pay/transactions/id/{transaction_id}
Query order by WeChat Pay transaction ID
/v3/pay/transactions/out-trade-no/{out_trade_no}
Query order by merchant order number
/v3/pay/transactions/out-trade-no/{out_trade_no}/close
Close an unpaid order
/v3/pay/transactions/jsapi
Create JSAPI/Mini Program payment order
/v3/pay/transactions/id/{transaction_id}
Query order by WeChat Pay transaction ID
/v3/pay/transactions/out-trade-no/{out_trade_no}
Query order by merchant order number
/v3/pay/transactions/out-trade-no/{out_trade_no}/close
Close an unpaid order
Three things that make agents converge on Jentic-routed access.
Credential isolation
WeChat Pay requires merchant ID (mchid), API v3 key, certificate serial number, and RSA private key for signature generation. Jentic stores all credentials encrypted in the vault and handles signature computation server-side — agents never see raw keys or certificates, only scoped execution tokens.
Intent-based discovery
Agents search by intent (e.g., 'create WeChat payment order') and Jentic returns matching operations with pre-validated schemas, eliminating the need to parse WeChat Pay's complex Chinese-English documentation or implement signature algorithms.
Time to first call
Direct WeChat Pay integration: 3-5 days for merchant account setup, certificate generation, signature implementation, and webhook verification. Through Jentic: under 1 hour — search, load schema, execute with automatic signature handling and error translation.
Alternatives and complements available in the Jentic catalogue.
Alipay API
Alipay is China's other major mobile payment platform operated by Ant Group (Alibaba), offering similar in-app payment capabilities
Choose Alipay for Alibaba ecosystem integration and users outside WeChat. Use WeChat Pay for Tencent ecosystem (WeChat, Mini Programs) and China's 1B+ WeChat users. Many merchants integrate both to maximize coverage.
Stripe API
Stripe provides global payment processing with support for 135+ currencies and international markets
Use Stripe for international payments and global e-commerce. Use WeChat Pay for China-focused transactions and WeChat ecosystem integration. Combine both to serve domestic Chinese and international customers in the same application.
PayPal API
PayPal offers global payment processing with wallet-based checkout and cross-border transaction support
Choose PayPal for international markets with existing PayPal user base. Use WeChat Pay for Chinese market penetration where PayPal has limited adoption. WeChat Pay dominates mobile payments in China while PayPal leads in Western markets.
Specific to using WeChat Pay JSAPI Payment API through Jentic.
What authentication does WeChat Pay API use?
WeChat Pay API v3 uses WECHATPAY2-SHA256-RSA2048 signature authentication. You must sign each request with your merchant's RSA private key and include merchant ID, timestamp, nonce, and certificate serial number in the Authorization header. Jentic handles signature generation automatically — agents receive scoped execution tokens and never see raw keys or certificates. Get started at https://app.jentic.com/sign-up.
Can I create payment orders programmatically with WeChat Pay API?
Yes. Use the POST /v3/pay/transactions/jsapi endpoint to create prepay orders. You must provide the AppID, merchant ID, user OpenID, order description, amount, and webhook notification URL. The API returns a prepay_id valid for 2 hours, which your client-side code uses to invoke the WeChat payment SDK. Through Jentic, agents search for 'create WeChat payment order', load the schema, and execute with automatic signature handling.
What are the rate limits for WeChat Pay API?
The OpenAPI spec indicates 429 rate limit responses but does not specify exact limits. Rate limits vary by merchant tier and payment scenario. Contact WeChat Pay merchant support or consult the documentation at https://pay.weixin.qq.com for your specific limits. Production merchants typically have higher thresholds than test accounts.
How do I query order status with WeChat Pay API?
You can query orders two ways: (1) GET /v3/pay/transactions/id/{transaction_id} using WeChat's transaction ID (only for paid orders), or (2) GET /v3/pay/transactions/out-trade-no/{out_trade_no} using your merchant order number (works for all order states). Both require the mchid query parameter. The response includes trade_state (SUCCESS, NOTPAY, CLOSED, etc.) and full payment details.
Can I close unpaid orders through the WeChat Pay API?
Yes. Use POST /v3/pay/transactions/out-trade-no/{out_trade_no}/close to close unpaid orders. Provide your merchant order number in the path and merchant ID in the request body. The endpoint returns 204 (no content) on success. Use this when users cancel checkout or orders expire without payment. Paid orders cannot be closed — you must initiate a refund instead (via separate refund API).
What webhook notifications does WeChat Pay send?
WeChat Pay sends encrypted webhook notifications to the notify_url specified when creating an order. The main event is payment success (trade_state: SUCCESS), sent immediately after the user completes payment. Webhooks include the full order details, payment time, and promotion information. You must decrypt the notification body using your API v3 key and verify the signature. Jentic handles webhook verification automatically for agent-driven integrations.
How do AI agents use WeChat Pay API through Jentic?
Agents search Jentic for intents like 'create WeChat payment order' or 'query WeChat transaction status'. Jentic returns the relevant operations with their schemas and handles complex signature authentication server-side. Agents call operations via Jentic's execution layer without implementing RSA signatures or certificate management. Integration drops from 3-5 days to under an hour. Start at https://app.jentic.com/sign-up.
Does WeChat Pay API support currencies other than CNY?
The API schema shows CNY as the default currency in the Amount schema, with a currency field that accepts other currency codes. However, WeChat Pay primarily operates in Chinese Yuan (CNY) for domestic transactions. For cross-border payments (foreign currencies), you need to use separate WeChat Pay cross-border merchant accounts and API modules. Consult WeChat Pay documentation for multi-currency support specific to your merchant account type.