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

Credit Card

POST
https://pay.online.ai/payment
Direct mode: PCI compliance is required in this mode. The merchant system can capture the cardholder's card number information and transmit them to OlinePay, then the request is quickly verified and processed, and the payment result is returned directly.
Checkout: When you initiate a payment request, you will receive a checkout URL back from OnlinePay and be redirected to that checkout URL to submit your card number and other information, finally jump to the returnUrl to synchronize your payment results.
3DS: 3DS is designed to reduce the risk of fraud and unauthorized transactions by verifying the identity of the cardholder. When making a 3DS-based payment, it redirects to a secure authentication page that allows the user to perform 3DS authentication.
Note: OnlinePay will obtain the HTTP Header referrer to verify the website source. The website source must be configured by OnlinePay to be verified. If you do not access the interface through a browser, you need to actively add a referer.

Request

Body Params application/json

Example
{
    "merNo": 111111,
    "merOrderNo": "222222",
    "currencyCode": "USD",
    "sourceAmount": "100.05",
    "returnUrl": "https://example.com",
    "notifyUrl": "https://example.com/notify",
    "sign": "9D6FDF4880B00B002B1F2AB61AE9A721",
    "cardNo":"123456",
    "cardExpireMonth":"01",
    "cardExpireYear":"2022",
    "cardSecurityCode": "335",
    "billFirstName": "Tati",
    "billingLastName": "Moore",
    "billingAddress1": "United States",
    "billingCity": "Westbury",
    "billingState": "New York",
    "billingCountry": "US",
    "billingZipCode": "11590",
    "billingPhone": "3854234144",
    "billingEmail": "example@gmail.com",
    "shippingFirstName": "Tati",
    "shippingLastName": "Moore",
    "shippingAddress1": "United States",
    "shippingCity": "Westbury",
    "shippingState": "New York",
    "shippingCountry": "US",
    "shippingZipCode": "11590",
    "shippingPhone": "3854234144",
    "shippingEmail": "example@gmail.com",
    "userAgent": "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)",
    "ipAddress": "116.235.134.86",
    "version": "V3.0.0",
    "productInfoList": [
        {
            "sku": "1",
            "productName": "mac pro",
            "price": "12000",
            "quantity": "1"
        },
        {
            "sku": "2",
            "productName": "iphone13",
            "price": "8000",
            "quantity": "1"
        }
    ]
}

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 --request POST 'https://pay.online.ai/payment' \
--header 'Content-Type: application/json' \
--data-raw '{
    "merNo": 111111,
    "merOrderNo": "222222",
    "currencyCode": "USD",
    "sourceAmount": "100.05",
    "returnUrl": "https://example.com",
    "notifyUrl": "https://example.com/notify",
    "sign": "9D6FDF4880B00B002B1F2AB61AE9A721",
    "cardNo":"123456",
    "cardExpireMonth":"01",
    "cardExpireYear":"2022",
    "cardSecurityCode": "335",
    "billFirstName": "Tati",
    "billingLastName": "Moore",
    "billingAddress1": "United States",
    "billingCity": "Westbury",
    "billingState": "New York",
    "billingCountry": "US",
    "billingZipCode": "11590",
    "billingPhone": "3854234144",
    "billingEmail": "example@gmail.com",
    "shippingFirstName": "Tati",
    "shippingLastName": "Moore",
    "shippingAddress1": "United States",
    "shippingCity": "Westbury",
    "shippingState": "New York",
    "shippingCountry": "US",
    "shippingZipCode": "11590",
    "shippingPhone": "3854234144",
    "shippingEmail": "example@gmail.com",
    "userAgent": "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)",
    "ipAddress": "116.235.134.86",
    "version": "V3.0.0",
    "productInfoList": [
        {
            "sku": "1",
            "productName": "mac pro",
            "price": "12000",
            "quantity": "1"
        },
        {
            "sku": "2",
            "productName": "iphone13",
            "price": "8000",
            "quantity": "1"
        }
    ]
}'

Responses

🟢200Success
application/json
Body

Example
{
    "code": "00000",
    "message": "SUCCESS",
    "data": {
        "payCode": 0,
        "tradeNo": "333333",
        "merOrderNo": "222222",
        "payUrl": "http://abc.com/notify"
    }
}
Modified at 2023-05-05 10:25:01
Previous
Error Code
Next
Alipay
Built with