Payment 查询
Payment 查询 API 用于按支付意图维度检索交易结果,支持将同一个 paymentId 下的多笔 transactionId 进行统一查询与对账。
字段关系
transactionId:单次交易尝试流水号(attempt 维度)。status:当前transactionId的交易状态,沿用 TxnStatusEnum。paymentId:支付意图主键(一个paymentId可关联多笔transactionId)。paymentStatus:支付意图状态,参见 PaymentStatusEnum。
paymentStatus = N 场景
paymentStatus = N 表示支付意图已关闭,包含两种场景:
- 用户下单未支付,超时关单。
- 用户多次尝试均失败,最终超时关单。
API 请求参数
关键参数
请求参数中,建议至少提供以下条件之一:
paymentIdmerchantTxnIdstransactionIdsstartTime+endTime
| Parameter | Type | Length | Required | Signed | Description |
|---|---|---|---|---|---|
merchantNo | String | 20 | Yes | Yes | Merchant number assigned by |
merchantTxnIds | String | / | Conditional | Yes | Multiple merchant transaction IDs for batch queries, separated by commas. |
transactionIds | String | / | Conditional | Yes | Multiple Onerway transaction IDs for batch queries, separated by commas. |
paymentId | String | / | No | Yes | Payment intent ID. Business type is |
txnTypes | String | / | No | Yes | Transaction type filter for payment queries. Comma-separated values are supported. |
startTime | String | / | Conditional | Yes | Start time for the transaction query period filter. |
endTime | String | / | Conditional | Yes | End time for the transaction query period filter. |
current | String | / | Yes | Yes | Page number for payment queries. |
size | String | / | No | Yes | Page size. |
sign | String | / | Yes | No | Digital signature string for request verification and security. Please refer to Signature for signature generation method. |
分页规则
current=0和current=1都表示第一页。- 响应中的
current统一返回1-based页码(第一页为1)。 size默认10,最大100。
响应
| Name | Type | Description |
|---|---|---|
respCode | String | Response code from |
respMsg | String | Response message from |
data | Object | Response data. Refer to object data |
data
| Name | Type | Description |
|---|---|---|
content | List | Payment records list. |
└paymentId | String | Payment intent ID. Business type is |
└paymentStatus | String | Payment intent status. See PaymentStatusEnum. |
└lastTransactionId | String | Latest transaction attempt ID under this payment intent. Business type is |
└lastPaymentAttempt | Object | Latest attempt result summary. Contains failure reason and advice. |
└merchantTxnId | String | Merchant transaction ID. |
└merchantTxnOriginalId | String | Merchant master order ID. |
└txnTime | String | Latest attempt transaction time. Format: |
└txnCompletionTime | String | Latest attempt completion time. Format: |
└productType | String | Product type. See ProductTypeEnum. |
└subProductType | String | Sub-product type. See SubProductTypeEnum. |
└cardType | String | Card network or card type. |
└orderAmount | String | Order amount. |
└orderCurrency | String | Order currency. See ISO 4217. |
└txnAmount | String | Transaction amount. |
└txnCurrency | String | Transaction currency. See ISO 4217. |
└arn | String | Acquirer Reference Number. |
└appId | String | Merchant application ID. Business type is |
└website | String | Website of transaction origin. |
└cardNumber | String | Masked card number (first 6 + last 4). |
└holderName | String | Cardholder name. |
└eci | String | Electronic Commerce Indicator. |
String | Customer email. | |
└channelRequestId | String | Channel request ID. |
└paymentMethodDetails | Object | Payment method detail object. Includes for structure. |
current | String | Current page number in response (1-based). |
size | String | Page size. |
totalPages | String | Total pages. |
totalElements | String | Total records. |
API 使用示例
{
"merchantNo": "10001",
"current": "1",
"size": "10",
"paymentId": "2031991417907576832",
"transactionIds": "",
"startTime": "2026-01-01 00:00:00",
"endTime": "2026-03-28 23:59:59",
"sign": "your_sign_value"
}2
3
4
5
6
7
8
9
10
{
"respCode": "20000",
"respMsg": "Success",
"data": {
"content": [
{
"paymentId": "2031991417907576832",
"paymentStatus": "O",
"lastTransactionId": "2031991417966297088",
"lastPaymentAttempt": {
"reason": "Acquirer suspected fraud",
"adviceMsg": "Acquirer suspected fraud"
},
"merchantTxnId": "1773299479000",
"merchantTxnOriginalId": null,
"txnTime": "2026-03-12 15:11:21",
"txnCompletionTime": "2026-03-12 15:11:50",
"productType": "CARD",
"subProductType": "DIRECT",
"cardType": "VISA",
"orderAmount": "100.00",
"orderCurrency": "USD",
"txnAmount": "100.00",
"txnCurrency": "USD",
"arn": null,
"appId": "1839538258499215360",
"website": "demo.onerway.com",
"cardNumber": "471110******0000",
"holderName": "CL BRW2",
"eci": "07",
"email": "abel.wang@onerway.com",
"channelRequestId": "7777772031991538036387841",
"paymentMethodDetails": {
"card": {
"checks": {
"addressCheck": "unchecked",
"postalCodeCheck": "unchecked",
"avsResultRawCode": "FD",
"threeDSecureResult": {
"version": "UNKNOWN",
"authenticationFlow": null,
"chargebackLiability": "UNKNOWN",
"transStatus": null,
"transStatusReason": null,
"veresEnrolled": null,
"eci": "07",
"cvvResult": null,
"avsFullResult": null,
"cavvResult": null
}
},
"holderName": "CL BRW2",
"year": "2026",
"month": "05",
"cardType": "VISA",
"productCategory": null,
"issuer": null,
"cardBinCountry": "US",
"authorizationCode": null,
"cardNumber": "471110******0000"
}
}
}
],
"current": "1",
"size": 10,
"totalPages": 1,
"totalElements": 1
}
}2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
实施最佳实践
- 使用
paymentId作为业务主键进行支付链路对账。 - 如已接入支付意图模型,请同时存储
status与paymentStatus;未接入支付意图模型可继续仅处理status。 - 对分页查询设置固定时间窗口,避免无条件全量扫描。