Menu
API Integration

One Integration for
Global Payments

Flexible APIs, diverse payment methods, and transparent fees to power global expansion.

API integration example
500+Merchants using API integration
10M+Transactions processed daily
150+ payment methodsAccessible through HaiPay's global payment network

Not only acquiring,
but also global payouts.

Unified collection and payout to avoid high FX conversion costs and reduce exchange‑rate risks.
For businesses managing multi‑currency funds, the API-based treasury model is an ideal choice.

One API covers global credit card acquiring and global mass payouts.

Business Outcome
Mobile AppMobile App
Official WebsiteOfficial Website
POS TerminalPOS Terminal
Card Payment
Card Payment
Card Payment
Wallet Payment
Wallet Payment
Wallet Payment
Bank Transfer
Bank Transfer
Balance
USD
USD
52,369.20
EUR
EUR
8,637.03
HKD
HKD
200.00
GBP
GBP
10.00
Multi‑Currency Accounts
Card Payment
Card Payment
Card Payment
Wallet Payment
Wallet Payment
Wallet Payment
Bank Transfer
Bank Transfer
Sample Co.
Sample Co.United States
1,000.00 USD
United States
Demo Studio
Demo StudioHong Kong SAR
3,300.00 USD
Hong Kong SAR
Template Lab
Template LabSingapore
5,000.00 USD
Singapore
Recipients

What Makes HaiPay Different

Multi‑currency Settlement

Multi‑currency Settlement

Settle and pay directly in local currencies. Use your account balance for fund settlement to avoid unnecessary foreign‑exchange fees.

Internal Balance Transfer

Internal Balance Transfer

Transfer funds seamlessly between internal accounts. Move balance from Account A to Account B to enable shared liquidity across teams or business units.

One‑stop Fund Management

One‑stop Fund Management

Manage all acquiring funds through the HaiPay management plugin, with full visibility and traceability for every transaction.

Our Operational Capabilities

A wide range of operational channels to support business growth.

Global Collection Capabilities

Global Collection Capabilities

Credit card acquiring
Apple Pay & Google Pay acquiring
Bank transfer collection
Over-the-counter (OTC) collection
QR code payment collection
Global Payout Capabilities

Global Payout Capabilities

Local e-wallet payouts
Local bank card payouts
System Management Capabilities

System Management Capabilities

API reconciliation
24/7 dedicated support
Infrastructure routing system
Custom risk-control system
Exchange rate management

Banking or fintech? See our payment solutions for financial institutions.

For endpoint and callback details, use the Common API reference. For implementation planning, read the payment API integration guide and payment gateway integration guide.

Developer Reference

Developer Architecture & Integration Workflow

Standardized REST endpoints, 2048-bit SHA256WithRSA mutual signing, automated webhook retries, and an isolated UAT sandbox for end-to-end payment and payout integration.

4-Stage Integration Lifecycle

  1. 01HTTPS / JSON

    Credentials & RSA Keys

    Obtain currency-paired appId credentials in the Merchant Portal, configure IP whitelists and callback URLs, and upload your 2048-bit RSA public key.

  2. 02HTTPS / JSON

    Sign & Submit Request

    Sort non-empty payload parameters alphabetically (excluding sign and sign_type), append your merchant secret key, sign with SHA256WithRSA, and POST over HTTPS (TLS 1.2/1.3).

  3. 03HTTPS / JSON

    Verify Sync & Webhook Events

    Validate the platform signature on synchronous responses and asynchronous callbacks (status 2/3/4/5). Return HTTP 200 to acknowledge webhook delivery.

  4. 04HTTPS / JSON

    UAT Testing & Reconciliation

    Simulate order state transitions and manual callbacks in the UAT environment before switching keys to production and pulling daily statement files.

Core REST Endpoints & Operations

All requests use HTTPS POST with UTF-8 application/json payloads and currency-scoped paths.

UAT Host: https://uat-interface.haipay.asia
HaiPay core REST API endpoints for collections, payouts, refunds, balance inquiry, and reconciliation
Endpoint PathAPI OperationIntegration ModeTechnical Behavior & Payload Notes
POST /{currency}/collect/applyCollection ApplyGlobal Cashier / Local Cashier / Direct API / CardCreates a pay-in order and synchronously returns redirect URLs, QR payloads, or direct payment parameters.
POST /{currency}/collect/queryCollection QueryPay-in Status InquiryQueries real-time collection status when network timeouts or system codes (1003/1004) occur.
POST /{currency}/pay/applyDisbursement ApplyGlobal Payout APIInitiates single or batch payouts to local bank accounts and e-wallets using currency-matched appId.
POST /{currency}/pay/queryDisbursement QueryPayout Status InquiryRetrieves payout execution status (status=2 success, status=3 failure) and upstream failure reasons.
POST /{currency}/refund/applyRefund ApplyCard & Supported ChannelsSubmits full or partial refund requests against settled collection orders with signature verification.
POST /{currency}/account/ledgerAccount Balance InquiryMulti-Currency TreasuryReturns total balance (bal), available balance (availableBal), frozen (frzBal), and unsettled funds (unSettleBal).
POST /common/document/downloadStatement File RetrievalAutomated ReconciliationDownloads daily statement links (type 20 collection, 15 payout, 40 details), generated after 13:00 next day.
SHA256WithRSA · TLS 1.2/1.3

Authentication & Mutual Signing

  • Each appId and secret key pair is isolated by currency and separated between UAT test and production environments.
  • Requests are signed with your 2048-bit RSA private key over alphabetically sorted non-empty fields; responses and webhooks are verified using HaiPay's public key.
  • Production API calls require dual IP whitelisting in both the Merchant Portal and HaiPay firewall.
Retry 5m × 5 · HTTP 200 Ack

Asynchronous Webhooks & Idempotency

  • Pushes final order state changes: status=2 (Success), status=3 (Failure with errorMsg), status=4 (Partial), and status=5 (Excess).
  • If the first webhook delivery does not receive HTTP 200, HaiPay automatically retries every 5 minutes up to 5 times.
  • Parse webhook payloads with a generic Map or JSONObject rather than a rigid POJO so future field extensions never break signature verification.
UAT Sandbox · Status Simulation

Sandbox Testing & Error Diagnostics

  • Dedicated UAT endpoint (https://uat-interface.haipay.asia) completely isolated from production accounts and funds.
  • Self-service state simulation in Merchant Portal (Transaction Records → Collection / Disbursement Orders) to modify test order status and trigger manual webhooks.
  • Standardized error codes: 00000000 (OK), 1001/1002 (Param Error), 1003/1004 (System Busy — query or await callback), 4005 (Duplicate Order), 4016 (Insufficient Balance), 4031 (IP Forbidden).
Components · Frontend Components

Frontend Components — Drop-in UI components for embedded card fields and streamlined PCI scope.

A dedicated integration mode for card payments and Apple Pay, allowing users to enter payment information directly on the merchant's checkout page for a smooth, one-click payment experience.

  • In-page card inputs; redirect-based local wallets authenticate via provider app/page
  • Web and mobile integration guides available in API documentation

FAQ

  • A payment gateway API is the set of secure endpoints your code calls to authorize, capture, refund and reconcile payments, without handling raw card data yourself. HaiPay's REST API covers both pay-ins and payouts in one integration, with SDKs, webhooks and a sandbox.

  • Typical flow: create sandbox credentials, install the SDK or call the REST endpoints, build the payment request and webhook handlers, run test transactions, then switch to production keys. Hosted checkout or payment links need little to no code if you want to launch faster.

  • The API itself is usually free — providers charge per transaction, not for access. Your real costs are transaction fees plus engineering time, which depends on the integration depth: payment links and hosted checkout are near zero-code, full API integration takes the most effort.

  • Yes. HaiPay exposes global collection and global payout capabilities through the same API and account, including internal balance transfers between them — so funds collected from customers can fund supplier or creator payouts without leaving the platform.

  • Transactions are collected in the shopper's currency, and balances can be held, converted and settled across multiple currencies from one account. The API and dashboard give a unified view for reconciliation across markets.

  • Yes. HaiPay provides a sandbox with test credentials, simulated payment states and webhook events, so you can verify the full payment and payout lifecycle before going live.

Ready to sell where your buyers already pay?

Tell us your markets, methods and volume. We map the payment stack and come back with a written quote.

Or compare our payment gateway pricing.