OnlinePay API
  1. Notify
OnlinePay API
  • Introduction
    • Introduction
    • How to Start
    • Country Code
    • Country Info
    • Currency Code
    • Error Code
    • Transfer Order Info Type
    • Transfer Order File Type
    • Per Bank
    • Spei Bank
    • Vietnam Bank
  • Payin
    • OnRamps API
      GET
    • Alipay API
      POST
    • Apple Pay API
      POST
    • Cash App API
      POST
    • Credit Card API
      POST
    • Crypto Pay API
      POST
    • GCash API
      POST
    • Google Pay API
      POST
    • PerTransfer API
      POST
    • PIX API
      POST
    • SEPA API
      POST
    • SPEI API
      POST
    • Union Pay API
      POST
    • WeChat API
      POST
    • CheckOut
      POST
    • CheckOut Payment
      POST
    • Momo API
      POST
    • Vietnam Bank API
      POST
  • Payout
    • Bank Account
    • Card
    • Per Transfer
    • Pix
    • CheckOut
    • Spei Payout
  • Notify
    • Pay Notify WebHook API
    • Refund Notify WebHook API
    • Chargeback Notify WebHook API
    • Card Notify WebHook API
  • Refund
    • Refund API
  • Review
    • Upload SEPA File API
  • Query
    • Query API
    • QueryBalance API
    • QueryOrderList API
    • QueryOrderAmount API
  • Card
    • CreateCardholder API
    • CreateCard API
    • QueryCardInfo API
    • ActiveCard API
    • TopUpCard API
    • CardWithdraw API
    • QueryCardTransaction API
    • QueryCardBalance API
    • FreezeCard API
    • UnFreezeCard API
    • CancelCard API
    • AddVpaScene API
    • UploadFile API
  1. Notify

Refund Notify WebHook API

NOTE
If the notifyurl parameter is passed, onlinepay will notify the address of the payment result

Overview#

This document describes the interface specification for the payment system to send refund notifications to merchants, including parameter descriptions, signature verification methods, and other detailed information.

Interface Information#

Request Method: POST
Content-Type: application/json; charset=UTF-8
Notification URL: Merchant configured refund notification URL
Success Indicator: Merchant returns string "SUCCESS"

Request Parameters#

Basic Parameters#

ParameterTypeRequiredDescription
stateStringYesRefund status: 0-Success, 1-Failed
tradeNoStringYesPlatform transaction number
merOrderNoStringYesMerchant order number
refundNoStringYesRefund order number
messageStringNoRefund result description
refundAmountStringYesRefund amount
refundCurrencyStringYesRefund currency
signStringYesSignature value

Parameter Example#

{
  "state": "0",
  "tradeNo": "T202309011234567890",
  "merOrderNo": "MER20230901001",
  "refundNo": "R202309011234567890",
  "message": "Refund successful",
  "refundAmount": "100.00",
  "refundCurrency": "USD",
  "sign": "abc123def456..."
}

Signature Verification#

The system supports two signature methods: MD5 signature and RSA signature.

MD5 Signature Verification#

Signature Generation Steps#

1.
Parameter Sorting: Sort all parameters (except sign) in alphabetical order by parameter name
2.
Value Concatenation: Concatenate parameter values in sorted order (ignore empty values)
3.
Add Key: Append the merchant's MD5 key to the end of the concatenated string
4.
Generate Signature: Perform MD5 encryption on the final string to get the signature value

Signature Example#

Assuming the following parameters:
state = "0"
tradeNo = "T202309011234567890"
merOrderNo = "MER20230901001"
refundNo = "R202309011234567890"
message = "Refund successful"
refundAmount = "100.00"
refundCurrency = "USD"
md5Key = "your_md5_key"
Parameter order after sorting:
1.
merOrderNo
2.
message
3.
refundAmount
4.
refundCurrency
5.
refundNo
6.
state
7.
tradeNo
Concatenated string:
MER20230901001Refund successful100.00USDR2023090112345678900T202309011234567890your_md5_key
Perform MD5 encryption on this string to get the signature value.

RSA Signature Verification#

Signature Generation Steps#

1.
Parameter Sorting: Sort all parameters (except sign) in alphabetical order by parameter name
2.
Formatting: Concatenate parameters in key1=value1&key2=value2 format
3.
RSA Signing: Sign the concatenated string using SHA256WithRSA algorithm and private key
4.
Encoding: Base64 encode the signature result

Signature Example#

Using the same parameters, the RSA signature string format would be:
merOrderNo=MER20230901001&message=Refund successful&refundAmount=100.00&refundCurrency=USD&refundNo=R202309011234567890&state=0&tradeNo=T202309011234567890

Response Requirements#

After receiving the refund notification, the merchant needs to return the string "SUCCESS" to indicate successful receipt.

Success Response Example#

SUCCESS

Security Recommendations#

1.
Verify Signature: Always verify the signature of each notification to ensure the authenticity of the notification source
2.
Idempotent Processing: Due to the retry mechanism, merchants should implement idempotent processing to avoid duplicate processing of the same refund notification
3.
HTTPS: It is recommended to use HTTPS protocol to receive notifications to ensure data transmission security
4.
IP Whitelist: Configure IP whitelist to allow only specific IPs to send notifications
Modified at 2025-09-04 07:02:11
Previous
Pay Notify WebHook API
Next
Chargeback Notify WebHook API
Built with