Skip to main content

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:
HeaderTypeDescription
X-Data-Application-IdintegerYour application ID, provided during merchant onboarding
X-Data-HashstringSHA512 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:
MethodDescriptionRequires service_id
payment.inCreate a deposit (incoming payment)Yes
payment.outCreate a withdrawal (outgoing payment)Yes
payment.statusGet payment status by identifierNo (optional)
balance.getGet merchant balancesNo
gateway.pingHealth checkNo

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:
IdentifierDescription
c_idClient ID — your unique reference for this payment (provided by you)
h_idHub ID — the platform-assigned payment identifier
p_idProvider ID — the external provider’s transaction identifier
You can query payment status using any of these identifiers via the payment.status method.

Request Format

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" }
      }
    }
  }
}

Response Format

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

FieldTypeDescription
successbooleanWhether the request was successful
resultobject or nullThe response data (present on success)
errorobject or nullError details (present on failure)
error.codeintegerNumeric error code (see Error Codes)
error.messagestringHuman-readable error message
error.detailsany or nullAdditional error details (e.g., description of missing field)
error.contextany or nullContextual information for debugging
request_idstringUnique identifier for this request (UUID)
processing_timeintegerServer 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

MethodLimit
payment.in / payment.out5000 requests/minute
payment.status / balance.get100 requests/minute
gateway.ping100 requests/minute
When the rate limit is exceeded, the API returns an error with code 1002.