- Onerway Merchant API Testing
- Onerway 商户 API 接入指南
- Payment APIs
- Checkout
- JS-SDK
- API
- APMs - Alternative Payment Methods
- Refund
- Settlement
- Query
- Utils
Pre-Auth
Sandbox Env
Sandbox Env
POST
/v1/txn/doTransaction
Request
Body Params application/json
Configuration for processing credit card authorization that verifies and reserves funds without immediate settlement
billingInformation
object
TransactionAddress
address
string
地址信息(账单或配送地址)
city
string
城市名称
country
enum<string>
国家代码,请参考ISO 3166标准
Allowed value:
US
email
string
电子邮件地址
firstName
string
名字
identityNumber
string
证件号码
lastName
string
姓氏
phone
string
电话号码
postalCode
string
邮政编码
province
enum<string>
省/州
Allowed value:
CO
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
shippingInformation
object
TransactionAddress
address
string
地址信息(账单或配送地址)
city
string
城市名称
country
enum<string>
国家代码,请参考ISO 3166标准
Allowed value:
US
email
string
电子邮件地址
firstName
string
名字
identityNumber
string
证件号码
lastName
string
姓氏
phone
string
电话号码
postalCode
string
邮政编码
province
enum<string>
省/州
Allowed value:
CO
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:
DIRECT
txnType
enum<string>
交易类型
Allowed value:
AUTH
cardInfo
object
卡信息
holderName
enum<string>
持卡人姓名
<= 64 characters
Allowed value:
CL BRW2
Example:
John Smith
cardNumber
enum<string>
卡号
<= 16 characters
Allowed values:
40000209515950324000000000002701
Example:
4000020951595032
month
enum<string>
有效期月份
<= 64 characters
Allowed value:
05
Example:
03
year
enum<string>
有效期年份
<= 64 characters
Allowed value:
26
Example:
2024
cvv
enum<string>
安全码
<= 64 characters
Allowed value:
123
Example:
123
Example
{
"billingInformation": {
"address": "155 Queen's Road",
"city": "North Rosinaview",
"country": "US",
"email": "Ottis_Rippin@gmail.com",
"firstName": "Jo",
"identityNumber": "91576941117",
"lastName": "Quitzon",
"phone": "19898785542",
"postalCode": "48599",
"province": "CO"
},
"merchantCustId": "CustId-9LJD-DT5X",
"merchantNo": "{{MERCHANT-NO}}",
"merchantTxnId": "60f059e5-a44f-4e16-8d5c-158dcffb9b03",
"merchantTxnTime": "2025-03-25 11:33:56",
"orderAmount": "5",
"orderCurrency": "USD",
"shippingInformation": {
"address": "7832 Raynor Shores",
"city": "Lake Sheaport",
"country": "US",
"email": "Eino99@yahoo.com",
"firstName": "Kristopher",
"identityNumber": "17551410338",
"lastName": "Corwin",
"phone": "16039269409",
"postalCode": "91787-0395",
"province": "CO"
},
"sign": null,
"txnOrderMsg": {
"accept": "*/*",
"appId": "{{APPID}}",
"colorDepth": "24",
"contentLength": "0",
"javaEnabled": false,
"language": "en-US",
"products": [
{
"currency": "USD",
"name": "avocado",
"num": "79",
"price": "48.65",
"type": "Excepteur non ipsum nulla"
},
{
"currency": "USD",
"name": "nashi pear",
"num": "20",
"price": "277.16",
"type": "occaecat"
},
{
"currency": "USD",
"name": "pear",
"num": "21",
"price": "130.76",
"type": "dolor dolore ut"
}
],
"returnUrl": "{{RETURN-URL}}",
"notifyUrl": "{{WEBHOOK-ENDPOINT}}",
"screenHeight": "568",
"screenWidth": "768",
"timeZoneOffset": "660",
"transactionIp": "209.100.200.119",
"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": "DIRECT",
"txnType": "AUTH",
"cardInfo": {
"holderName": "CL BRW2",
"cardNumber": "4000000000002701",
"month": "05",
"year": "26",
"cvv": "123"
}
}
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": "155 Queen'\''s Road",
"city": "North Rosinaview",
"country": "US",
"email": "Ottis_Rippin@gmail.com",
"firstName": "Jo",
"identityNumber": "91576941117",
"lastName": "Quitzon",
"phone": "19898785542",
"postalCode": "48599",
"province": "CO"
},
"merchantCustId": "CustId-9LJD-DT5X",
"merchantNo": "YOUR-MERCHANT-NO",
"merchantTxnId": "60f059e5-a44f-4e16-8d5c-158dcffb9b03",
"merchantTxnTime": "2025-03-25 11:33:56",
"orderAmount": "5",
"orderCurrency": "USD",
"shippingInformation": {
"address": "7832 Raynor Shores",
"city": "Lake Sheaport",
"country": "US",
"email": "Eino99@yahoo.com",
"firstName": "Kristopher",
"identityNumber": "17551410338",
"lastName": "Corwin",
"phone": "16039269409",
"postalCode": "91787-0395",
"province": "CO"
},
"sign": null,
"txnOrderMsg": {
"accept": "*/*",
"appId": "YOUR-APPLICATION-ID",
"colorDepth": "24",
"contentLength": "0",
"javaEnabled": false,
"language": "en-US",
"products": [
{
"currency": "USD",
"name": "avocado",
"num": "79",
"price": "48.65",
"type": "Excepteur non ipsum nulla"
},
{
"currency": "USD",
"name": "nashi pear",
"num": "20",
"price": "277.16",
"type": "occaecat"
},
{
"currency": "USD",
"name": "pear",
"num": "21",
"price": "130.76",
"type": "dolor dolore ut"
}
],
"returnUrl": "YOUR-RETURN-URL",
"notifyUrl": "YOUR-WEBHOOK-ENDPOINT",
"screenHeight": "568",
"screenWidth": "768",
"timeZoneOffset": "660",
"transactionIp": "209.100.200.119",
"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": "DIRECT",
"txnType": "AUTH",
"cardInfo": {
"holderName": "CL BRW2",
"cardNumber": "4000000000002701",
"month": "05",
"year": "26",
"cvv": "123"
}
}'
Responses
🟢200OK
application/json
Body
object {0}
Example
{}
Modified at 2025-03-25 03:34:00