Query Refund Order Page
Interface URL
- UAT: https://uat.test2pay.com/sgs/api/acquire2Query/queryRefundOrderPage
- Production: https://api.payby.com/sgs/api/acquire2Query/queryRefundOrderPage
Request Parameters
HTTP Header
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Language | Content-Language | Optional | String(10) | en | Language preference: en - English (default) |
Signature | sign | Required | String | IXJI/QicPQotIsID... | Request signature for authentication |
Merchant ID | Partner-Id | Required | String(12) | 200000000888 | Unique merchant identifier assigned by PayBy |
HTTP Body
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Request time | requestTime | Required | TimeStamp(3) | 1581404947666 | Unix timestamp in milliseconds |
Business content | bizContent | Required | QueryRefundOrderPageSgsRequest | - | Contains the main query parameters |
QueryRefundOrderPageSgsRequest
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Start Date | startDate | Required | String(10) | 2022-07-22 | Query start date in YYYY-MM-DD format |
End Date | endDate | Required | String(10) | 2022-07-22 | Query end date in YYYY-MM-DD format |
Device ID List | deviceIdList | Optional | List(String) | [] | Filter by specific device IDs (empty for all devices) |
Include Status List | includeStatusList | Optional | List(String) | CREATED,REFUNDED_SETTLED,SUCCESS,FAILURE | Filter by refund order status (empty for all statuses) |
Sort Page Parameters | sortPageParam | Required | SortPageParam | - | Pagination and sorting configuration |
SortPageParam
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Page Number | number | Optional | Int | 0 | Page number starting from 0 (default: 0) |
Page Size | size | Required | Int | 20 | Number of records per page |
Request Sample
// HTTP Header
{
"Content-Language": "en", // Language preference
"Content-Type": "application/json", // Request content type
"sign": "IXJI/QicPQotIsIDBcSGIg6jtJUXs1rTuifQFZUNd3KDTl25GKmpYO7OrkaKkTV0shDRitLmkxJCe3Z60zHE2ZSeVczrhwrnmuMG+bX9N22Hw821H6MydsXetYHRnyf5dPbgpmVja582w49grA6jRlVFAVMYdxKJDPSCb2X/IpltvyrLQ1Wt+lqr+fnpYXvyON6/PIZIQIknC8BVddVahxJnaC6HEagvJf6gskz22/DFfPHT1mlMA9pg8qrbh4O7DYZahf8TB3nIzAPc/FHOUZkYYTT2c8m4eLL8740nJVK7D3IOSqSnBAU/iJ2omjPPFvRCCSqzz17pkGsT7AW91w==", // Request signature
"Partner-Id": "200000000888" // Merchant ID
}
// HTTP Body
{
"requestTime": 1581404947666, // Request timestamp in milliseconds
"bizContent": {
"startDate":"2022-07-22", // Query from this date (YYYY-MM-DD format)
"endDate":"2022-07-22", // Query to this date (YYYY-MM-DD format)
"deviceIdList": [], // Empty array means all devices
"includeStatusList":[], // Empty array means all refund statuses
"sortPageParam": {
"number": 0, // First page (starts from 0)
"size": 20 // 20 records per page
}
}
}
Response Parameters
The body in the HTTP Body are returned only when applyStatus
is SUCCESS
and code
= 0
.
HTTP Body
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Response head | head | Required | ResponseHeader | - | Response status and metadata |
Response body | body | Optional | Pagination(RefundOrderListResult) | - | Paginated refund order data |
Pagination
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Total Elements | totalElements | Required | Int | 8 | Total number of records found |
Total Pages | totalPages | Required | Int | 1 | Total number of pages available |
Items | items | Required | List(RefundOrderListResult) | - | Array of refund order records |
RefundOrderListResult
Variable Desc. | Variable name | Required | Type | Example value | Description |
---|---|---|---|---|---|
Refund Merchant Order No | refundMerchantOrderNo | Required | String | e80b6813-1711-4647-aa0d-48b0d1855ae7 | Merchant's unique refund order identifier |
Order No | orderNo | Required | String | 911588343112002067 | PayBy system order number |
Status | status | Required | String | SUCCESS | Refund order status (CREATED/REFUNDED_SETTLED/SUCCESS/FAILURE) |
Amount | amount | Required | Money | - | Refund order total amount with currency |
Notify URL | notifyUrl | Optional | String | https://www.giggles.com | Callback URL for refund order notifications |
Reason | reason | Optional | String | 111 | Refund reason provided by merchant |
Reserved | reserved | Optional | String | aaaa | Reserved field for future use |
Fee Refunded | feeRefunded | Required | Money | - | The amount of refunded fee |
Device ID | deviceId | Optional | String | 111 | Payment device identifier |
Response Sample
// HTTP Body
{
"body": {
"totalElements": 8, // Total number of refund records found
"totalPages": 1, // Total pages available for pagination
"sortPageParam": {
"number": 0, // Current page number
"size": 20 // Page size
},
"items": [
{
"refundMerchantOrderNo": "e80b6813-1711-4647-aa0d-48b0d1855ae7", // Merchant refund order ID
"orderNo": "911588343112002067", // PayBy order number
"status": "SUCCESS", // Refund completed successfully
"amount": {
"amount": 0.01, // Refund amount
"currency": "AED" // Currency code
},
"notifyUrl": "https://www.baidu.com", // Notification callback URL
"reason": "111", // Refund reason
"reserved": "aaaa", // Reserved field
"feeRefunded": {
"amount": 2.0, // Fee refunded amount
"currency": "AED" // Fee currency
},
"deviceId": "111" // Device identifier
},
{
"refundMerchantOrderNo": "b7f48ccd-fe19-4982-bd25-47c00c48e582", // Another successful refund
"orderNo": "911588340433001500",
"status": "SUCCESS", // Refund successful
"amount": {
"amount": 0.01, // Small refund amount
"currency": "AED"
},
"feeRefunded": {
"amount": 0.0, // No fee refunded
"currency": "AED"
}
},
{
"refundMerchantOrderNo": "6aa56830-8d4c-4a27-99a3-a7ac737dc446", // Third successful refund
"orderNo": "911588340592001696",
"status": "SUCCESS",
"amount": {
"amount": 0.01,
"currency": "AED"
},
"feeRefunded": {
"amount": 0.0,
"currency": "AED"
}
},
{
"refundMerchantOrderNo": "8d549b08-1d57-4761-b0a8-1475ea7ef3a8", // Fourth successful refund
"orderNo": "911588340324001456",
"status": "SUCCESS",
"amount": {
"amount": 0.01,
"currency": "AED"
},
"feeRefunded": {
"amount": 0.0,
"currency": "AED"
}
},
{
"refundMerchantOrderNo": "5dda518d-9801-4ee6-2985-af117b3c4d52", // Failed refund example
"orderNo": "191588328390002304",
"status": "FAILURE", // Refund failed
"amount": {
"amount": 90.0, // Larger refund amount
"currency": "AED"
},
"notifyUrl": "http://www.yoursite.com", // Merchant notification URL
"feeRefunded": {
"amount": 0.0, // No fee refunded for failed refund
"currency": "AED"
}
},
{
"refundMerchantOrderNo": "5dda518d-8500-4ee6-2985-af117b3c4d52", // Another failed refund
"orderNo": "191588327382002089",
"status": "FAILURE",
"amount": {
"amount": 90.0,
"currency": "AED"
},
"notifyUrl": "http://www.yoursite.com",
"feeRefunded": {
"amount": 0.0,
"currency": "AED"
}
},
{
"refundMerchantOrderNo": "5dda518d-8500-4ee6-1985-af117b3c4d52", // Third failed refund
"orderNo": "191588327146001910",
"status": "FAILURE",
"amount": {
"amount": 99.99, // High value failed refund
"currency": "AED"
},
"notifyUrl": "http://www.yoursite.com",
"feeRefunded": {
"amount": 0.0,
"currency": "AED"
}
},
{
"refundMerchantOrderNo": "5dda515d-8900-4ee6-9385-af117b3c4d52", // Created but not processed
"orderNo": "191588326189001889",
"status": "CREATED", // Refund created but not processed yet
"amount": {
"amount": 99.99,
"currency": "AED"
},
"notifyUrl": "http://127.0.0.1/wc-api/payby_refund_notify", // Local callback URL
"feeRefunded": {
"amount": 0.0, // No fee refunded yet
"currency": "AED"
}
}
]
},
"head": {
"applyStatus": "SUCCESS", // Application processed successfully
"code": "0", // Success code
"msg": "SUCCESS", // Success message
"traceCode": "000000" // Trace code for debugging
}
}
Return Code
Code | Message | Cause | Workaround |
---|---|---|---|
0 | SUCCESS | Request processed successfully | — |
400 | INVALID_PARAMETER | Parameter error | Adjust the request parameters |
402 | RATE_LIMIT_REJECT | Requests are too frequent | Reduce request frequency |
403 | UNAUTHORIZED | API is not authorized | Contact PayBy |
404 | SERVICE_NOT_AVAILABLE | API service is unavailable | Contact PayBy |
500 | SYSTEM_ERROR | Internal system error | Contact PayBy and try again later |
504 | SERVICE_TIMEOUT | Service timeout | Try again later |
601 | RISK_FAIL | Risk control verification failed | Adjust the business logic |
71002 | REQUESTTIME_TOO_EARLY | Request time is more than 15 minutes earlier than current time | Adjust the request time |
71003 | REQUESTTIME_TOO_LATER | Request time is more than 15 minutes later than current time | Adjust the request time |