Payment Flow
Payment APIs return request-level results in result_code and business results in biz_response.result_code. HTTP 200 does not mean the payment succeeded. All payment requests are initiated from an activated customer terminal identity.
Terminal submits signed pay, pre-create, or pushed order request with `terminal_sn`.
MUWE validates terminal credentials, merchant scope, idempotency key, and provider route.
Provider handles payment authorization or returns the consumer payment payload.
Consumer completes payment in the configured channel or at the bound POS terminal.
MUWE returns success, failure, or in-progress business status.
If the result is uncertain, query before delivery, cancel, refund, or retry decisions.
Merchant-Initiated Payment
- Cashier, POS, or merchant MIS starts the payment request from an activated customer terminal.
- Client submits
POST /upay/v2/paywith a uniqueclient_sn. - If
biz_response.result_codeisPAY_SUCCESS, deliver goods. - If it is
PAY_IN_PROGRESS, or the network fails after the request may have reached MUWE, query byclient_sn. - If the order cannot reach a final state within the merchant timeout, call
POST /upay/v2/cancel. - Never reuse the same
client_snfor a new payment attempt after a failed or uncertain pay request.
MIS-to-POS Order Push
- Merchant MIS or cashier system creates an order for a bound POS terminal.
- The POS receives the order and drives the consumer-facing payment flow.
- MUWE processes the payment through the configured provider.
- The client receives notification or polls
POST /upay/v2/queryuntil a final order status is reached.
QR Pre-create
- Client calls
POST /upay/v2/precreate. - MUWE returns
qr_codeor a provider payment payload. - Merchant renders the QR code or payment URL.
- Customer completes payment in the provider app.
- Client waits for notification or polls
POST /upay/v2/query.
Refund
Refunds are idempotent by refund_request_no.
- Query the order and confirm it is refundable.
- Call
POST /upay/v2/refundwith eithersnorclient_snand a uniquerefund_request_no. - If the refund result is uncertain, query using the original order identity and
refund_request_no. - Do not submit a replacement refund with a new
refund_request_nountil the first one is final.
Cancel Recovery
cancel is for unpaid or uncertain orders. Use it when the client cannot prove that a payment failed but must prevent later success.
If cancel returns CANCEL_SUCCESS, the order is closed. If it returns CANCEL_ERROR, CANCEL_ABORT_ERROR, or a network timeout, keep querying and escalate if the order does not reach a final state.
Revoke
revoke is not the same operation as cancel. Use POST /upay/v2/revoke only for same-day reversal of a paid order when the provider route explicitly supports it.
Final Statuses
| Status | Meaning |
|---|---|
PAID | Payment completed. |
PAY_CANCELED | Payment failed and was canceled. |
REFUNDED | Fully refunded. |
PARTIAL_REFUNDED | Partially refunded. |
CANCELED | Order canceled before payment completion. |
Intermediate states such as CREATED, IN_PROG, ERROR_RECOVERY, and PRE_SUCCESS are not final. Query until a final state is returned or support intervention is required.