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://jentic.com/install.sh?src=apis&api=%2Fapis%2Fpay.weixin.qq.com%2Fwechat-pay-jsapi" | shStep 2: Agent machine
# On the machine where your agent runs (keep this separate from the instance):
curl -fsSL "https://jentic.com/install.sh?src=apis&api=%2Fapis%2Fpay.weixin.qq.com%2Fwechat-pay-jsapi" | 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
Close unpaid orders to cancel pending transactions
Receive webhook notifications for payment success events
GET STARTED
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
What agents get from Jentic-routed access to this vendor.
Setup
Wiring WeChat Pay by hand means computing its WECHATPAY2-SHA256-RSA2048 signature from your merchant id, API v3 key, certificate serial and RSA private key, and choosing the right mch host yourself. Through Jentic you install once, import the WeChat Pay JSAPI API from the API Directory, store the credentials once, and your agent calls it.
Permission scoping
WeChat Pay puts the transaction reference in the URL path (/v3/pay/transactions/out-trade-no/{out_trade_no}), so a rule can pin your agent to one transaction: it can query that order and nothing else. You choose the operations it may call, so creating or closing orders is not included unless you add them.
Credential isolation
Your WeChat Pay merchant id, API key, certificate and private key are stored once, encrypted, by your own Jentic One instance and used to sign requests at execution time. They never enter the agent's prompt, logs, or context.
Intent-based discovery
Agents search Jentic by intent such as 'create a WeChat JSAPI payment order' or 'query a transaction by trade number', and Jentic returns the matching WeChat Pay operation with its input schema so the agent calls the right endpoint without browsing the reference docs.
Alternatives and complements available in the Jentic catalogue.
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.
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 with Jentic One, the self-hosted execution layer.
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. Get started with Jentic One, the self-hosted execution layer.
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.
Can I limit what my agent is allowed to do with the WeChat Pay JSAPI Payment API?
Yes. Because you run Jentic One yourself, your own rules decide which WeChat Pay operations and which stored merchant credentials the agent may use. Since the transaction reference sits in the URL path (/v3/pay/transactions/out-trade-no/{out_trade_no}), you can pin the agent to a single order so it only queries that transaction and touches nothing else. Creating orders with POST /v3/pay/transactions/jsapi or closing them via the /close operation stays off limits until you explicitly grant those operations.
For Agents
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.
This API is usable in Jentic One now. Its AI-readiness score against Jentic's framework shows where it stands today and where improvements would make it even easier for agents to use.
Score it yourself
Every API in the directory is allowlisted, so you can re-score it with no key required.
npx @jentic/api-scorecard-cli score <openapi-url>