Whalet Open API Integration Guide#
1. Introduction#
1.1 Overview#
This document helps partners integrate quickly with Whalet’s open capabilities for collections, acquiring, VCC, payout, and more.1.2 Integration flow#
1.3 Integration parameters#
Technical parameters that Whalet and partners must exchange before starting integration
| Parameter | Provider | Description | Example |
|---|
| partnerId | whalet | Partner ID | 202506241658268 |
| clientId | whalet | Application ID | budrOyt8X0qTCeyaDPMd2t5EI2DOUIii |
| secretKey | whalet | Application secret | saBHKCCpWQXqEWRRFtSLmzStlVeXKBiE4p... |
| hmacKey | whalet | Signing key | budrOyt8X0qTCeyaDPMd2t5EI2DOUIii |
| aesKey | whalet | Key for encrypting sensitive fields | FvB+9fRjT1fb1JTbrlMRpw== |
| sdk clientKey | whalet | Payment component key | test_Tz3kDyBMUhv0lHJYPwzfHuyD69x |
| webhookUrl | Partner | Notification URL | https://example.com/webhook |
1.4 Technical support#
For integration or debugging questions during business hours, contact technical support:
implement@whalet.com2.1 Access method#
APIs follow REST conventions, use OAuth 2.0 authorization, communicate over HTTPS, and accept POST requests.2.2 Notes#
All API requests must use HTTPS
TLS 1.2 or higher is recommended
Use UTF-8 for all character encoding
Some request fields must be encrypted: use the encrypted prefix and encrypt with AES using the assigned aesKey
2.3 Status codes#
Success codes#
| Code | Description | Usage |
|---|
SUCCESS | Operation succeeded | Normal completion |
PROCESSING | In progress | Processing |
Error codes#
| Code | Description | Resolution |
|---|
FAILURE | Failed | Check the error reason |
TOO_MANY_REQUESTS | Rate limit exceeded | Reduce request frequency |
PARTNER_NOT_EXIST | Partner not found | Check header partnerId |
INTERNAL_ERROR | Internal error | Contact technical support |
PARAMETER_ERROR | Invalid parameter | See detailed error message |
IDEMPOTENT_ERROR | Idempotency error | Contact technical support |
REQUEST_NO_NOT_UNIQUE | Duplicate request number | Check requestNo |
UNAUTHORIZED | Unauthorized | API not authorized; contact Whalet to enable access |
UNAUTHENTICATED_ERROR | Authentication (signature) error | Verify signature |
INTERFACE_UNAUTHORIZED | API not authorized | API not authorized; contact Whalet to enable access |
2.4 Sensitive field encryption#
Encryption rules#
1.
Content: Original value of the sensitive field
3.
Key: Provided by Whalet to the partner (128-bit, ECB padding mode)
4.
Encrypt the sensitive field value with the assigned key
Send the ciphertext as the field value in the request
Sample code#
3. Authentication and authorization#
3.1 Obtain access token#
Endpoint: POST /v1/auth/token
Description: Obtain an access token with client ID and secret
Auth: No authentication required
| Type | Name | Required | Type | Description | Example |
|---|
| Header | partnerId | Yes | string | Partner ID | 202506241658268 |
| Header | requestNo | Yes | string | Request serial number | REQ202312010001 |
| Header | timestamp | Yes | long | Timestamp (milliseconds) | 1753682997568 |
| Body | clientId | Yes | string | Client ID | budrOyt8X0qTCeyaDPMd2t5EI2DOUIii |
| Body | secretKey | Yes | string | Secret | saBHKCCpWQXqEWRRFtSLmzStlVeXK... |
| Name | Type | Description | Example |
|---|
| code | string | Response code | SUCCESS |
| message | string | Response message | success |
| data.token | string | Access token | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9 |
| data.expire | number | Expiry (seconds) | 3600 |
| data.tokenType | string | Token type | Bearer |
{
"message": "success",
"code": "SUCCESS",
"data": {
"token": "S5laCM1hbNZxcWqp7l8xBTtDKopQtE7wfRy4fxyzyQIHbvJJ76bW6UkJvVAmakZS",
"expire": 3600,
"tokenType": "Bearer"
}
}
3.2 Token expiry and refresh#
Token lifetime in seconds is specified by expire (e.g. 3600 means one hour).
Cache the token locally. If remaining lifetime is less than 5 minutes (300 seconds), obtain a new token; the previous token becomes invalid.
4. Business APIs#
3.1 Overview#
Complete authorization (obtain a token) before calling business APIs; all business endpoints require authorization.Every API request must include the following headers:| Name | Required | Type | Description | Example |
|---|
partnerId | Yes | string | Partner ID identifying the request source | partner_001 |
requestNo | Yes | string | Request serial number; use a unique value for troubleshooting | REQ202312010001 |
Authorization | Yes | string | Access token from /v1/auth/token | Bearer eyJhbGciO... |
timestamp | Yes | long | Request timestamp (milliseconds) | 1753682997568 |
Content-Type | Yes | string | Fixed value application/json | application/json |
Note: Authorization is required on every endpoint
{
"partnerId": "partner_001",
"requestNo": "REQ202312010001",
"Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9",
"timestamp": "1753682997568",
"Content-Type": "application/json"
}
Request body (HTTP Body)#
The body is JSON; parameters are defined in each API’s documentation.{
"param1": "value1",
"param2": "value2",
"param3": {
"nestedParam": "nestedValue"
}
}
| Name | Type | Description | Example |
|---|
Content-Type | string | Fixed value application/json | application/json |
{
"Content-Type": application/json
}
Response body (HTTP Body)#
All API responses use a uniform JSON shape:{
"code": "SUCCESS",
"message": "Response description",
"data": "Payload as defined in the API reference"
}
| Field | Type | Required | Description | Example |
|---|
code | string | Yes | Response code | SUCCESS |
message | string | Yes | Human-readable description | Operation succeeded |
data | object/array/null | Yes | Payload; structure per API docs | {} |
{
"code": "SUCCESS",
"message": "success",
"data": {
"id": "12345",
"name": "Sample data",
"status": "active"
}
}
{
"message": "clientId length must be 32",
"code": "PARAMETER_ERROR",
"data": null
}
4. Notifications (webhook)#
Webhooks push notifications to partners, such as inbound funds or business outcome events.4.1 Delivery policy#
Retries: up to 5 attempts with intervals of 1s, 2s, 4s, 8s, and 16s
Response: return within 30 seconds; if all 5 attempts fail, Whalet will notify the partner offline
Success: HTTP status code 200
4.2 Request details#
URL: Provided by the partner
| Name | Required | Type | Description |
|---|
| Content-Type | Yes | string | application/json |
| signature | Yes | string | Signature; see rules below |
Notification body#
| Field | Type | Required | Description |
|---|
| type | string | Yes | Business type (see each notification’s type definition) |
| data | object | Yes | Business payload (see each notification API’s parameters) |
| requestNo | string | Yes | Request serial number |
| version | string | Yes | API version |
| timestamp | long | Yes | Timestamp (milliseconds) |
4.3 Signature verification#
Verification rules#
1.
Content: Raw JSON string of the request body (HTTP payload; do not reformat or alter whitespace)
3.
Key: Provided by Whalet to the partner
4.
Sign the request body (payload) with the signing key
Base64-encode the signature to produce the final string
Compare that string with the signature header using a constant-time equality check
Sample code#
5. File upload#
5.1 Upload API#
Endpoint: POST /v1/upload
Description: Upload files (IDs, attachments, proofs, etc.)
Auth: Authentication required
| Type | Name | Required | Type | Description | Example |
|---|
| Header | partnerId | Yes | string | Partner ID | 202506241658268 |
| Header | requestNo | Yes | string | Request serial number | REQ202312010001 |
| Header | timestamp | Yes | long | Timestamp (milliseconds) | 1740995200123 |
| Header | Content-Type | Yes | string | Fixed header | multipart/form-data |
| Header | Authorization | Yes | string | Access token | Bearer eyJhbGciOiU... |
| Body | file | Yes | file | File to upload | (binary) |
Images: jpeg, jpg, png, gif, bmp
Documents: pdf, doc, docx, xls, xlsx, csv, txt
5.3 Size limit#
5.4 Response body#
| Name | Type | Description | Example |
|---|
| code | string | Response code | SUCCESS |
| message | string | Response message | success |
| data.fileId | string | File ID | 202507301610248867670001 |
| data.fileName | string | File name | image1.jpg |
| data.fileUrl | string | File URL | https://test-file.whalet.com/2025-07-30/demo.jpg |
{
"message": "success",
"code": "SUCCESS",
"data": {
"fileId": "202507301610248867670001",
"fileName": "demo.png",
"fileUrl": "https://test-file.whalet.com/2025-07-30/demo.jpg"
}
}
6. Main API categories#
User onboarding
User onboarding applications and supplemental materials.Collections
Open VA accounts and receive funds.Acquiring
International card acquiring and local payment methods.Wallet
Wallet and Balance.