POST /v1/payments/pay
Initiates a payment request. Rebell handles the payment scenario according to the request parameters. Supported scenarios: Mini App direct pay (cashier payment), Mini App auth capture, and Mini App agreement pay.
In the cashier payment scenario the merchant calls this API to create the order; Rebell returns the cashier page URL (redirectActionForm.redirectUrl), and the Mini Program opens it with my.tradePay so the user can complete the payment.
Request Parameters
Payment product code assigned by Rebell:
51051000101000000011: Mini App direct pay51051000101000000012: Mini App auth capture51051000101000100031: Mini App agreement pay
Merchant-generated unique ID of the payment. Used for idempotency control: requests with the same
paymentRequestId that reached a final status (S or F) always return the same result.Max length: 64 charactersOrder amount, displayed in the user’s consumption records and payment result page. See Amount. Example:
{"currency": "EUR", "value": "10000"}Payment authorization code generated by the wallet, such as the
accessToken in the agreement pay scenario (from applyToken).Max length: 128 charactersMerchant URL that receives the payment result notification (notifyPayment).Max length: 1024 characters
Merchant-defined redirect URL. In the cashier payment scenario, after the user finishes paying on the cashier page, Rebell redirects back to the merchant using this URL.Max length: 1024 characters
Agreement pay only. Merchant URL to which Rebell sends a cashier URL (notifyCashierUrl) when the payment is still not completed after 48 hours. This happens only when the payment failed because the payment method was disabled or the user’s per-agreement limit was reached, and the user’s agreement is still valid.Max length: 1024 characters
Order details including merchant, buyer, and environment information. See Order. Order information is used only for the user’s payment result page, transaction history and regulatory reporting; the amount in
order is not used for fund operations.For Mini Program and in-app payment flows, order.env is required and must include:terminalType:APPosType:IOSorANDROID
Agreement pay: the amount the user authorizes the merchant to charge per agreement payment, in the smallest currency unit (euro cents). See Amount. Example:
{"currency":"EUR","value":"1000"}Subscription payments: the service expiry date, which merchants must set on every payment request. It is shown to the user on the contract page; Rebell does not validate it, so the merchant must keep it accurate. Format:
yyyy-MM-ddSubscription payments: the next payment date, which merchants must set on every payment request. It is shown to the user on the authorization details page; Rebell does not verify it, so the merchant must keep it accurate. Format:
yyyy-MM-ddJSON-formatted extension data.Max length: 2048 characters
Example:
"{\"channelSource\":\"MERCHANT_MP\",\"miniAppId\":\"12312312312\"}"Response Parameters
Redirect instruction returned when the payment requires an H5 cashier step (e.g. direct pay and auth-capture flows with
MOBILE_H5 channel source).Result Handling
Result Codes
Sample: Cashier Payment
A user buys a 100 EUR item in a Mini Program:1
Create the order
The Mini Program creates an order on the merchant server.
2
Call pay
The merchant server calls
/v1/payments/pay with a paymentNotifyUrl.3
Receive payment details
Rebell returns
paymentId and redirectActionForm (resultStatus = A).4
Open the cashier
The merchant server passes the payment details to the Mini Program, which calls
my.tradePay with the redirectUrl as paymentUrl.5
Get the result
When the payment reaches a final status, Rebell notifies the merchant server at
paymentNotifyUrl, and the Rebell app returns the result to the Mini Program.Request
Response
resultStatus = A means the payment was accepted; it becomes successful after the user completes payment on the cashier page.