tokenID) after the cardholder completes an initial on-session (CIT) payment and authorization. It is ideal for usage-based billing, auto top-ups, installments, and merchant-scheduled recurring billing.
Two-Phase Integration Flow
1
Phase 1: Initial Transaction (On-Session Authorization & First Charge to Obtain tokenID)
- Your backend calls MIT Collection Apply
POST /usd/mit/applywithout passingtokenID. - Use the returned
payUrl(Checkout Mode) orclientToken(Component Mode withmode: 'payment') so the shopper completes the first payment and authentication on-session. - Upon payment success, HaiPay sends an asynchronous webhook to
notifyUrlcontaining thetokenIDbound to the user and card. Securely store the mapping betweentokenIDandpartnerUserId.
2
Phase 2: Subsequent Transactions (Off-Session Merchant-Initiated Charges)
- Whenever a charge condition is met, your backend calls
POST /usd/mit/applyagain, passing the storedtokenID(along with the samepartnerUserId). - HaiPay validates the
tokenID, executes the off-session charge directly, and notifies yournotifyUrlasynchronously (you can also query status via/usd/collect/query).
MIT-Specific Parameters
In addition to standard collection parameters,/usd/mit/apply includes the following fields:
Request Examples (POST /usd/mit/apply)
- Phase 1: Initial Card-Saving Charge (omit tokenID)
- Phase 2: Subsequent Off-Session Charge (pass tokenID)
Payment Types, Codes & Limits
Single-transaction limits for MIT are 0.99 – 1000 USD:Mutual Exclusivity between
inBankCode and paymentMethods:- Pass
inBankCodewhen specifying a single payment method (leavepaymentMethodsempty). - Pass
paymentMethods(comma-separated, e.g.,"GOOGLE_PAY,CREDIT_CARD") to dynamically control which payment methods are displayed and their top-to-bottom display order (leaveinBankCodeempty). For example, passing"GOOGLE_PAY,CREDIT_CARD"displays only Google Pay followed by Credit Card from top to bottom. - This dynamic display and ordering capability also maps to the Global Cashier.
Core API Reference
For full field specifications, response schemas, and live debugging, visit the API Reference:MIT Collection Apply
POST /usd/mit/apply — Initiate initial authorization or subsequent off-session charges.Collection Order Query
POST /usd/collect/query — Query the final status of an MIT order.Refund Apply & Query
POST /usd/refund/apply — Issue full or partial refunds for completed MIT charges.
