Query Transaction
To check the status of an order
! Tip
After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Query Order which may help you when going through the documentation.
Endpoint
https://api.grubpay.io/v4/inquire
Method:
POST
Header
Content-Type: application/json;charset=UTF-8
Request
| name | required | type | sample | description |
|---|---|---|---|---|
| mchId | y | String | 10000701 | assigned by GrubPay |
| mchOrderNo | y* | String | 1234567890abc | assigned by merchant |
| payOrderId | y* | String | ||
| sign | y | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Sign algorithm |
*use either payOrderId or mchOrderNo, use one of them
Response
| name | required | type | sample | description |
|---|---|---|---|---|
| retCode | y | String | SUCCESS or FAIL | |
| retMsg | y | String | ||
| retData | y | JSON | if retCode is SUCCESS, order detailed info returned |
retData contains order information:
| name | required | type | sample | description |
|---|---|---|---|---|
| payOrderId | y | String | PC20221123224002378248641620 | For refunding/voiding this transaction |
| mchId | y | String | ||
| mchOrderNo | n | String | ||
| originalOrderId | n | String | original pay order id for refund | |
| amount | y | Int | 100 | in cents |
| token | y | String(50) | cf6e8f3f-c010-4b99-9a9f-32cf21ea7cb6 | reusable token |
| currency | y | String | USD | |
| payType | y | String | pay or refund | |
| refundable | y | String | 'Y' or 'N' | |
| voidable | y | String | 'Y' or 'N' | |
| status | y | Int | 0,1,2,9 | 0 = pending order, 1 = unknown, 2 = success, 9 = fail |
| recurringId | y | Int | recurring payment id this transaction belongs to | |
| paySuccTime | y | String | 2021-04-07 19:44:51 | |
| cardNum | n | String | 432567******2266 | |
| cardType | n | String | A = Amex D = Discover M = Mastercard N = Non-co-branded debit card V = Visa | |
| expiryDate | n | String | ||
| authNum | y | String | ||
| transNum | y | String | ||
| channel | y | String | CC_CARD or CC_ACH | CC_CARD: card transactions, CC_ACH: ACH transactions |