Onerway Payment API
Onerway APIs
  1. API
  • Onerway 商户 API 接入指南
  • Onerway Merchant API Testing
  • Payment APIs
    • Checkout
      • Card Checkout
      • Card Checkout - Subscribe
      • APMs Checkout
      • Single-Method APM Checkout
      • Card Checkout - Authorizaiton
    • JS-SDK
      • One-Time Payment Intent
      • Subscription Payment Intent
      • Card Tokenization Intent
    • API
      • Card
        POST
      • Pre-Auth
        POST
      • Auth Reversal
        POST
      • Capture
        POST
      • Card Tokenization
        POST
      • Tokenized Payment
        POST
      • Subscription - Charge by Onerway
        POST
      • Subscription Initial Charge
        POST
      • Subscription Recurring Charge
        POST
      • Subscription Cancellation
        POST
      • Subscription Reactivation
        POST
      • Token Removal
        POST
    • APMs - Alternative Payment Methods
      • Thailand
        • Thailand-TrueMoney Wallet
        • Thailand-PromptPay
        • Thailand-Rabbit_Line_pay
        • Thailand-KRUNGSRI_ONLINE
      • Malaysia
        • Malaysia-TOUCH_GO_EWALLET
        • Malaysia-Boost
        • Malaysia-MCASH
        • Malaysia-ShopeePay
        • Malaysia-FPX
      • Indonesia
        • Indonesia-ShopeePay
        • Indonesia-OVO
        • Indonesia-DANA
        • Indonesia-QRIS
        • Indonesia-BNI
        • Indonesia-MANDIRI
        • Indonesia-Maybank
        • Indonesia-PERMATA
        • Indonesia-BRI
        • Indonesia-CIMB
        • Indonesia-AKULAKU
        • Indonesia-DANA(Subscribe)
      • Japan
        • Japan-Konbini
        • Japan-PayEasy
      • South Korea
        • South Korea-Kakao_Pay
        • South Korea-Naver_Pay
        • South Korea-PAYCO
        • South Korea-Cards_KOR
      • Vietnam
        • Vietnam-NINE_PAY
        • Vietnam-PAYME
        • Vietnam-VIET_QR
        • Vietnam-MOMO
        • Vietnam-ATM_CARD
      • Philippines
        • Philippines-Dragonpay
        • Philippines-QR_PH
      • Brazil
        • Brazil-Boleto
        • Brazil-Visa/Master
        • Brazil-PIX
        • Brazil-PicPay
        • Brazil-MercadoPago
      • Mexico
        • Mexico-Visa/Master
        • Mexico-SPEI
        • Mexico-OXXO
        • Mexico-PaySafeCard
      • Chile
        • Chile-Visa/Master
        • Chile-Khipu
        • Chile-Webpay
        • Chile-Servipag
        • Chile-Sencillito
      • Paraguay
        • Paraguay-Visa/Master
        • Paraguay-Infonet
      • United States
        • United States-PayPal
        • United States-Venmo
        • United States-CASH_APP
      • Belgium
        • Belgium-Bancontact
        • Belgium-Payconiq
      • Germany
        • Germany-PaySafeCard
        • Germany-Giropay
      • Italy
        • Italy-MyBank
      • Luxembourg
        • Luxembourg-Payconiq
      • Estonia
      • Turkey
        • Turkey-Papara
      • Peru
        • Peru-PagoEfectivo
    • Refund
      • Initiate Refund
      • Cancel Refund
    • Settlement
      • Settlement File Download
    • Query
      • Retrieve Transaction Orders
      • Query Installment Options
      • Retrieve Subscription Details
      • Query Chargeback Records
      • Retrieve Card Tokenization Records
    • Utils
      • Signature Validation Helper
  1. API

Subscription Recurring Charge

Developing
Sandbox Env
https://sandbox-acq.onerway.com
Sandbox Env
https://sandbox-acq.onerway.com
POST
/v1/txn/doTransaction

Request

Body Params application/json
Request configuration for processing a recurring payment for an existing subscription agreement
merchantCustId
string 
客户在商户系统中的唯一标识
optional
Merchant Customer ID
merchantNo
enum<string> 
商户号
required
Merchant number assigned by Onerway
Allowed value:
{{MERCHANT-NO}}
merchantTxnId
string 
商户创建的交易订单号
required
Transaction order number created by the merchant
merchantTxnTime
string 
商户交易时间,格式为yyyy-MM-dd HH:mm:ss
optional
Merchant transaction time in yyyy-MM-dd HH:mm:ss format
orderAmount
string 
订单金额
required
Order amount
orderCurrency
enum<string> 
订单币种,参考ISO 4217货币代码
required
Order currency according to ISO 4217 standard
Allowed value:
USD
sign
null 
签名
required
Signature string for request verification
txnOrderMsg
object 
TxnOrderMsg
required
accept
enum<string> 
持卡人浏览器的Accept请求头
required
Browser's Accept header from the cardholder's HTTP request
<= 2048 characters
Allowed value:
*/*
Example:
text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9
appId
enum<string> 
商户应用程序ID,商户注册网站时Onerway会为商户创建
required
Unique identifier for the merchant's website/application. Can be obtained from Onerway merchant dashboard
<= 20 characters
Allowed value:
{{APPID}}
Example:
{{appId}}
colorDepth
enum<string> 
ColorDepthEnum
required
Allowed values:
162432
contentLength
enum<string> 
ContentLengthEnum
required
Allowed values:
0102440961638465536
javaEnabled
boolean 
持卡人浏览器是否开启java
required
Indicates if Java is enabled in cardholder's browser. Obtained via window.navigator.javaEnabled()
Example:
false
language
enum<string> 
持卡人浏览器的语言
required
Browser language setting. Obtained via window.navigator.language
<= 64 characters
Allowed value:
en-US
Example:
zh-CN
products
array[object (Product) {5}] 
商品信息数组,JSON字符串格式
required
Array of products in the current transaction
>= 1 items<= 3 items
returnUrl
enum<string> 
同步返回地址
required
URL where the customer will be redirected after completing 3DS authentication
<= 256 characters
Allowed value:
{{RETURN-URL}}
Example:
https://docs.onerway.com/
notifyUrl
enum<string> 
异步通知地址
required
Webhook URL for asynchronous notifications
Allowed value:
{{WEBHOOK-ENDPOINT}}
screenHeight
enum<string> 
ScreenHeightEnum
required
Allowed values:
4805686406677367407808008448518969159321024108011801200136614401600162018002160
screenWidth
enum<string> 
ScreenWidthEnum
required
Allowed values:
32036037539039341241442876880082096210241280136614401536168019202048256034403840
timeZoneOffset
enum<string> 
TimeZoneOffsetEnum
required
Allowed values:
-840-720-660-600-540-480-420-360-300-240-180-120-60060120180240300360420480540600660720
transactionIp
string 
商户客户的交易IP地址
required
IP address of the cardholder making the transaction
<= 64 characters
Example:
127.0.0.1
userAgent
enum<string> 
持卡人的浏览器类型
required
Browser's User-Agent string. Obtained via window.navigator.userAgent
<= 2048 characters
Allowed value:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36
Example:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36
productType
enum<string> 
产品类型
optional
Product type specifying the payment method category (CARD for credit/debit card processing)
Allowed value:
CARD
subProductType
enum<string> 
子产品类型
optional
Sub-product type indicating the specific processing method (SUBSCRIBE for recurring billing arrangements)
Allowed value:
SUBSCRIBE
txnType
enum<string> 
交易类型
optional
Transaction type defining the payment operation (SALE for immediate authorization and capture)
Allowed value:
SALE
subscription
object 
订阅复购信息
required
Parameters for processing a subsequent payment for an existing subscription
requestType
enum<string> 
订阅请求类型
required
Indicates that this is a subsequent billing transaction for an existing subscription
Allowed value:
1
tokenId
enum<string> 
令牌ID
required
Secure token identifier representing the stored payment method for the subscription
Allowed value:
{{TOKEN-FOR-SUBSCRIPTION}}
contractId
enum<string> 
合同ID
required
Unique identifier for the subscription contract that this billing transaction belongs to
Allowed value:
{{SUBSCRIPTION-CONTRACT}}
Example
{
    "billingInformation": {},
    "merchantCustId": "CustId-0WQA-3549",
    "merchantNo": "{{MERCHANT-NO}}",
    "merchantTxnId": "d9de61b7-3480-48ed-90e6-4b0b9e2e4640",
    "merchantTxnTime": "2025-05-07 23:00:28",
    "orderAmount": "42",
    "orderCurrency": "USD",
    "sign": null,
    "txnOrderMsg": {
        "accept": "*/*",
        "appId": "{{APPID}}",
        "colorDepth": "24",
        "contentLength": "1024",
        "javaEnabled": true,
        "language": "en-US",
        "products": [
            {
                "currency": "USD",
                "name": "passionfruit",
                "num": "90",
                "price": "696.29",
                "type": "eu anim"
            },
            {
                "currency": "USD",
                "name": "kiwiberry",
                "num": "36",
                "price": "948.79",
                "type": "pariatur amet ea sint aute"
            }
        ],
        "returnUrl": "{{RETURN-URL}}",
        "notifyUrl": "{{WEBHOOK-ENDPOINT}}",
        "screenHeight": "736",
        "screenWidth": "2560",
        "timeZoneOffset": "720",
        "transactionIp": "201.10.41.195",
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
    },
    "productType": "CARD",
    "subProductType": "SUBSCRIBE",
    "txnType": "SALE",
    "subscription": {
        "requestType": "2",
        "tokenId": "195f7e75785863a66d3801ae02c12e24ea16abe164303cf3e3fd10e04d5e4188",
        "contractId": "1919772912228114432",
        "changeMode": "1",
        "productName": "Premium Plan - Monthly",
        "proration": "20",
        "prorationMode": "0"
    }
}

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://sandbox-acq.onerway.com/v1/txn/doTransaction' \
--header 'Content-Type: application/json' \
--data-raw '{
    "billingInformation": {},
    "merchantCustId": "CustId-0WQA-3549",
    "merchantNo": "YOUR-MERCHANT-NO",
    "merchantTxnId": "d9de61b7-3480-48ed-90e6-4b0b9e2e4640",
    "merchantTxnTime": "2025-05-07 23:00:28",
    "orderAmount": "42",
    "orderCurrency": "USD",
    "sign": null,
    "txnOrderMsg": {
        "accept": "*/*",
        "appId": "YOUR-APPLICATION-ID",
        "colorDepth": "24",
        "contentLength": "1024",
        "javaEnabled": true,
        "language": "en-US",
        "products": [
            {
                "currency": "USD",
                "name": "passionfruit",
                "num": "90",
                "price": "696.29",
                "type": "eu anim"
            },
            {
                "currency": "USD",
                "name": "kiwiberry",
                "num": "36",
                "price": "948.79",
                "type": "pariatur amet ea sint aute"
            }
        ],
        "returnUrl": "YOUR-RETURN-URL",
        "notifyUrl": "YOUR-WEBHOOK-ENDPOINT",
        "screenHeight": "736",
        "screenWidth": "2560",
        "timeZoneOffset": "720",
        "transactionIp": "201.10.41.195",
        "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36"
    },
    "productType": "CARD",
    "subProductType": "SUBSCRIBE",
    "txnType": "SALE",
    "subscription": {
        "requestType": "2",
        "tokenId": "195f7e75785863a66d3801ae02c12e24ea16abe164303cf3e3fd10e04d5e4188",
        "contractId": "1919772912228114432",
        "changeMode": "1",
        "productName": "Premium Plan - Monthly",
        "proration": "20",
        "prorationMode": "0"
    }
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2025-05-07 15:03:42
Previous
Subscription Initial Charge
Next
Subscription Cancellation
Built with