Skip to main content

Query Transaction API

HTTP Request​

GET /v5/pay/agreement/transaction/query

Query a single deduction transaction or refund record by its transaction or refund number. The current implementation determines the returned detail type from the matched order record.


Request Parameters​

ParameterTypeRequiredDescription
merchantIdstringYesMerchant ID
userIdstringNoPlatform user ID; accepted by the interface but not used by the current query lookup
agreementTypestringYesSign type: CYCLE / NON_CYCLE / SINGLE; accepted but not used by the current query lookup
recordTypestringNoRecord type: PAY / REFUND; accepted but not used by the current query lookup, and no default is applied
tradeNostringConditionalPlatform trade number; provide at least one transaction/refund number
outTradeNostringConditionalMerchant order number; provide at least one transaction/refund number
refundNostringConditionalPlatform refund number; provide at least one transaction/refund number
outRefundNostringConditionalMerchant refund number; provide at least one transaction/refund number
info

At least one of tradeNo, outTradeNo, refundNo, or outRefundNo must be provided.


Response Parameters (Deduction Transaction)​

ParameterTypeDescription
retCodeintResponse code
retMsgstringResponse message
resultobjectResponse data
result.tradeDetailobjectTransaction details; populated when the matched order is a deduction transaction
result.tradeDetail.tradeNostringPlatform trade number
result.tradeDetail.outTradeNostringMerchant order number
result.tradeDetail.statusstringTransaction status: PROCESSING / SUCCESS / FAILED / TIMEOUT
result.tradeDetail.amountobjectMerchant requested amount
result.tradeDetail.amount.totalstringAmount (minimum unit)
result.tradeDetail.amount.currencystringCurrency code
result.tradeDetail.amount.currencyTypestringCurrency type: FIAT / CRYPTO
result.tradeDetail.amount.chainstringChain network
result.tradeDetail.cryptoPaymentobjectDefined by the response schema but not populated by the current query implementation
result.tradeDetail.payTimestringPayment time
result.tradeDetail.refundAmountobjectDefined by the response schema but not populated by the current query implementation
result.tradeDetail.orderInfoobjectOrder information
result.tradeDetail.orderInfo.orderTitlestringOrder title
result.tradeDetail.orderInfo.orderDescstringOrder description
result.tradeDetail.orderInfo.goodsNamestringGoods name
result.tradeDetail.orderInfo.goodsIdstringGoods ID
result.tradeDetail.orderInfo.goodsCategorystringGoods category
result.tradeDetail.customerInfoobjectCustomer KYC information; returned only for successful orders when enabled for the merchant
result.tradeDetail.customerInfo.firstNamestringCustomer first name
result.tradeDetail.customerInfo.lastNamestringCustomer last name
result.tradeDetail.customerInfo.dateOfBirthstringCustomer date of birth
result.tradeDetail.customerInfo.kyc1CountrystringKYC level 1 country
result.tradeDetail.customerInfo.kyc2CountrystringKYC level 2 country

Response Parameters (Refund Record)​

ParameterTypeDescription
retCodeintResponse code
retMsgstringResponse message
resultobjectResponse data
result.refundDetailobjectRefund details; populated when the matched order is a refund
result.refundDetail.refundNostringPlatform refund number
result.refundDetail.outRefundNostringMerchant refund number
result.refundDetail.tradeNostringOriginal trade number
result.refundDetail.statusstringRefund status: PROCESSING / SUCCESS / FAILED / TIMEOUT
result.refundDetail.refundAmountobjectRefund amount
result.refundDetail.refundAmount.totalstringRefund amount (minimum unit)
result.refundDetail.refundAmount.currencystringCurrency code
result.refundDetail.refundAmount.currencyTypestringCurrency type: FIAT / CRYPTO
result.refundDetail.refundTimestringRefund success time
result.refundDetail.failureReasonstringFailure reason
result.refundDetail.customerInfoobjectCustomer KYC information; returned only for successful orders when enabled for the merchant
result.refundDetail.customerInfo.firstNamestringCustomer first name
result.refundDetail.customerInfo.lastNamestringCustomer last name
result.refundDetail.customerInfo.dateOfBirthstringCustomer date of birth
result.refundDetail.customerInfo.kyc1CountrystringKYC level 1 country
result.refundDetail.customerInfo.kyc2CountrystringKYC level 2 country

Request Examples​

Query Deduction Transaction​

GET /v5/pay/agreement/transaction/query?merchantId=M123456789&userId=U_123456789&agreementType=CYCLE&recordType=PAY&tradeNo=PAY202601070001 HTTP/1.1
Host: api.bybit.com
X-Request-Id: 550e8400-e29b-41d4-a716-446655440000
X-Timestamp: 1736233200000
X-Signature: {signature}
Authorization: Bearer {access_token}

Query Refund Record​

GET /v5/pay/agreement/transaction/query?merchantId=M123456789&userId=U_123456789&agreementType=CYCLE&recordType=REFUND&refundNo=RF202601070001 HTTP/1.1
Host: api.bybit.com
X-Request-Id: 550e8400-e29b-41d4-a716-446655440000
X-Timestamp: 1736233200000
X-Signature: {signature}
Authorization: Bearer {access_token}

Response Examples​

Deduction Transaction​

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"tradeDetail": {
"tradeNo": "PAY202601070002",
"outTradeNo": "ORDER20260107002",
"status": "SUCCESS",
"amount": {
"total": "10000",
"currency": "USD",
"currencyType": "FIAT",
"chain": ""
},
"payTime": "2026-01-07T10:30:00Z",
"orderInfo": {
"orderTitle": "Ride fare",
"orderDesc": "January 7 trip fare",
"goodsName": "Express service",
"goodsId": "TAXI_SERVICE_001",
"goodsCategory": "4121"
}
}
}
}

Refund Record​

{
"retCode": 20000,
"retMsg": "Success",
"result": {
"refundDetail": {
"refundNo": "RF202601070001",
"outRefundNo": "REFUND20260107001",
"tradeNo": "PAY202601070001",
"status": "SUCCESS",
"refundAmount": {
"total": "2350",
"currency": "USDT",
"currencyType": "CRYPTO"
},
"refundTime": "2026-01-07T11:30:00Z",
"failureReason": ""
}
}
}

Notes​

  • Use this API to confirm transaction or refund status after timeout
  • The detail type is determined by the matched order and returned in either tradeDetail or refundDetail
  • For PROCESSING status, wait for the webhook or poll periodically