Skip to main content

Documentation Index

Fetch the complete documentation index at: https://doc.haipay.net/llms.txt

Use this file to discover all available pages before exploring further.

1. Account Inquiry

Brief Description:
  • Query the balance of the account corresponding to the current business.
URL: The currency is a path parameter, which should be replaced by the currency you want to query, for example, for USD: /usd/account/ledger. Currencies use the international standard code, three-letter uppercase code, refer to: Wikipedia-ISO_4217 /{currency}/account/ledger Parameters:
ParameterRequiredTypeDescription
appIdYesLongBusiness ID (obtained from the backend, must pass the corresponding business ID based on the currency in the URL)
signYesStringSignature
Response Data:
ParameterTypeDescription
balStringAccount balance
availableBalStringAvailable amount
frzBalStringFrozen amount
unSettleBalStringAmount awaiting settlement
signStringSignature

2. Asynchronous Notification

Brief Description:
  • When the customer’s collection is successful or failed, we will push the order status. If the first notification fails, it will retry every 5 minutes, up to 5 times.
URL: Your provided URL, Please configure it in HaiPay’s backend or pass it in the request parameters.
Strongly Recommended
To ensure the extensibility and compatibility of the interface, please follow the callback parameters reception method outlined below:
  1. Do not declare a specific POJO object to receive callback parameters.
  2. Must use a generic data structure (like JSONObject, Map, etc.) to parse parameters.
  3. This design ensures that if we later extend the callback fields, it will not affect your signature verification logic.
Reason: Keeping a loosely coupled design can prevent signature verification failures due to the addition or removal of fields.
Collection Callback Parameters:
ParameterTypeDescription
appIdLongBusiness ID
currencyStringCurrency
orderIdStringMerchant order ID
orderNoStringPlatform order ID
amountStringAmount collected this time
feeStringFee amount
statusIntegerStatus (2: Success(Final), 3: Failure(Final), 4: Partial Collection(Final), 5: Excess Collection(Final)).
payTimeStringPayment success time (present when status=2, 4, 5) (Local time), format: yyyy-MM-dd HH:mm:ss
errorMsgStringPayment failure reason (present when status=3)
originalCurrencyStringOriginal order currency, may be empty, only present when currency conversion is involved
originalAmountStringOriginal order amount, may be empty, only present when currency conversion is involved
inBankCodeStringPayment method used by the user, refer to each region’s documentation, may be empty
bankNoStringReceiving account, may be empty
descriptionStringPayment note, may be empty
cardNoStringPayment card number, credit card payments typically display the first six and last four digits, while ApplePay and GooglePay show only the last four digits, which may be blank
tokenIDStringPayment token, for MIT mode transactions, may be empty
nameStringUser name, may be empty
emailStringUser email, present for MIT mode transactions
expMonthStringPayment card expiration month, may be empty
expYearStringPayment card expiration year, may be empty
ipStringUser IP, may be empty
is3DSStringWhether 3DS payment is required, true indicates yes, false indicates no, but it only represents whether the bank recommends 3DS payment, not whether 3DS payment was actually used, may be empty
signStringSignature, (Must use the business secret key for the currency for verification)
Payout Callback Parameters:
ParameterTypeDescription
appIdLongBusiness ID
currencyStringCurrency
orderIdStringMerchant order ID
orderNoStringPlatform order ID
amountStringAmount collected this time
feeStringFee amount
statusIntegerStatus (2: Success(Final), 3: Failure(Final))
payTimeStringPayment success time (present when status=2)(Local time), format: yyyy-MM-dd HH:mm:ss
errorMsgStringPayment failure reason (present when status=3)
hashStringTransaction hash
signStringSignature, (Must use the business secret for the currency for verification)
Collection Link Order Callback Parameters:
ParameterTypeDescription
appIdLongBusiness ID
currencyStringCurrency
orderIdStringMerchant order ID
orderNoStringPlatform order ID
amountStringAmount collected this time
feeStringFee amount
statusIntegerStatus (2: Success(Final), 3: Failure(Final), 4: Partial Collection(Final), 5: Excess Collection(Final)).
payTimeStringPayment success time (present when status=2, 4, 5), format: yyyy-MM-dd HH:mm:ss
errorMsgStringPayment failure reason (present when status=3)
originalCurrencyStringOriginal order currency, may be empty, only present when currency conversion is involved
originalAmountStringOriginal order amount, may be empty, only present when currency conversion is involved
inBankCodeStringPayment method used by the user, refer to each region’s documentation, may be empty
bankNoStringReceiving account, may be empty
descriptionStringPayment note, may be empty
cardNoStringLast four digits of the payment card number , may be empty
createTimeStringOrder creation time (Local time), format: yyyy-MM-dd HH:mm:ss
linkNoStringCollection link number
linkNameStringCollection link name
agentIdLongAgent ID (empty if there’s no agent)
emailStringPayer’s email (from the collection link page, random email if not filled)
nameStringPayer’s nickname (from the collection link page)
subjectStringNote (filled in the collection link page, randomly generated if not filled)
signStringSignature, (Must use the business secret for the currency for verification)
Note: After receiving the webhook event, please return HTTP Status Code 200 when the business process succeeds to indicate that the notification was received successfully. Otherwise, the system will consider the notification failed and retry up to 5 times. Description:
  • The file format is the same as the one exported from the merchant backend. The data for the day will be generated the next day after 1:00 PM.
URL: /common/document/download Parameters:
ParameterRequiredTypeDescription
appIdYesLongBusiness ID (obtained from the backend)
typeYesLongType: 15 for payout orders, 20 for collection orders, 40 for fund flow data
dateYesStringDate, format: yyyyMMdd
signYesStringSignature
Response Data:
ParameterTypeDescription
appIdLongBusiness ID (obtained from the backend)
typeLongType: 15 for payout orders, 20 for collection orders, 40 for fund flow data
dateStringDate, format: yyyyMMdd
fileUrlStringFile download URL
expiredStringExpiry time, 1 hour
signStringSignature

Field Descriptions

Collection

  • Error: Collection exception
  • Not Started: Not started
  • Paying: Collecting
  • Success: Collection successful
  • Failed: Collection failed
  • Payment Part Success: Partial collection
  • Payment Excess Success: Excess collection

Payout

  • Submit Error: Submission exception
  • Error: Payout exception
  • Not Started: Not started
  • Pending: Payout in progress
  • Success: Payout successful
  • Failed: Payout failed

Notification Status

  • Not Start: Not notified
  • Success: Notification successful
  • Failed: Notification failed
  • Error: Notification exception

Settlement Status

  • Error: Exception pending confirmation
  • Not Start: Not started
  • Settling: Settling
  • Success: Settlement successful
  • Settlement Failed (Reversed): Settlement failed (reversed)

4. Payout Order Voucher

URL: /common/voucher Parameters:
ParameterRequiredTypeDescription
appIdYesLongBusiness ID (obtained from the backend)
orderNoYesLongPlatform order ID
signYesStringSignature
Response Data:
  • The base64 encoded image of the voucher.

5. Real-Time Exchange Rate Query

Description:
  • Query exchange rates for converting USD to other currencies, only USD settlement payment methods are supported
URL: /common/quote/v1/exchange-rate Parameters:
Parameter NameRequiredTypeDescription
appIdYesLongBusiness ID (obtained from the admin console)
sourceCurrencyYesStringSource currency (USD)
targetCurrencyYesStringTarget currency
payTypeNoStringPayment type
inBankCodeNoStringPayment method
signYesStringSignature
Return data parameter description
Parameter NameTypeDescription
sourceCurrencyStringSource currency (USD)
targetCurrencyStringTarget currency
payTypeStringPayment type
inBankCodeStringPayment method
exchangeRateStringExchange rate
signStringSignature
Last modified on May 26, 2026