OnlinePay API
V2
V1
V2
V1
  1. Refund
  • 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
    • V2 Signature Specification
  • Payin
    • Credit Card API
      POST
    • Alipay API
      POST
    • GCash API
      POST
    • WeChat API
      POST
    • PIX API
      POST
    • Crypto API
      POST
    • Union Pay API
      POST
    • SPEI API
      POST
    • SEPA API
      POST
    • Per Transfer API
      POST
    • Cash App API
      POST
    • Google Pay API
      POST
    • Apple Pay API
      POST
    • MONO API
      POST
    • Vietnam Bank API
      POST
    • CheckOut API
      POST
    • CheckOut Payment API
      POST
    • OnRamps API
      GET
  • Payout
    • PER Transfer Payout API
    • Checkout Payout API
    • Card Payout API
    • Bank Account Payout API
    • PIX Payout API
    • PER Transfer Payout API
    • SPEI Payout API
    • CashApp Payout API
    • Checkout Payout API
    • Query Payout Order API
    • Upload SEPA File API
  • Refund
    • Refund API
      POST
  • Card
    • Create Cardholder API
    • Create Card API
    • Active Card API
    • Freeze Card API
    • UnFreeze Card API
    • Cancel Card API
    • TopUp Card API
    • Card Withdraw API
    • Query Card Balance API
    • Query Card Info API
    • Query Card Transaction API
    • Add VPA Scene API
    • UploadFile API
  • Query
    • Query Payout Order API
    • Query Order API
    • QueryOrderList API
    • QueryBalance API
    • QueryOrderAmount API
  • Notify
    • Pay Notify WebHook API
    • Card Notify WebHook API
    • Refund Notify WebHook API
    • Chargeback Notify WebHook API
  • Schemas
    • UserArray
    • CheckStandV2Request
    • ApiResponse
    • PayoutCheckStandV2Request
    • QueryPayOutV2Request
    • V2EncryptedEnvelope
    • V2EncryptedNotification
    • PaymentNotificationPayload
    • ProductParams
    • Category
    • PayoutCheckStandV2Response
    • PaymentNotification
    • QueryPayOutV2Response
    • PayoutQueryResult
    • Pet
    • OrderQueryV2Data
    • PayoutCheckStandV2Data
    • CheckStandV2Response
    • RefundNotificationPayload
    • CheckStandV2Data
    • ChargebackNotificationPayload
    • Tag
    • OrderQueryV2Request
    • OrderQueryV2Response
    • Order
    • User
  1. Refund

Refund API

Testing Env
https://testpay.onlinepay.ai
Testing Env
https://testpay.onlinepay.ai
POST
/v2/refund/apply
V2 Refund Apply endpoint. Uses V2 signing rules where signType is determined by the merchant's encryption config in the database.

Differences from V1#

signType is NOT a request parameter — resolved from merchant DB config (encryption field)
version must be V2.0.0
All parameters participate in signing (sorted alphabetically)
Response includes sign and signType fields

Request

Body Params application/json

Example
{
    "merNo": 111111,
    "merOrderNo": "222222",
    "amount": "10.00",
    "tradeNo": "ONL02507071850393774",
    "sign": "4B18D0A324F0D006A84A495940857395",
    "notifyUrl": "https://www.example.com/refund/notify",
    "remark": "V2 refund request"
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location 'https://testpay.onlinepay.ai/v2/refund/apply' \
--header 'Content-Type: application/json' \
--data '{
    "merNo": 111111,
    "merOrderNo": "222222",
    "amount": "10.00",
    "tradeNo": "ONL02507071850393774",
    "sign": "4B18D0A324F0D006A84A495940857395",
    "notifyUrl": "https://www.example.com/refund/notify",
    "remark": "V2 refund request"
}'

Responses

🟢200
application/json
Bodyapplication/json

Example
{
    "code": "00000",
    "message": "SUCCESS",
    "data": {
        "refundNo": "RF202605110001",
        "tradeNo": "ONL02507071850393774",
        "merNo": "111111",
        "merOrderNo": "222222",
        "refundAmount": "10.00",
        "refundCurrency": "USD"
    },
    "sign": "A1B2C3D4E5F6..."
}
Modified at 2026-05-27 09:25:35
Previous
Upload SEPA File API
Next
Create Cardholder API
Built with