Skip to main content

Quick Start

This guide will help you create your first payment using the 123hub Multihub API.

Step 1: Get Your Credentials

1

Obtain your credentials

Credentials are provided by the 123hub team during merchant onboarding. You will receive:
  • application_id — an integer identifying your application
  • secret_key — a private key used to sign requests
Contact your account manager or reach out to support@123hub.pro to request access.
2

Understand request signing

Every request must include two authentication headers:
  • X-Data-Application-Id — your integer application ID
  • X-Data-Hash — SHA-512 hash of the raw JSON request body concatenated with your secret key: sha512(requestBody + secretKey)
Merchant accounts and credentials are created by the 123hub team. Self-registration is not available.

Step 2: Test Connectivity

Verify your credentials work by calling gateway.ping:
# Compute the hash: sha512('{"method":"gateway.ping","params":{}}' + YOUR_SECRET_KEY)
curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: 1" \
  -H "X-Data-Hash: <sha512_hash>" \
  -d '{
    "method": "gateway.ping",
    "params": {}
  }'
Response:
{
  "success": true,
  "result": {
    "message": "pong"
  },
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "processing_time": 5
}

Step 3: Create a Deposit

Create a deposit payment (customer pays to you) using the payment.in method.
The service_id value is assigned per merchant during onboarding. It determines the provider, payment method, and currency for the payment. Use the value provided by your account manager. The examples below use placeholder service_id values for illustration.
curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: 1" \
  -H "X-Data-Hash: <sha512_hash>" \
  -d '{
    "method": "payment.in",
    "service_id": 14701,
    "params": {
      "payment": {
        "description": "Order #12345",
        "identifiers": { "c_id": "12345" },
        "amount": { "value": 10000, "currency": "INR" },
        "payer": {
          "email": "customer@example.com",
          "phone": "9876543210",
          "person": { "first_name": "John", "last_name": "Doe" }
        },
        "client": { "language": "EN", "country": "IN" }
      }
    }
  }'

Response

{
  "success": true,
  "result": {
    "payment": {
      "amount": { "value": 10000, "currency": "INR" },
      "description": "Order #12345",
      "identifiers": { "c_id": "12345", "h_id": "1001", "p_id": "txn_abc123" },
      "status": { "status": "created", "final": false, "success": null },
      "timestamps": { "created": "2026-01-15T10:30:00Z" },
      "destination": "in",
      "service_id": 14701
    }
  },
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "processing_time": 125
}
Other supported currencies: The same pattern works for Australian Dollar (AUD) and Sri Lankan Rupee (LKR) using the bank_transfer payment method. Use the service_id assigned by your account manager for each currency.

Step 4: Check Payment Status

Use payment.status with the h_id returned from the deposit to check its current status:
curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: 1" \
  -H "X-Data-Hash: <sha512_hash>" \
  -d '{
    "method": "payment.status",
    "params": {
      "payment": {
        "identifiers": { "h_id": "1001" }
      }
    }
  }'
Response:
{
  "success": true,
  "result": {
    "payment": {
      "payer": {
        "email": "customer@example.com",
        "phone": "9876543210",
        "person": { "first_name": "John", "last_name": "Doe" }
      },
      "amount": { "value": 10000, "currency": "INR" },
      "description": "Order #12345",
      "identifiers": { "c_id": "12345", "h_id": "1001", "p_id": "txn_abc123" },
      "status": {
        "status": "processing",
        "final": false,
        "success": null,
        "history": [
          { "status": "created", "final": false, "success": null, "created": "2026-01-15T10:30:00Z", "reason": null, "amount": 10000 },
          { "status": "processing", "final": false, "success": null, "created": "2026-01-15T10:30:05Z", "reason": null, "amount": 10000 }
        ]
      },
      "timestamps": {
        "created": "2026-01-15T10:30:00Z",
        "updated": "2026-01-15T10:30:05Z"
      },
      "destination": "in",
      "service_id": 14701
    }
  },
  "request_id": "d4e5f6a7-b8c9-0123-defa-234567890123",
  "processing_time": 42
}

Step 5: Check Balance

Use balance.get to retrieve your current account balance:
curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: 1" \
  -H "X-Data-Hash: <sha512_hash>" \
  -d '{
    "method": "balance.get",
    "params": {}
  }'
Response:
{
  "success": true,
  "result": {
    "balance": {
      "id": 0,
      "amounts": [
        { "value": 500000, "value_freezing": 10000, "value_blocking": 0, "currency": "INR", "enabled": true },
        { "value": 250000, "value_freezing": 5000, "value_blocking": 0, "currency": "MXN", "enabled": true },
        { "value": 1000000, "value_freezing": 0, "value_blocking": 0, "currency": "ARS", "enabled": true },
        { "value": 75000, "value_freezing": 0, "value_blocking": 0, "currency": "TRY", "enabled": true }
      ],
      "enabled": true
    }
  },
  "request_id": "e5f6a7b8-c9d0-1234-efab-345678901234",
  "processing_time": 18
}

Understanding the Response

All API responses follow the same envelope format:
FieldDescription
successtrue if the request succeeded, false if an error occurred
resultThe response payload (structure varies by method)
errorPresent only on failure. Contains code (integer), message (string), details, and context
request_idUnique identifier for this request (useful for debugging)
processing_timeServer processing time in milliseconds

Payment identifiers

IdentifierDescription
c_idYour client-side string identifier (the value you send)
h_idHub-assigned payment identifier. You can use it for status queries.
p_idProvider-assigned transaction identifier. It is returned for reconciliation and is not accepted as a status lookup key.

Payment statuses

StatusfinalsuccessDescription
createdfalsenullPayment created, awaiting processing
processingfalsenullPayment is being processed
successtruetruePayment completed successfully
errortruefalsePayment failed
canceledtruefalsePayment was cancelled
declinedtruefalsePayment expired or was declined
refundedtruetruePayment was refunded
partially_refundedtruetruePartial refund processed

What’s Next?

Set up Webhooks

Receive real-time notifications when the payment completes

Payment Types

Learn about deposits, withdrawals, and payment pages

Test Your Integration

Use test mode to simulate different scenarios

Balance Management

Monitor and manage your merchant balances

Go Live

Switch to production when you’re ready

Common Issues

Verify that X-Data-Hash is computed as sha512(requestBody + secretKey) where requestBody is the exact JSON string sent in the request body. Ensure there is no extra whitespace or encoding difference between what you hash and what you send.
Check that the X-Data-Application-Id header contains your correct integer application ID.
Ensure all required fields are present in your request. The method and params fields are always required. For payment.in, you must include service_id and the params.payment object with amount, identifiers, and payer. Check the details field in the error response for specifics.
The specified service_id may not be enabled for your account, or the payment method is temporarily unavailable. Contact your account manager to verify your service configuration.