A Mini Program payment involves four stages: order placement, checkout, payment confirmation, and result handling. This topic describes the end-to-end flow and the APIs your SuperApp must provide to support it.
From the user's perspective, the payment flow proceeds as follows:
The user selects a product, places an order, and clicks Confirm payment to start the payment process.
The Mini Program navigates to the checkout page, where the user initiates payment and a payment confirmation screen appears.
The user verifies the recipient and amount, then completes the payment. The payment result is displayed.
The user is returned to the Mini Program, where the order status is updated based on the payment result.
The following diagram shows the API call flow:

SuperApp API requirements
To support the payment flow, the SuperApp must expose the following APIs to the Mini Program:
An API to create orders
A
tradePayAPI injected by the SuperApp, which the Mini Program uses to invoke the checkout and receive payment result callbacksAn API to query payment results
An API to issue refunds (as needed)
An API to cancel payments
An API to query refund results (as needed)
An API to close transactions
Enable signature verification on all APIs to prevent data tampering and protect your application and its interactions.
Use encrypted channels for all API data transmission.
Configure an IP address allowlist on the merchant server to guard against private key leaks and protect user funds.