FlashPay API Documentation
This document defines the common communication, identification, key, signature, and callback rules for merchants integrating with the platform APIs. Endpoint URLs, request fields, and business states are defined in the corresponding API documents.
Service base URL: https://pay.flashpay.fit
Quick integration flow
- Create or obtain an application in Merchant Center, and record the merchant number
mchNoand application IDappId. - Generate an RSA key pair on the merchant side: a merchant private key and a merchant public key.
- Upload the merchant public key in Merchant Center > Application Management > Modify. Keep the merchant private key only in the merchant's secure environment.
- Obtain the platform public key from the application details and configure it in the merchant system to verify platform responses and callbacks.
- Build the request according to the API document, sign it with the merchant private key, add
sign, and call the platform API. - Verify synchronous responses and asynchronous callbacks with the platform public key. After a callback is verified and processed, return
SUCCESS.
PayIn flow
Flow details:
- The user submits a PayIn request to the merchant.
- The merchant calls
POST /api/pay/unifiedOrder. - FlashPay returns
payOrderId,orderState,payDataType, andpayData. - The merchant renders the redirect, virtual account, or QR data according to
payDataType. - After payment, FlashPay POSTs a signed form notification to
notifyUrl. - The merchant receives all fields dynamically, verifies the signature, processes the order idempotently, and returns plain text
SUCCESS. - If no callback arrives, query the original order; use
notify=1only when a callback needs to be retriggered.
PayOut flow
Flow details:
- For channels requiring bank codes, call
POST /api/channel/querybanksand cache the bank list with a low refresh frequency. - The user submits beneficiary and amount details, and the merchant completes its internal review.
- The merchant calls
POST /api/transferOrder. - FlashPay returns
transferIdand the currentstate. - When the order completes, FlashPay POSTs a signed form notification to
notifyUrl. - The merchant verifies and processes the callback idempotently, then returns plain text
SUCCESS. - If no callback arrives, query the original merchant order instead of creating a duplicate transfer.
Communication protocol
| Item | Rule |
|---|---|
| Transport | HTTP/HTTPS is supported in the test environment; HTTPS is required in production |
| Request method | As specified by each API document; transaction APIs use POST |
| Content type | application/json and application/x-www-form-urlencoded are supported; application/json is preferred |
| Character encoding | UTF-8 |
| Signature algorithm | RSA 2048 / SHA256withRSA |
| Signature encoding | Base64 |
Important: Asynchronous callback addresses are protected by a whitelist. Before production integration, contact the platform to bind the PayIn and PayOut callback domain or address.
Core identifiers and keys
Identifier and key reference
| Name | Generated/assigned by | Where the merchant obtains or stores it | Purpose | Disclosure |
|---|---|---|---|---|
Merchant number mchNo | Platform | Merchant Center | Identifies the merchant together with appId | May be transmitted in requests; it is not a password |
Application ID appId | Platform when the application is created | Merchant Center > Application Management | Identifies a merchant application and must be included in every signed request; the field name is case-sensitive | May be transmitted in requests; it is not a key |
| Merchant private key | Merchant | Merchant-side KMS or secure server configuration only | Signs API requests sent by the merchant | Never disclose, upload to the platform, or place in a browser or client application |
| Merchant public key | Merchant | Uploaded in Merchant Center | Used by the platform to verify merchant request signatures | May be provided to the platform; protect it from tampering |
| Platform public key | Platform | Merchant Center > Application Management > Modify/Details | Used by the merchant to verify synchronous responses, callbacks, and return URL parameters | Store on the merchant server and protect it from tampering |
| Platform private key | Platform | Not available to merchants | Signs platform responses, callbacks, and return URL parameters | Platform secret; merchants neither need nor receive it |
appIdidentifies an application and cannot replace a signing key. If Merchant Center labels the platform public key asPlatform Key, use it only for signature verification. It is not the private key used to sign merchant requests.
Key usage directions
| Data direction | Signer | Private key used | Verifier | Public key used |
|---|---|---|---|---|
| Merchant request → Platform | Merchant | Merchant private key | Platform | Merchant public key |
| Platform synchronous response → Merchant | Platform | Platform private key | Merchant | Platform public key |
| Platform asynchronous callback → Merchant | Platform | Platform private key | Merchant | Platform public key |
Key acquisition and storage
- Generate a 2048-bit RSA key pair. Use X.509 encoding for the public key, PKCS#8 for the private key, and Base64 strings for configuration values.
- Upload only the Base64 body of the merchant public key. Remove PEM headers and footers such as
-----BEGIN PUBLIC KEY-----and-----END PUBLIC KEY-----. - Store the merchant private key in a server-side KMS, encrypted environment configuration, or controlled configuration center. Never commit it to source control or expose it in logs, browsers, mobile apps, or mini programs.
- Configure platform public keys separately for test and production. Do not mix environment-specific
appIdvalues or keys. - When rotating keys, allow a transition window and immediately test request signing and callback verification after the change.
Common parameter rules
- Amount fields use the smallest currency unit. For example, USD uses cents. Values must not contain decimals unless an API explicitly states otherwise.
- Time fields use 13-digit Unix timestamps in milliseconds, for example
1756809333043. Keep merchant server time synchronized. - Parameter names are case-sensitive. Use
appId, notappidorappID. notifyUrlandreturnUrlmust be complete, publicly reachable HTTP/HTTPS URLs. Production URLs must use HTTPS.- Empty strings and
nulldo not participate in signing. Whether a field may be empty is still determined by the corresponding API document.