Direct Method

Direct method allows you to tokenize a card or make a purchase without any UI involved with just one api call.

Endpoint

https://api.grubpay.io/v4/auth

Method:

POST

Content-Type: application/json;charset=UTF-8

Direct Card Purchase

Prerequisite

In order to make requests to this api, it is required that :

  1. you are PCI compliant
    OR
  2. you have already tokenized a card

What is capture

Capture authorizes the transaction through to settlement and may be triggered during purchase request (see capture field in request below) or some time after the initial authorization is submitted via Capture api.

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Direct Purchaseopen in new window which may help you when going through the documentation.

Request
NameRequiredTypeSampleDescription
mchIdyString10000701assigned by GrubPay
mchOrderNoyString1234567890abcassigned by merchant
tokenn (y if card info not present)Stringassigned by GrubPay
cardNumn (y if token not present)String4223456789564532card number
expiryDaten (y if token not present)String0725format: MMYY
cvvn (y if token not present)String132card cvv
zipn (y if token not present)String71826card zip
amountyInt1500must > 0
currencyyString(3)USDfixed to: USD
loginNameyString(12)jack123merchant's login name
subjectnString(64)
bodynString(250)
channelyStringCC_CARDfixed to: CC_CARD
capturenStringY or N (default Y)specify Y to capture the transaction for settlement if approved
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retDatayJSONif retCode=SUCCESS, order detailed info returned
retData contains order information:
namerequiredtypesampledescription
payOrderIdyStringSUCCESS or FAIL
mchIdyString
mchOrderNonString
originalOrderIdnStringoriginal pay order id for refund
amountyInt100in cents
currencyyStringCAD
payTypeyStringpay or refund
refundableyInt100in cents
statusyInt0,1,2,90 = pending order, 1 = unknown, 2 = success, 9 = fail
recurringIdyIntrecurring payment id this transaction belongs to ( 0 if non-recurring)
paySuccTimeyString2021-04-07 19:44:51
cardNumyString432567******2266
cardTypeyStringA = Amex D = Discover M = Mastercard N = Non-co-branded debit card V = Visa
expiryDateyString
authNumyString
transNumyString
channelyStringCC_CARDfixed value:CC_CARD

Direct Card Tokenize

Prerequisite

In order to make requests to this api, it is required that you are PCI compliant

! Tip

After you receive access credentials (merchant id, login name, merchant key). You can step through the demo Direct Tokenizeopen in new window which may help you when going through the documentation.

Request
NameRequiredTypeSampleDescription
mchIdyString10000701assigned by GrubPay
cardNumyString4223456789564532card number
expiryDateyString0725format: MMYY
cvvyString786card cvv
zipyStringcard holder's zip
loginNameyString(12)jack123merchant's login name
channelyStringCC_CARDfixed to: CC_CARD
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retDatayJSONif retCode=SUCCESS, card detailed info returned along with token

retData contains following information:

NameRequiredTypeSampleDescription
cardNumyString478825*************1443card number
expiryDateyString0725format: MMYY
cvvyString786card cvv
zipyString12345card postal code
tokenyString(50)cf6e8f3f-c010-4b99-9a9f-32cf21ea7cb6reusable card token
panyString(50)896a38b73df44c2e0da633b4c3843b51primary account number; a unique identifier for card

Direct ACH Transfer

Tip

ACH transactions are automatically captured upon authorization

Request
NameRequiredTypeSampleDescription
mchIdyString10000701assigned by GrubPay
mchOrderNoyString1234567890abcassigned by merchant
tokenn (y if ACH account info not present)Stringassigned by GrubPay
namen (y if token not present)StringSmith Johnaccount holder name
accountTypen (y if token not present)StringECHKECHK - Electronic checking account, ESAV - Electronic savings account
routingNumn (y if token not present)String0310**503bank account routing number
accountNumn (y if token not present)String1234**798bank account number
amountyInt1500must > 0
currencyyString(3)USDfixed to: USD
loginNameyString(12)jack123merchant's login name
subjectnString(64)
bodynString(250)
channelyStringCC_ACHfixed to: CC_ACH
notifyUrlyString(200)http://sample.com/notifymerchant endpoint for receiving ACH transaction notifications, must be http or https
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retDatayJSONif retCode=SUCCESS, order detailed info returned
retData contains order information:
namerequiredtypesampledescription
payOrderIdyStringAC20221208005200944617628872
mchIdyString
mchOrderNoyString
tokenyStringcf6e8f3f-c010-4b99-9a9f-32cf21ea7cb6reusable card token
acctNumyString031000*********6798provided account number
originalOrderIdnStringoriginal pay order id if payType="refund"
amountyInt100in cents
currencyyStringCAD
payTypeyString"pay" or "refund"
refundableyInt100in cents
statusyInt0,1,2,90 = pending order, 1 = unknown, 2 = success, 9 = fail
recurringIdyIntrecurring payment id this transaction belongs to
paySuccTimeyString2021-04-07 19:44:51
authNumyString
transNumyString
signyStringC380BEC2BFD727A4B6845133519F3AD6Sign algorithm

Direct ACH Tokenize

Note

Please be aware that this function requires a different API endpoint URL as for now.

Note that this operation may incur a fee of $1.

You can alternatively obtain an ACH token as part of retData following a successful ACH transfer.

Endpoint

https://api.grubpay.io/v4/ach_tokenize

Method:

POST

Header

Content-Type: application/json;charset=UTF-8

Request
NameRequiredTypeSampleDescription
mchIdyString10000701assigned by GrubPay
routingNumyString0310**503bank account routing number
accountNumyString1234**798bank account number
accountTypeyStringECHKECHK - Electronic checking account, ESAV - Electronic savings account
nameyStringSmith Johnaccount holder name
loginNameyString(12)jack123merchant's login name
channelyStringCC_ACHfixed to: CC_ACH
signyString(32)C380BEC2BFD727A4B6845133519F3AD6Sign algorithm
Response
namerequiredtypesampledescription
retCodeyStringSUCCESS or FAIL
retMsgyString
retDatayJSONif retCode=SUCCESS, card detailed info returned along with token

retData contains following information:

NameRequiredTypeSampleDescription
routingNumyString0310**503bank account routing number
accountNumyString1234**798bank account number
accountTypeyStringECHKECHK - Electronic checking account, ESAV - Electronic savings account
nameyStringSmith Johnaccount holder name
tokenyString(50)cf6e8f3f-c010-4b99-9a9f-32cf21ea7cb6reusable ACH account token
Last Updated:
Contributors: Grant, grant, Howard, Edward Yuan, Grant, Grant Yao, H