Refund Transaction
Tip
Restores all or part of the funds from an settled transaction to the cardholder's card. If the transaction is not yet settled, please please refer to Void. Unlike Void, after a Refund there is a record of both the initial charge and the refund on the cardholder's statement.
! Tip
After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Refund which may help you when going through the documentation.
Endpoint
https://api.grubpay.io/v4/refund
Method:
POST
Header
Content-Type: application/json;charset=UTF-8
Request
name | required | type | sample | description |
---|---|---|---|---|
mchId | y | String | 10000701 | assigned by GrubPay |
loginName | y | String(12) | jack_chen | assigned by merchant,equals to jobNo |
refundAmount | y | Int | 100 | in cents |
payOrderId | y | String | ||
sign | y | String(32) | C380BEC2BFD727A4B6845133519F3AD6 | Sign algorithm |
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 | SUCCESS or FAIL | |
mchId | y | String | ||
mchOrderNo | n | String | ||
originalOrderId | n | String | original pay order id for refund | |
amount | y | Int | 100 | in cents |
currency | y | String | CAD | |
payType | y | String | pay or refund | |
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 ( 0 if non-recurring) | |
paySuccTime | y | String | 2021-04-07 19:44:51 | |
cardNum | y | String | 432567******2266 | |
cardType | y | String | ||
expiryDate | y | String | ||
authNum | y | String | ||
transNum | y | String | ||
channel | y | String | CC_CARD or CC_ACH | CC_CARD: card transactions, CC_ACH: ACH transactions |