Authentication
All API requests to 123hub must be authenticated using two headers: your Application ID and a SHA512 hash computed from the request body and your secret key. This page explains how to obtain your credentials and sign requests.Obtaining Credentials
API credentials and merchant accounts are created by the 123hub team during onboarding. Self-registration is not available.
- Contact your 123hub account manager
- Or email [email protected]
| Credential | Type | Description |
|---|---|---|
application_id | Integer | Your unique application identifier (e.g., 1, 42) |
secret_key | String | A random secret string used to sign requests |
Authentication Headers
Every request to the API must include two headers:| Header | Value | Description |
|---|---|---|
X-Data-Application-Id | Integer | Your application ID |
X-Data-Hash | Hex string | SHA512 hash of requestBody + secretKey |
How Signing Works
Prepare the request body
Serialize your request body as a JSON string. This is the exact string that will be sent as the HTTP body.
Compute the hash
Concatenate the JSON string with your
secret_key (no separator), then compute the SHA512 hash of the result. Output as a lowercase hex string.Code Examples
Verifying Webhook Signatures
When 123hub sends webhook notifications to your server, the request includes anX-Data-Hash header. You should verify this signature to ensure the webhook is authentic.
The signature is computed the same way: SHA512(webhookBody + secretKey).
Test Mode vs Production
Test and production requests use the same API endpoint and the same authentication mechanism. The environment is determined by which credentials you use.
- Test credentials create simulated transactions with no real money movement
- Production credentials create real transactions with actual money movement
- Webhooks are delivered in both environments for testing integrations
- All API responses follow the same format in both environments
Rate Limits
API requests are rate-limited to ensure fair usage:| Method Type | Limit |
|---|---|
payment.in / payment.out | 5000 requests/minute (burst: 500/10sec) |
payment.status / balance.get | 100 requests/minute |
gateway.ping | 100 requests/minute |
Rate limits are applied per
application_id. If you exceed the limit, the response will contain success: false with an appropriate error code and message.Error Responses
Authentication errors are returned in the standard response envelope with HTTP 200:Invalid Application ID
Invalid Hash Signature
Best Practices
Use Environment Variables
Store your
application_id and secret_key in environment variables, never in source codeRotate Keys Regularly
Regenerate your secret key periodically from the dashboard for enhanced security
Verify Webhooks
Always verify the
X-Data-Hash header on incoming webhooks before processingMonitor Usage
Track API usage in the dashboard to detect anomalies and stay within rate limits
