OnlinePay API
  1. API Reference
OnlinePay API
  • Introduction
  • How to start
  • Country Code
  • Currency Code
  • Error Code
  • API Reference
    • Credit Card
      POST
    • Alipay
      POST
    • Union Pay
      POST
    • WeChat
      POST
    • Cryptocurrency Payment
      POST
    • OnlinePay CheckOut
      POST
    • notifyUrl
      POST
    • Refund
      POST
    • Query
      POST
    • QueryOrderList
      POST
  1. API Reference

Refund

POST
https://pay.online.ai/refund/apply
There are refunds for Credit Cards and Alipay,
UnionPay no refund.

Request

Body Params application/json
merNo
integer 
required
Unique identifier assigned to the merchant by the onlinepay payment platform when registering with onlinepay
merOrderNo
string 
required
Merchant Order Number
amount
string 
required
keep two decimals
notifyUrl
string 
optional
Asynchronous notification address, Used to receive onlinepay to push refund results to merchants
<= 512 characters
sign
string 
required
signature, MD5(merNo+merOrderNo+amount+tradeNo+PrivateKey)
<= 512 characters
operationType
string 
required
value:refund
version
string 
required
V3.0.0
tradeNo
string 
required
transaction serial number, The order number generated by the platform when the merchant pays
remark
string 
optional
remark
<= 1000 characters
Example
{
  "merNo":"111111",
  "merOrderNo":"222222",
  "amount":"10",
  "version":"V3.0.0",
  "tradeNo":"333333",
  "sign":"9D6FDF4880B00B002B1F2AB61AE9A721",
  "notifyUrl":"https://www.example.com",
  "remark":"remark",
  "operationType":"refund"
}

Request 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 --request POST 'https://pay.online.ai/refund/apply' \
--header 'Content-Type: application/json' \
--data-raw '{
  "merNo":"111111",
  "merOrderNo":"222222",
  "amount":"10",
  "version":"V3.0.0",
  "tradeNo":"333333",
  "sign":"9D6FDF4880B00B002B1F2AB61AE9A721",
  "notifyUrl":"https://www.example.com",
  "remark":"remark",
  "operationType":"refund"
}'

Responses

🟢200Success
application/json
Body
code
string 
required
If the value is 0000, it will return success, other please refer to Error Code
message
string 
required
Interface returns description
data
object 
optional
Request response data
refundNo
string 
required
Unique ID generated for successful refund application
tradeNo
string 
required
Order number, the unique identifier of OnlinePay
merNo
string 
required
Merchant number
merOrderNo
string 
required
Merchant order number
refundAmount
string 
required
Refund amount
refundCurrency
string 
required
Refund Currency
Example
{
    "code": "00000",
    "message": "SUCCESS",
    "data": {
        "refundNo": "444444",
        "tradeNo": "333333",
        "merNo": "111111",
        "merOrderNo": "222222",
        "refundAmount": "10",
        "refundCurrency": "CNY"
    }
}
Modified at 2023-04-28 03:37:35
Previous
notifyUrl
Next
Query
Built with