API Reference
This section provides detailed documentation for the 123hub multihub API. All operations are performed through a single endpoint using method-based routing.
Base URL
https://api.123hub.pro/public/api/multihub/v1
Single Endpoint
All API operations use a single endpoint:
POST /public/api/multihub/v1
The method field in the request body determines which operation is performed.
Authentication
Every request requires two headers:
| Header | Type | Description |
|---|
X-Data-Application-Id | integer | Your application ID, provided during merchant onboarding |
X-Data-Hash | string | SHA512 hex hash of the request body combined with your secret key |
curl -X POST https://api.123hub.pro/public/api/multihub/v1 \
-H "Content-Type: application/json" \
-H "X-Data-Application-Id: 12345" \
-H "X-Data-Hash: a3f2b8c1d4e5..." \
-d '{"method": "gateway.ping"}'
Available Methods
The method field in the request body determines the operation. The following methods are supported:
| Method | Description | Requires service_id |
|---|
payment.in | Create a deposit (incoming payment) | Yes |
payment.out | Create a withdrawal (outgoing payment) | Yes |
payment.status | Get payment status by identifier | No (optional) |
balance.get | Get merchant balances | No |
gateway.ping | Health check | No |
Key Concepts
service_id
An integer that identifies a specific payment method and provider combination. The service_id is provided by the platform when setting up your merchant account. It is required for payment.in and payment.out methods.
Payment Identifiers
Payments use three identifiers:
| Identifier | Description |
|---|
c_id | Client ID — your unique reference for this payment (provided by you) |
h_id | Hub ID — the platform-assigned payment identifier |
p_id | Provider ID — the external provider’s transaction identifier |
You can query payment status using any of these identifiers via the payment.status method.
All requests are POST with a JSON body. The method field is always required:
{
"method": "payment.in",
"service_id": 14701,
"params": {
"payment": {
"description": "Order #12345",
"identifiers": { "c_id": 12345 },
"amount": { "value": 10000, "currency": "INR" },
"payer": {
"email": "[email protected]",
"phone": "9876543210",
"person": { "first_name": "John", "last_name": "Doe" }
}
}
}
}
Successful responses return HTTP 200. Error responses return HTTP 400 (or HTTP 404 for unknown methods). All responses use the same envelope structure:
Success Response (HTTP 200)
{
"success": true,
"result": {
"payment": {
"amount": { "value": 10000, "currency": "INR" },
"identifiers": { "c_id": 12345, "h_id": 1001 },
"status": { "status": "created", "final": false, "success": null },
"destination": "in",
"service_id": 14701
}
},
"request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"processing_time": 125
}
Error Response (HTTP 400)
{
"success": false,
"error": {
"code": 6010,
"message": "Payment does not exist",
"details": null,
"context": null
},
"request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"processing_time": 5
}
Response Fields
| Field | Type | Description |
|---|
success | boolean | Whether the request was successful |
result | object or null | The response data (present on success) |
error | object or null | Error details (present on failure) |
error.code | integer | Numeric error code (see Error Codes) |
error.message | string | Human-readable error message |
error.details | any or null | Additional error details (e.g., description of missing field) |
error.context | any or null | Contextual information for debugging |
request_id | string | Unique identifier for this request (UUID) |
processing_time | integer | Server processing time in milliseconds |
Successful responses return HTTP 200. Error responses return HTTP 400 (most errors) or HTTP 404 (unknown method, code 1002). Always check the success field to determine the outcome of a request.
Rate Limits
| Method | Limit |
|---|
payment.in / payment.out | 5000 requests/minute |
payment.status / balance.get | 100 requests/minute |
gateway.ping | 100 requests/minute |
When the rate limit is exceeded, the API returns an error with code 1002.