OnlinePay API
  1. Payin
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
  • Payin
    • OnRamps API
      GET
    • Alipay API
      POST
    • Credit Card API
      POST
    • Crypto Pay API
      POST
    • GCash 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
  • Payout
    • Bank Account
      POST
    • Card
      POST
    • Per Transfer
      POST
    • Pix
      POST
    • CheckOut
      POST
    • Spei Payout
      POST
  • Notify
    • Notify WebHook API
    • Card Notify WebHook API
  • Refund
    • Refund API
  • Review
    • Upload SEPA File API
  • Query
    • Query API
    • QueryBalance API
    • QueryOrderList 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. Payin

Credit Card API

Testing Env
https://testpay.onlinepay.ai
Testing Env
https://testpay.onlinepay.ai
POST
/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.

Request

Body Params application/json

Example
{
    "merNo": 111111,
    "merOrderNo": "222222",
    "currencyCode": "USD",
    "sourceAmount": "100.05",
    "returnUrl": "https://example.com",
    "notifyUrl": "https://example.com/notify",
    "protestNotifyUrl": "https://example.com/protestNotify",
    "sign": "906FDF4880B00B00281F2AB61AE9A721",
    "cardNo": "4242424242424242",
    "cardExpireMonth": "01",
    "cardExpireYear": "2022",
    "cardSecurityCode": "335",
    "billingFirstName": "Tati",
    "billingLastName": "Moore",
    "billingAddress1": "123 Main St",
    "billingAddress2": "123 Main St",
    "billingCity": "Anytown",
    "billingState": "CA",
    "billingCountry": "US",
    "billingZipCode": "12345",
    "billingPhone": "1234567890",
    "billingEmail": "tati@example.com",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
    "ipAddress": "192.168.1.1",
    "productInfoList": [
        {
            "sku": "PROD001",
            "productName": "Example Product",
            "price": "100.05",
            "quantity": "1"
        }
    ],
    "version": "V3.0.0",
    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "deviceId": "12345-67890-ABCDE-FGHIJ",
    "language": "en-US",
    "timezone": "America/New_York",
    "screenColorDepth": 24,
    "screenHeight": 1080,
    "screenWidth": 1920,
    "javaEnabled": false,
    "javascriptEnabled": true,
    "latitude": "40.7128",
    "longitude": "-74.0060",
    "deviceModel": "iPhone14,5",
    "osVersion": "iOS 16.1"
}

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://testpay.onlinepay.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",
    "protestNotifyUrl": "https://example.com/protestNotify",
    "sign": "906FDF4880B00B00281F2AB61AE9A721",
    "cardNo": "4242424242424242",
    "cardExpireMonth": "01",
    "cardExpireYear": "2022",
    "cardSecurityCode": "335",
    "billingFirstName": "Tati",
    "billingLastName": "Moore",
    "billingAddress1": "123 Main St",
    "billingAddress2": "123 Main St",
    "billingCity": "Anytown",
    "billingState": "CA",
    "billingCountry": "US",
    "billingZipCode": "12345",
    "billingPhone": "1234567890",
    "billingEmail": "tati@example.com",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
    "ipAddress": "192.168.1.1",
    "productInfoList": [
        {
            "sku": "PROD001",
            "productName": "Example Product",
            "price": "100.05",
            "quantity": "1"
        }
    ],
    "version": "V3.0.0",
    "acceptHeader": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
    "deviceId": "12345-67890-ABCDE-FGHIJ",
    "language": "en-US",
    "timezone": "America/New_York",
    "screenColorDepth": 24,
    "screenHeight": 1080,
    "screenWidth": 1920,
    "javaEnabled": false,
    "javascriptEnabled": true,
    "latitude": "40.7128",
    "longitude": "-74.0060",
    "deviceModel": "iPhone14,5",
    "osVersion": "iOS 16.1"
}'

Responses

🟢200OK
application/json
Body

Example
{
    "code": "00000",
    "message": "SUCCESS",
    "data": {
        "payCode": 0,
        "tradeNo": "3333333",
        "merorderNo": "222222",
        "payUrl": "https://abc.com/"
    }
}
Modified at 2025-07-04 06:43:44
Previous
Alipay API
Next
Crypto Pay API
Built with