- Onerway Merchant API Testing
- Onerway 商户 API 接入指南
- Payment APIs
- Checkout
- JS-SDK
- API
- APMs - Alternative Payment Methods
- Refund
- Settlement
- Query
- Utils
Subscription Recurring Charge
Developing
Sandbox Env
Sandbox Env
POST
/v1/txn/doTransaction
Request
Body Params application/json
Request configuration for processing a recurring payment for an existing subscription agreement
merchantCustId
string
客户在商户系统中的唯一标识
merchantNo
enum<string>
商户号
Allowed value:
{{MERCHANT-NO}}
merchantTxnId
string
商户创建的交易订单号
merchantTxnTime
string
商户交易时间,格式为yyyy-MM-dd HH:mm:ss
orderAmount
string
订单金额
orderCurrency
enum<string>
订单币种,参考ISO 4217货币代码
Allowed value:
USD
sign
null
签名
txnOrderMsg
object
TxnOrderMsg
accept
enum<string>
持卡人浏览器的Accept请求头
<= 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会为商户创建
<= 20 characters
Allowed value:
{{APPID}}
Example:
{{appId}}
colorDepth
enum<string>
ColorDepthEnum
Allowed values:
162432
contentLength
enum<string>
ContentLengthEnum
Allowed values:
0102440961638465536
javaEnabled
boolean
持卡人浏览器是否开启java
Example:
false
language
enum<string>
持卡人浏览器的语言
<= 64 characters
Allowed value:
en-US
Example:
zh-CN
products
array[object (Product) {5}]
商品信息数组,JSON字符串格式
>= 1 items<= 3 items
returnUrl
enum<string>
同步返回地址
<= 256 characters
Allowed value:
{{RETURN-URL}}
Example:
https://docs.onerway.com/
notifyUrl
enum<string>
异步通知地址
Allowed value:
{{WEBHOOK-ENDPOINT}}
screenHeight
enum<string>
ScreenHeightEnum
Allowed values:
4805686406677367407808008448518969159321024108011801200136614401600162018002160
screenWidth
enum<string>
ScreenWidthEnum
Allowed values:
32036037539039341241442876880082096210241280136614401536168019202048256034403840
timeZoneOffset
enum<string>
TimeZoneOffsetEnum
Allowed values:
-840-720-660-600-540-480-420-360-300-240-180-120-60060120180240300360420480540600660720
transactionIp
string
商户客户的交易IP地址
<= 64 characters
Example:
127.0.0.1
userAgent
enum<string>
持卡人的浏览器类型
<= 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>
产品类型
Allowed value:
CARD
subProductType
enum<string>
子产品类型
Allowed value:
SUBSCRIBE
txnType
enum<string>
交易类型
Allowed value:
SALE
subscription
object
订阅复购信息
requestType
enum<string>
订阅请求类型
Allowed value:
1
tokenId
enum<string>
令牌ID
Allowed value:
{{TOKEN-FOR-SUBSCRIPTION}}
contractId
enum<string>
合同ID
Allowed value:
{{SUBSCRIPTION-CONTRACT}}
Example
{
"merchantCustId": "CustId-J94K-1353",
"merchantNo": "{{MERCHANT-NO}}",
"merchantTxnId": "af07f59a-18af-43a1-aacb-725e269b8479",
"merchantTxnTime": "2025-04-01 17:57:54",
"orderAmount": "2",
"orderCurrency": "USD",
"sign": null,
"txnOrderMsg": {
"accept": "*/*",
"appId": "{{APPID}}",
"colorDepth": "16",
"contentLength": "4096",
"javaEnabled": true,
"language": "en-US",
"products": [
{
"currency": "USD",
"name": "goji berry",
"num": "36",
"price": "294.39",
"type": "ipsum"
},
{
"currency": "USD",
"name": "honeydew melon",
"num": "6",
"price": "608.93",
"type": "ipsum ut officia sint"
}
],
"returnUrl": "{{RETURN-URL}}",
"notifyUrl": "{{WEBHOOK-ENDPOINT}}",
"screenHeight": "1180",
"screenWidth": "820",
"timeZoneOffset": "60",
"transactionIp": "122.234.95.6",
"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": "1",
"tokenId": "{{TOKEN-FOR-SUBSCRIPTION}}",
"contractId": "{{SUBSCRIPTION-CONTRACT}}"
}
}
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 '{
"merchantCustId": "CustId-J94K-1353",
"merchantNo": "YOUR-MERCHANT-NO",
"merchantTxnId": "af07f59a-18af-43a1-aacb-725e269b8479",
"merchantTxnTime": "2025-04-01 17:57:54",
"orderAmount": "2",
"orderCurrency": "USD",
"sign": null,
"txnOrderMsg": {
"accept": "*/*",
"appId": "YOUR-APPLICATION-ID",
"colorDepth": "16",
"contentLength": "4096",
"javaEnabled": true,
"language": "en-US",
"products": [
{
"currency": "USD",
"name": "goji berry",
"num": "36",
"price": "294.39",
"type": "ipsum"
},
{
"currency": "USD",
"name": "honeydew melon",
"num": "6",
"price": "608.93",
"type": "ipsum ut officia sint"
}
],
"returnUrl": "YOUR-RETURN-URL",
"notifyUrl": "YOUR-WEBHOOK-ENDPOINT",
"screenHeight": "1180",
"screenWidth": "820",
"timeZoneOffset": "60",
"transactionIp": "122.234.95.6",
"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": "1",
"tokenId": "{{TOKEN-FOR-SUBSCRIPTION}}",
"contractId": "{{SUBSCRIPTION-CONTRACT}}"
}
}'
Responses
🟢200Success
application/json
Body
object {0}
Example
{}
Modified at 2025-04-01 09:57:57