Skip to main content

Quick Start

This guide will help you create your first payment using the 123hub 123hub 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; the replay pair is optional:
  • 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)
  • X-Data-Timestamp — optional current Unix timestamp in seconds
  • X-Data-Nonce — optional unique nonce for this request; send it together with the timestamp
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:
Response:

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.

Response

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:
Response:

Step 5: Check Balance

Use balance.get to retrieve your current account balance:
Response:

Understanding the Response

All API responses follow the same envelope format:

Payment identifiers

Payment statuses

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

Validate signing, payments, balances, and webhooks before production traffic

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.