Product Overview
Through the Institution API, institutions can:- Create and manage customer sub-accounts
- Execute transactions on behalf of customers
- Manage multi-currency operations
- Reconcile balances and ledgers
- Build integrated payment solutions
Supported Capabilities
| Capability | Description | Typical API / Module |
|---|---|---|
| Acquiring / Collection | Create orders on behalf of a sub-account | Hosted checkout, address order, Web/QR order, order query/close |
| Swap / Conversion | Convert currencies on behalf of a sub-account | Currency query, pair query, preview, create, order query |
| Payout / Withdrawal | Make outbound settlements on behalf of a sub-account | Payout create, payout detail |
| Queries | Query sub-account balances, ledger records, order lists | Balance, bill, order query |
| Intra-system fund movement | Use charge/transfer for internal fund movement | Transfer, charge |
Core Concepts
Key Definitions
| Concept | Definition |
|---|---|
| Institution Account | The institution’s master account in GatePay |
| Sub-account | An account created by the institution for its customer (account_id) |
| Customer ID | The customer’s unique identifier on the institution platform (customer_id) |
| Display Name | Human-readable display name of the sub-account (display_name) |
| Account Holder | Identity information of the sub-account holder (account_holder) |
| Request ID | Institution request unique ID for idempotency and reconciliation (request_id) |
Charge vs. Transfer
| Type | Direction | Typical Scenario | API |
|---|---|---|---|
| transfer | Institution → sub-account | Subsidy, settlement distribution, platform rebate | POST /transfer/open/institution/v1/pay/transfer |
| charge | Sub-account → institution | Platform commission, service-fee deduction, funds sweep | POST /transfer/open/institution/v1/pay/charge |
merchantBatchNo identifiers.
Delegated Requests and Proxy Headers
X-GatePay-On-Behalf-Of Header
For APIs that require delegated calls (operations on behalf of a sub-account), the request must include theX-GatePay-On-Behalf-Of header with the value being the account ID of the delegated subject.
When to use:
- Creating orders on behalf of a sub-account
- Querying a sub-account’s balances
- Executing transfers or charges involving a sub-account
- Managing payouts for a sub-account
General Integration Requirements
Common Request Headers
All Institution API requests must include the following headers. For signing and signature verification details, see Authentication & Security.| Header | Required | Description |
|---|---|---|
X-GatePay-Certificate-ClientId | Yes | ClientId assigned after the institution registers an app |
X-GatePay-Timestamp | Yes | UTC timestamp in milliseconds; requests with time drift exceeding 10 seconds will be rejected |
X-GatePay-Nonce | Yes | Random string; recommended length within 32 characters |
X-GatePay-Signature | Yes | HMAC-SHA256 request signature (see authentication guide) |
X-GatePay-On-Behalf-Of | Conditional | Required for delegated calls; value is the sub-account ID or institution master ID |
Idempotency and Retry Strategy
Implement request deduplication based on the appropriate unique identifier for each operation type.| Scenario | Idempotency Key | Field Name | Purpose |
|---|---|---|---|
| Create sub-account | request_id | request_id | Prevent duplicate account creation |
| Transfer / Charge | merchantBatchNo | merchantBatchNo | Prevent duplicate fund movements |
| Payout batch | batch_id | batch_id | Prevent duplicate payout batches |
| Payout sub-order | merchant_withdraw_id | merchant_withdraw_id | Prevent duplicate payout entries |
| Refund | refundRequestId | refundRequestId | Prevent duplicate refunds |
| Swap | clientReqId | clientReqId | Prevent duplicate conversions |
Typical Interaction Flows
Create Sub-account with Callback
- Initial response indicates request acceptance, not final status
- Final status arrives via callback notification
- Use
request_idto ensure idempotency across retries
Sub-account Collection with Query Fallback
Implementation Guide
Pre-integration Checklist
Complete these items before beginning integration:| Item | Description | Deliverable |
|---|---|---|
| Register app and obtain ClientId | Required for request authentication | ClientId credential |
| Implement signing algorithm | Required to generate request signatures | HMAC-SHA256 implementation |
| Timestamp and nonce handling | Timestamp in UTC milliseconds; nonce within 32 characters | Request header generation logic |
| Define delegated-subject routing | Plan which requests use institution master vs. On-Behalf-Of | Integration routing table |
| Implement callback verification | All callbacks follow signature verification | Callback validation logic |
| Idempotency and retry strategy | Persist request_id, merchantBatchNo, etc. | Deduplication layer |
Account Management Module
Create Sub-account
Endpoint:POST /merchant/open/institution/v1/accounts/create
Creates a new sub-account for a customer under the institution’s master account.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
request_id | string | Yes | Unique institution request ID for idempotency |
customer_id | string | Yes | Customer’s unique identifier on the institution platform |
display_name | string | Yes | Human-readable display name for the sub-account |
account_holder | object | Yes | Identity and compliance information (see below) |
Account Holder Object
| Field | Type | Required | Description |
|---|---|---|---|
entity_country | string | Yes | ISO 3166-1 alpha-2 country code |
entity_type | string | Yes | INDIVIDUAL or BUSINESS |
entity_id_type | string | Conditional | ID type (e.g., passport, driver’s license) |
entity_id_number | string | Conditional | ID number |
entity_id_expiry | date | Conditional | ID expiration date (YYYY-MM-DD) |
dob | date | Conditional | Date of birth (YYYY-MM-DD); required when entity_type=INDIVIDUAL |
merchant_category | string | Yes | Merchant category enumeration |
user_agreement | boolean | Yes | Whether the user accepted the service agreement |
address | object | Yes | Subject’s address with street, city, state, zip, country |
Response Fields
| Field | Type | Description |
|---|---|---|
account_id | string | Unique sub-account ID (used in X-GatePay-On-Behalf-Of for delegation) |
status | string | Account status: INIT, PENDING, ACTIVE, or FAILED |
request_id | string | Echoed from request |
Sub-account Status Lifecycle
| Status | Meaning |
|---|---|
INIT | Account initialized; awaiting compliance review |
PENDING | Under review by GatePay compliance team |
ACTIVE | Account approved and ready for use |
FAILED | Account approval rejected; see callback for failure reason |
Update Sub-account
Endpoint:POST /merchant/open/institution/v1/accounts/update
Updates sub-account information. This operation performs an overwrite update.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
account_id | string | Yes | Sub-account ID to update (also in X-GatePay-On-Behalf-Of header) |
display_name | string | No | Updated display name |
account_holder | object | No | Updated account holder information |
Request Headers
| Header | Value | Description |
|---|---|---|
X-GatePay-On-Behalf-Of | account_id | Sub-account ID being updated |
Query Sub-account
Endpoint:GET /merchant/open/institution/v1/accounts/query
Queries a single sub-account by ID or request ID.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
request_id | string | Conditional | Institution request ID from creation |
account_id | string | Conditional | Sub-account ID |
Response Fields
| Field | Type | Description |
|---|---|---|
account_id | string | Sub-account ID |
customer_id | string | Customer ID |
display_name | string | Display name |
status | string | Current account status |
account_holder | object | Account holder information |
created_at | timestamp | Account creation timestamp |
List Sub-accounts
Endpoint:GET /merchant/open/institution/v1/accounts/list
Lists sub-accounts with pagination support.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
cursor | string | No | Pagination cursor (start from 1) |
limit | integer | No | Number of results per page (default 20, max 100) |
status | string | No | Filter by account status |
Finance Module
Query Balance
Endpoint:POST /payment/open/institution/v1/balance
Retrieves current balance for the institution or a delegated sub-account by currency.
Request Body
Provide an array of currency codes:Response Fields
| Field | Type | Description |
|---|---|---|
currency | string | Currency code |
available | string | Available balance |
hold | string | Held amount (in pending orders/payouts) |
total | string | Total balance (available + hold) |
Query Funds Ledger
Endpoint:GET /payment/open/institution/v1/pay/bill/orderlist
Queries fund movement records (ledger entries) for reconciliation and audit purposes.
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
start_time | timestamp | No | Start of time range (milliseconds) |
end_time | timestamp | No | End of time range (milliseconds) |
page | integer | No | Page number (1-indexed) |
limit | integer | No | Records per page |
currency | string | No | Filter by currency |
type | string | No | Filter by transaction type |
Response Fields
| Field | Type | Description |
|---|---|---|
ledger_id | string | Unique ledger identifier |
type | string | Transaction type (deposit, payout, transfer, etc.) |
currency | string | Currency of the transaction |
amount | string | Transaction amount |
balance_after | string | Balance after transaction |
business_id | string | Related order/batch ID |
created_at | timestamp | Transaction timestamp |
Order Management Module
Hosted Checkout Order
Endpoint:POST /payment/open/institution/v1/pay/checkout/order
Creates a hosted checkout order on behalf of a sub-account. Customers are redirected to a GatePay-hosted payment page.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
merchant_order_no | string | Yes | Merchant-generated unique order number |
amount | string | Yes | Order amount in smallest unit (satoshis, cents, etc.) |
currency | string | Yes | Settlement currency |
pay_currency | string | No | Currency customer pays in (if different from settlement) |
description | string | No | Order description |
return_url | string | No | URL to redirect after payment completion |
notify_url | string | No | Webhook URL for payment notifications |
Response Fields
| Field | Type | Description |
|---|---|---|
prepayId | string | Unique payment request ID |
location | string | Redirect URL to GatePay checkout page |
qrContent | string | QR code content for mobile payment |
payCurrency | string | Currency customer will pay in |
payAmount | string | Amount customer will pay |
chain | string | Blockchain chain (if cryptocurrency) |
address | string | Payment address for direct transfer |
fullCurrType | string | Full currency type identifier |
Address Order
Endpoint:POST /payment/open/institution/v1/pay/address/create
Creates a static address payment order.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
merchant_order_no | string | Yes | Unique order number |
currency | string | Yes | Payment currency |
amount | string | Yes | Payment amount |
orderExpireTime | timestamp | Yes | Order expiration time (Unix seconds) |
notify_url | string | No | Webhook URL |
Web & QR Order
Endpoint:POST /payment/open/institution/v1/pay/transactions/native
Creates a Web or QR code pending order for native wallet payments.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Query Order
Endpoint:POST /payment/open/institution/v1/pay/order/query
Queries the status and details of an existing order.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
orderId | string | Conditional | GatePay order ID |
merchant_order_no | string | Conditional | Merchant order number |
Close Order
Endpoint:POST /payment/open/institution/v1/pay/order/close
Closes an open order to prevent further payments.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Static Collection Address Management
For direct cryptocurrency payments, manage static collection addresses:| Capability | Endpoint | Method |
|---|---|---|
| Query supported chains | GET /merchant/open/institution/v1/pay/fixedaddress/chains | GET |
| Create / update address | POST /merchant/open/institution/v1/pay/fixedaddress/save | POST |
| List addresses | GET /merchant/open/institution/v1/pay/fixedaddress/list | GET |
| Get address details | GET /merchant/open/institution/v1/pay/fixedaddress/detail | GET |
| Delete address | DELETE /merchant/open/institution/v1/pay/fixedaddress/delete | DELETE |
| Query collection ledger | GET /payment/open/institution/v1/pay/fixedaddress/order/query | GET |
Payout & Withdrawal Module
Create and manage outbound settlements for sub-accounts.Create Payout
Endpoint:POST /withdraw/open/institution/v1/pay/create/payouts
Creates a payout request on behalf of a sub-account.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
batch_id | string | Yes | Batch identifier for idempotency |
merchant_withdraw_id | string | Yes | Unique withdrawal ID |
currency | string | Yes | Payout currency |
amount | string | Yes | Payout amount |
address | string | Yes | Recipient blockchain address |
network | string | Yes | Blockchain network |
Payout Detail
Endpoint:POST /withdraw/open/institution/v1/pay/payouts/detail
Queries detailed information about a payout.
Transfer & Charge Module
Transfer (Institution → Sub-account)
Endpoint:POST /transfer/open/institution/v1/pay/transfer
Transfers funds from the institution account to a sub-account.
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
merchantBatchNo | string | Yes | Unique batch number for idempotency |
currency | string | Yes | Transfer currency |
amount | string | Yes | Transfer amount |
account_id | string | Yes | Recipient sub-account ID |
Query Transfer
Endpoint:GET /transfer/open/institution/v1/pay/transfer/detail
Charge (Sub-account → Institution)
Endpoint:POST /transfer/open/institution/v1/pay/charge
Deducts funds from a sub-account (e.g., commission or service fees).
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
merchantBatchNo | string | Yes | Unique batch number for idempotency |
currency | string | Yes | Charge currency |
amount | string | Yes | Charge amount |
Query Charge
Endpoint:GET /transfer/open/institution/v1/pay/charges/detail
Refund Module
Create Refund
Endpoint:POST /payment/open/institution/v2/standard/order/refund
Refunds a previous payment order.
Request Headers
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Request Parameters
| Field | Type | Required | Description |
|---|---|---|---|
refundRequestId | string | Yes | Unique refund ID for idempotency |
orderId | string | Conditional | GatePay order ID |
merchant_order_no | string | Conditional | Merchant order number |
amount | string | No | Partial refund amount (full if omitted) |
Query Refund Detail
Endpoint:GET /payment/open/institution/v2/pay/refund/details
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
refundRequestId | string | Yes | Refund ID from creation |
Currency Conversion Module
Convert currencies on behalf of a sub-account. For detailed swap procedures, see Currency Conversion & Swap.| Step | Endpoint | Method |
|---|---|---|
| Query available currencies | GET /transfer/open/institution/v1/pay/convert/currency?side=buy/sell | GET |
| Query available pairs | GET /transfer/open/institution/v1/pay/convert/pair?currency=...&side=... | GET |
| Get quote preview | POST /transfer/open/institution/v1/pay/convert/preview | POST |
| Create swap order | POST /transfer/open/institution/v1/pay/convert | POST |
| Query swap order | GET /transfer/open/institution/v1/pay/convert/order?orderId=... | GET |
Request Headers (for swap operations)
| Header | Value |
|---|---|
X-GatePay-On-Behalf-Of | sub-account_id |
Common Error Codes
Account Management
| Error Code | Description | Resolution |
|---|---|---|
400001 | Invalid request parameters | Verify all required fields and data types |
400002 | Invalid signature | Check signing algorithm and secret key |
400003 | Request timestamp expired | Ensure system clock is synchronized; time drift must be < 10 seconds |
550226 | request_id already used to create sub-account | Idempotency: return previous result or handle gracefully |
550227 | No matching sub-account found | Verify account_id or request_id is correct |
Orders & Delegation
| Error Code | Description | Resolution |
|---|---|---|
550142 | Missing X-GatePay-On-Behalf-Of header | Verify delegated subject header is present and correct |
550200 | Master account has no delegation permission | Enable delegation permission in GatePay settings |
550201 | Asset balance currency not found | Use correct currency code; verify account has balance in that currency |
Integration Best Practices
Recommended Architecture
| Layer | Recommendation | Details |
|---|---|---|
| API Client | Encapsulate common headers | Build middleware for timestamp, nonce, signature, on-behalf-of |
| Idempotency | Persist idempotency keys | Store request_id, merchantBatchNo, refundRequestId, clientReqId in database |
| Callback Processing | Unified callback entry | Verify signature, check idempotency, advance state machine, return SUCCESS |
| Query Fallback | Build query APIs | Implement fallback for orders, refunds, transfers, payouts, ledger |
| Observability | Monitor critical paths | Alert on callback failures, signature errors, timestamp expiry, PENDING timeouts |
Callback Implementation
- Implement a single callback receiver endpoint
- Verify request signature against
X-GatePay-Signature - Check idempotency using relevant IDs (request_id, account_id, batch_id, etc.)
- Update database state machine
- Return HTTP 200 with body
{"code": "SUCCESS"}to confirm receipt

