Skip to main content

Online Payment

{% raw %}

POST/v3/payment/online

What is this?

Online Payment lets businesses accept online payments through web and mobile applications. Customers can enter card details or select an e-wallet to complete payment from their smartphone or website.

Online Payment is an online payment method. Subscription is based on the online subscription rate.


How to Use

Step 1: Create a Checkout Session

Send the order details to this endpoint. You will receive a checkoutId and a checkout url.

Step 2: Redirect the Customer

Redirect the customer to the url returned in the response. They will complete payment on the hosted checkout page.

Step 3: Handle the Redirect

After payment, the customer is redirected to your redirectUrl. The redirect includes status and orderId as query parameters.

Step 4: Receive the Server Notification

Set a notifyUrl to receive a server-to-server callback when payment succeeds. Query the transaction using Query Transaction for full details.


Hosted Payment Checkout

  • This creates a unified payment checkout page for both web and mobile.
  • The data object must be sorted alphabetically, including nested objects.

Request Parameters

storeIdStringrequired

Revenue Monster Store ID

redirectUrlStringrequired

URL to redirect the customer back to after payment.

notifyUrlStringrequired

Server URL to receive payment status callbacks.

layoutVersionStringrequired

Always use "v4".

typeStringrequired

Checkout session type.

method[]String

Payment methods to enable.

order.idStringrequired

Order ID

order.titleStringrequired

Order title

order.currencyTypeStringrequired

Order currency type (currently supported MYR only)

order.amountUint64required

Order amount

order.detailString

Order detail

order.additionalDataString

Order additional data

customer.userIdString

Required when tokenization is enabled.

customer.emailString

Customer email address.

customer.countryCodeString

Customer country code.

customer.phoneNumberString

Customer phone number.

Response Parameters

item.checkoutIdString

Checkout session ID

item.urlString

Checkout session URL to redirect the customer to

codeString

"SUCCESS" if the request succeeded, otherwise an error code.

error.codeString

Error code if the request failed.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).


Individual Payment Checkout

After creating a checkout session, use the checkoutId to build a custom payment experience:

Checkout URL
Text
https://sb-pg.revenuemonster.my/v4/checkout?checkoutId=1548316308361173347

Redirect Response

The redirect URL brings the customer back to your page after payment. It can be any URL type (deep link, browser URL, server URL).

Method: GET

ParameterTypeRequiredDescription
statusStringYesPayment status
orderIdStringYesPayment order ID
reasonStringNoPayment failure reason

Notify Response

The notify URL informs your server of the transaction status after a successful payment. Notify is only called on success — failure or refund does not trigger a notify. Query the transaction using Query Transaction for full details.

Method: POST

eventTypeStringrequired

Notify event type. Always "PAYMENT_WEB_ONLINE".

data.storeJSON

Store details.

data.referenceIdString

Reference ID.

data.transactionIdStringrequired

Transaction ID.

data.terminalIdString

Terminal ID.

data.currencyTypeStringrequired

Currency type (currently supported MYR only).

data.balanceAmountUint64required

Remaining balance for initiating refund.

data.finalAmountUint64required

Amount after deductions (voucher, membership).

data.platformStringrequired

Transaction platform.

data.typeStringrequired

Transaction type.

data.methodStringrequired

Transaction payment method.

data.regionStringrequired

Transaction payment region.

data.statusStringrequired

Transaction payment status.

data.transactionAtString

Transaction date time (present only when status is SUCCESS).

data.createdAtStringrequired

Transaction created date time.

data.updatedAtStringrequired

Transaction last updated date time.

data.order.idStringrequired

Order ID.

data.order.titleStringrequired

Order title.

data.order.currencyTypeStringrequired

Order currency type.

data.order.amountUint64required

Order amount.

data.order.detailString

Order detail.

data.order.additionalDataString

Order additional data.


Query Payment Checkout

Payment checkout is not the same as payment transaction info. Checkout only returns status, amount, and redirectUrl. For full transaction details, query the transaction using Query By Transaction ID with the transactionId from the checkout response.

Request Parameters

ParameterTypeRequiredDescription
checkoutIdQueryParamYesPayment checkout ID

Response Parameters

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).

item.idString

Payment checkout ID.

item.typeString

Payment checkout type.

item.transactionIdString

Payment transaction ID. Use this to query the transaction via Query Transaction.

item.order.idString

Order ID.

item.order.titleString

Order title.

item.order.currencyTypeString

Order currency type.

item.order.amountUint64

Order amount.

item.order.detailString

Order detail.

item.order.additionalDataString

Order additional data.

item.platformString

Payment checkout platform.

item.methodString

Payment checkout available methods.

item.redirectUrlString

Payment redirect URL.

item.notifyUrlString

Payment notify URL.

item.startAtString

Payment checkout start date time.

item.statusString

Payment checkout status.

item.createdAtString

Payment checkout created date time.

item.updatedAtString

Payment checkout last updated date time.


Direct Payment Checkout

With Direct Payment Checkout, you create a payment page with your own UI design. There are two modes: QR code and URL. URL is preferred in most cases.

Direct Payment Checkout requires polling the Query Payment Checkout API to keep the payment status updated. Without polling, the payment status will not update until our system performs a pre-timeout check. Suggested polling interval is 3 to 5 seconds.

Mode: URL

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "URL".

methodStringrequired

Payment method (e.g., ALIPAYPLUS_MY).

Example Request
JSON
1{
2 "checkoutId": "1582438693268947023",
3 "type": "URL",
4 "method": "ALIPAYPLUS_MY"
5}

Response Parameters

item.typeString

Checkout session type.

item.urlString

Checkout session URL.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).


Mode: QR Code

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "QRCODE".

methodStringrequired

Payment method (e.g., MAYBANK_MY).

Example Request
JSON
1{
2 "checkoutId": "1582438693268947023",
3 "type": "QRCODE",
4 "method": "MAYBANK_MY"
5}

Response Parameters

item.typeString

Checkout session type.

item.qrcode.base64ImageString

Base64-encoded QR code image.

item.qrcode.dataString

QR code data string.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).


Mode: DuitNow QR

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "DUITNOW_QRCODE".

methodStringrequired

Leave empty for DuitNow QR.

Example Request
JSON
1{
2 "checkoutId": "1687168234460362061",
3 "method": "",
4 "type": "DUITNOW_QRCODE"
5}

Response Parameters

item.typeString

Checkout session type.

item.qrcode.base64ImageString

Base64-encoded QR code image.

item.qrcode.dataString

QR code data string.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).


Mode: Alipay Mini Program

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "MINI_PROGRAM".

methodStringrequired

Payment method. Set to "ALIPAY_CN".

Example Request
JSON
1{
2 "checkoutId": "1582438693268947023",
3 "type": "MINI_PROGRAM",
4 "method": "ALIPAY_CN"
5}

Response Parameters

item.typeString

Checkout session type.

item.dataString

Base64-encoded data to pass to the mini program API.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).

Alipay Mini Program Frontend

Use base64 decode on the data parameter and pass the result to the mini program API.

Alipay Mini Program
JavaScript
1my.tradePay({
2 orderStr: base64Decode(dataParameter),
3 success: (res) => { console.log("success", res); },
4 fail: (res) => { console.log("error", res); }
5});

Mode: WeChat Pay Mini Program

Before starting integration, contact support@revenuemonster.my to bind your "Mini Program App ID / 小程序 App ID" to your account.

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "MINI_PROGRAM".

methodStringrequired

Payment method. Set to "WECHATPAY_CN".

userIdStringrequired

WeChat user Open ID.

Example Request
JSON
1{
2 "checkoutId": "1582438693268947023",
3 "type": "MINI_PROGRAM",
4 "method": "WECHATPAY_CN",
5 "userId": "oFGqK6w1kZyjDTtNAcOXBDHAa8CY"
6}

Response Parameters

item.typeString

Checkout session type.

item.dataString

Base64-encoded data to pass to the mini program API.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).

WeChat Pay Mini Program Frontend

Use base64 decode on the data parameter and pass the result to the mini program API.

WeChat Mini Program
JavaScript
1var base64decoded = base64Decode(dataParameter);
2var payload = JSON.parse(base64decoded);
3wx.requestPayment({
4 ...payload,
5 success: function (res) { console.log("success", res); },
6 fail: function (res) { console.log("fail", res); },
7 complete: function (res) { console.log("complete", res); }
8});

Mode: FPX

Method: GET URL: https://open.revenuemonster.my/v3/payment/fpx-bank

Sandbox URL: https://sb-open.revenuemonster.my/v3/payment/fpx-bank

FPX Bank Codes:

CodeName
ABB0233:B2CAffin Bank
ABMB0212:B2CAlliance Bank (Personal)
AGRO01:B2CAGRONet
AMBB0209:B2CAmBank
BCBB0235:B2CCIMB Bank
BIMB0340:B2CBank Islam
BKRM0602:B2CBank Rakyat
BMMB0341:B2CBank Muamalat
BSN0601:B2CBank Simpanan Nasional
HLB0224:B2CHong Leong Bank
HSBC0223:B2CHSBC
KFH0346:B2CKuwait Finance House
MB2U0227:B2CMaybank2U
MBB0228:B2CMaybank2E
OCBC0229:B2COCBC
PBB0233:B2CPublic Bank
RHB0218:B2CRHB Bank
SCB0216:B2CStandard Chartered Bank
UOB0226:B2CUnited Oversea Bank

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "URL".

methodStringrequired

Payment method. Set to "FPX_MY".

fpx.bankCodeStringrequired

FPX bank code from the table above.

Example Request
JSON
1{
2 "checkoutId": "1687166508263303064",
3 "method": "FPX_MY",
4 "type": "URL",
5 "fpx": {
6 "bankCode": "TEST0021"
7 }
8}

Response Parameters

item.typeString

Checkout session type.

item.urlString

FPX payment URL to redirect the customer to.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).


Mode: GoBiz / Paydee / Mastercard

Request Parameters

checkoutIdStringrequired

Checkout ID from the Hosted Payment Checkout response.

typeStringrequired

Checkout type. Set to "URL".

methodStringrequired

Payment method (e.g., MASTERCARD_MY, GOBIZ_MY).

gobiz.typeString

GoBiz payment type.

Example Request
JSON
1{
2 "checkoutId": "1687168234460362061",
3 "method": "MASTERCARD_MY",
4 "type": "URL"
5}

Response Parameters

item.typeString

Checkout session type.

item.urlString

Payment URL.

codeString

"SUCCESS" if the request succeeded.

error.codeString

Error code.

error.messageString

Error message.

error.debugString

Debug message (sandbox only).

{% endraw %}