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 Initial 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
Configuration for establishing a recurring payment agreement that automatically bills the customer at defined intervals
billingInformation
object 
TransactionAddress
required
address
string 
地址信息(账单或配送地址)
required
Address information (billing or shipping)
city
string 
城市名称
required
City name
country
enum<string> 
国家代码,请参考ISO 3166标准
required
Country code according to ISO 3166 standard
Allowed value:
US
email
string 
电子邮件地址
required
Email address
firstName
string 
名字
required
First name
identityNumber
string 
证件号码
optional
Identity document number
lastName
string 
姓氏
required
Last name
phone
string 
电话号码
required
Phone number
postalCode
string 
邮政编码
required
Postal code
province
enum<string> 
省/州
required
State/province
Allowed value:
CO
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
shippingInformation
object 
TransactionAddress
required
address
string 
地址信息(账单或配送地址)
required
Address information (billing or shipping)
city
string 
城市名称
required
City name
country
enum<string> 
国家代码,请参考ISO 3166标准
required
Country code according to ISO 3166 standard
Allowed value:
US
email
string 
电子邮件地址
required
Email address
firstName
string 
名字
required
First name
identityNumber
string 
证件号码
optional
Identity document number
lastName
string 
姓氏
required
Last name
phone
string 
电话号码
required
Phone number
postalCode
string 
邮政编码
required
Postal code
province
enum<string> 
省/州
required
State/province
Allowed value:
CO
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
cardInfo
object 
卡信息
required
Card transaction information in JSON string format
holderName
enum<string> 
持卡人姓名
required
Full name of the cardholder as it appears on the payment card
<= 64 characters
Allowed value:
CL BRW2
Example:
John Smith
cardNumber
enum<string> 
卡号
required
Primary account number (PAN) of the payment card without spaces or separators
<= 16 characters
Allowed value:
4000000000002701
Example:
4000020951595032
month
enum<string> 
有效期月份
required
Two-digit expiration month of the payment card (01-12)
<= 64 characters
Allowed value:
05
Example:
03
year
enum<string> 
有效期年份
required
Two or four-digit expiration year of the payment card
<= 64 characters
Allowed value:
26
Example:
2024
cvv
enum<string> 
安全码
required
Card Verification Value - security code on the back of the card (3-4 digits)
<= 64 characters
Allowed value:
123
Example:
123
subscription
object 
商户发起扣款-首购
required
Core configuration parameters for establishing and managing recurring billing arrangements
requestType
enum<string> 
订阅请求类型
required
首购 | Initial Purchase
<= 1 characters
Allowed value:
0
selfExecute
enum<string> 
订阅扣款方式
required
商户发起扣款 | Merchant Initiated
<= 1 characters
Allowed value:
2
productName
string  | null 
订阅商品名称
optional
Name of the product or service being subscribed to, displayed in payment statements and notifications
<= 256 characters
frequencyType
enum<string> 
订阅频率类型
required
Unit of time measurement for the subscription billing cycle interval, currently limited to daily frequency
<= 1 characters
Allowed value:
D
frequencyPoint
string 
订阅频率点数
required
Numeric value defining the number of days between billing cycles for merchant-initiated payments
<= 3 characters
merchantCustId
string 
商户客户ID
required
Unique identifier for the customer in the merchant's system, required for initial subscription setup
<= 40 characters
expireDate
string 
过期日期
required
Specific calendar date when the subscription will automatically terminate
<= 10 characters
Match pattern:
^\d{4}-\d{2}-\d{2}$
metaData
string 
元数据
required
Custom JSON data field for merchant-specific information related to the subscription
Example
{
    "billingInformation": {
        "address": "90729 Bridge Road",
        "city": "South Gate",
        "country": "US",
        "email": "Stevie.Friesen90@gmail.com",
        "firstName": "Cordell",
        "identityNumber": "84698217949",
        "lastName": "Effertz",
        "phone": "13652765986",
        "postalCode": "74374",
        "province": "CO"
    },
    "merchantCustId": "CustId-JK6B-8850",
    "merchantNo": "{{MERCHANT-NO}}",
    "merchantTxnId": "f13aea15-2629-4a91-8c3d-9d1460ec0b33",
    "merchantTxnTime": "2025-05-06 23:47:05",
    "orderAmount": "2",
    "orderCurrency": "USD",
    "shippingInformation": {
        "address": "37792 Main",
        "city": "West General",
        "country": "US",
        "email": "Noble59@hotmail.com",
        "firstName": "Herta",
        "identityNumber": "94700162716",
        "lastName": "Lemke",
        "phone": "18904565556",
        "postalCode": "08779-3653",
        "province": "CO"
    },
    "sign": null,
    "txnOrderMsg": {
        "accept": "*/*",
        "appId": "{{APPID}}",
        "colorDepth": "24",
        "contentLength": "16384",
        "javaEnabled": true,
        "language": "en-US",
        "products": [
            {
                "currency": "USD",
                "name": "feijoa",
                "num": "88",
                "price": "968.79",
                "type": "consectetur adipisicing reprehenderit sint"
            },
            {
                "currency": "USD",
                "name": "avocado",
                "num": "52",
                "price": "414.89",
                "type": "consectetur labore"
            }
        ],
        "returnUrl": "{{RETURN-URL}}",
        "notifyUrl": "{{WEBHOOK-ENDPOINT}}",
        "screenHeight": "1800",
        "screenWidth": "320",
        "timeZoneOffset": "360",
        "transactionIp": "201.9.255.1",
        "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",
    "cardInfo": {
        "holderName": "CL BRW2",
        "cardNumber": "4000000000002701",
        "month": "05",
        "year": "26",
        "cvv": "123"
    },
    "subscription": {
        "requestType": "0",
        "selfExecute": "2",
        "productName": "Gorgeous Plastic Salad",
        "frequencyType": "D",
        "frequencyPoint": "1",
        "merchantCustId": "CustId-PL20-S700",
        "expireDate": "2025-11-23",
        "metaData": "vary"
    }
}

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": {
        "address": "90729 Bridge Road",
        "city": "South Gate",
        "country": "US",
        "email": "Stevie.Friesen90@gmail.com",
        "firstName": "Cordell",
        "identityNumber": "84698217949",
        "lastName": "Effertz",
        "phone": "13652765986",
        "postalCode": "74374",
        "province": "CO"
    },
    "merchantCustId": "CustId-JK6B-8850",
    "merchantNo": "YOUR-MERCHANT-NO",
    "merchantTxnId": "f13aea15-2629-4a91-8c3d-9d1460ec0b33",
    "merchantTxnTime": "2025-05-06 23:47:05",
    "orderAmount": "2",
    "orderCurrency": "USD",
    "shippingInformation": {
        "address": "37792 Main",
        "city": "West General",
        "country": "US",
        "email": "Noble59@hotmail.com",
        "firstName": "Herta",
        "identityNumber": "94700162716",
        "lastName": "Lemke",
        "phone": "18904565556",
        "postalCode": "08779-3653",
        "province": "CO"
    },
    "sign": null,
    "txnOrderMsg": {
        "accept": "*/*",
        "appId": "YOUR-APPLICATION-ID",
        "colorDepth": "24",
        "contentLength": "16384",
        "javaEnabled": true,
        "language": "en-US",
        "products": [
            {
                "currency": "USD",
                "name": "feijoa",
                "num": "88",
                "price": "968.79",
                "type": "consectetur adipisicing reprehenderit sint"
            },
            {
                "currency": "USD",
                "name": "avocado",
                "num": "52",
                "price": "414.89",
                "type": "consectetur labore"
            }
        ],
        "returnUrl": "YOUR-RETURN-URL",
        "notifyUrl": "YOUR-WEBHOOK-ENDPOINT",
        "screenHeight": "1800",
        "screenWidth": "320",
        "timeZoneOffset": "360",
        "transactionIp": "201.9.255.1",
        "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",
    "cardInfo": {
        "holderName": "CL BRW2",
        "cardNumber": "4000000000002701",
        "month": "05",
        "year": "26",
        "cvv": "123"
    },
    "subscription": {
        "requestType": "0",
        "selfExecute": "2",
        "productName": "Gorgeous Plastic Salad",
        "frequencyType": "D",
        "frequencyPoint": "1",
        "merchantCustId": "CustId-PL20-S700",
        "expireDate": "2025-11-23",
        "metaData": "vary"
    }
}'

Responses

🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2025-05-06 15:47:14
Previous
Subscription - Charge by Onerway
Next
Subscription Recurring Charge
Built with