Skip to main content

SDKs & Code Examples

We provide example client implementations in popular programming languages to help you integrate with the Multihub API. These are reference implementations, not official SDK packages — you can adapt them to your needs or use them as-is.
All SDKs wrap a single POST endpoint at https://api.123hub.pro/public/api/multihub/v1 using SHA-512 request signing for authentication. There are no multiple REST endpoints to manage.

Available Examples

How It Works

Every API call follows the same pattern regardless of the programming language:
1

Build the request body

Construct a JSON body containing method (the operation), an optional service_id, and a params object.
2

Sign the request

Serialize the body to a compact JSON string (no extra whitespace), append your secret key, and compute the SHA-512 hex digest.
3

Send the POST request

POST to https://api.123hub.pro/public/api/multihub/v1 with headers X-Data-Application-Id (your application ID) and X-Data-Hash (the computed hash).
4

Handle the response

Successful responses return HTTP 200, errors return HTTP 400 (or 404 for unknown methods). Check the success boolean field to determine if the operation succeeded, and handle error.code / error.message when it did not.

Authentication

All requests require two headers:
HeaderTypeDescription
X-Data-Application-IdIntegerYour application ID
X-Data-HashStringsha512(compactJsonBody + secretKey) hex digest
Never expose your secret key in client-side code, logs, or version control. Always store it in environment variables or a secrets manager.

Environment Variables

Store your credentials securely:
export MULTIHUB_APP_ID="1"
export MULTIHUB_SECRET_KEY="your_secret_key"

API Methods

Method-based routing replaces traditional REST endpoints. You specify the operation in the method field of the request body:
MethodDescription
gateway.pingHealth check / connectivity test
payment.inCreate a deposit (pay-in)
payment.outCreate a withdrawal (payout)
payment.statusCheck payment status by identifiers
balance.getRetrieve account balances

Request Format

Every request follows this structure:
{
  "method": "payment.in",
  "service_id": 14701,
  "params": {
    "payment": {
      "identifiers": { "c_id": 12345 },
      "amount": { "value": 10000, "currency": "INR" },
      "description": "Order #12345"
    }
  }
}

Response Envelope

Every response uses a consistent envelope:
Success (HTTP 200)
{
  "success": true,
  "result": { ... },
  "request_id": "abc-123",
  "processing_time": 42
}
When an error occurs (HTTP 400):
Error (HTTP 400)
{
  "success": false,
  "error": {
    "code": 1005,
    "message": "Invalid request format",
    "details": { "description": "missing required properties including: 'service_id'. Path: $" },
    "context": null
  },
  "request_id": "abc-456",
  "processing_time": 3
}

Common Pattern Across All SDKs

Regardless of language, every SDK example follows this pseudocode:
function send(body):
    body_string = compact_json_serialize(body)
    hash = sha512_hex(body_string + secret_key)
    response = http_post(BASE_URL, body, headers={
        "X-Data-Application-Id": app_id,
        "X-Data-Hash": hash,
    })
    return parse_json(response.body)

Community SDKs

If you have built an SDK or wrapper for the Multihub API, we would love to feature it here. Contact us at [email protected].

Need Help?