> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bafanglaicai88.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Describe only the public 123hub merchant API documented on this site. The primary endpoint is POST /public/api/multihub/v1.
> Preserve API method names, field names, header names, and error codes exactly as documented. Do not invent endpoints or parameters.
> Treat every amount as an integer in minor units unless a page explicitly states otherwise.
> Never expose, request, or fabricate a merchant secret key. The SDK pages contain reference implementations, not official SDK packages.

# Introduction

> Welcome to the 123hub Payment Gateway API documentation

# 123hub Payment Gateway API

123hub is a modern payment gateway that enables merchants to accept payments, process payouts, and manage their financial operations through a single API endpoint using method-based routing.

<CardGroup cols={2}>
  <Card title="Quick Start" icon="rocket" href="/quickstart">
    Get up and running with your first API call in minutes
  </Card>

  <Card title="Authentication" icon="key" href="/authentication">
    Learn how to authenticate with Application ID and SHA512 hash
  </Card>

  <Card title="Payments Guide" icon="credit-card" href="/guides/payments">
    Create deposits, withdrawals, and check payment status
  </Card>

  <Card title="Webhooks" icon="webhook" href="/guides/webhooks">
    Receive real-time notifications about payment events
  </Card>
</CardGroup>

## How It Works

All API interactions go through a **single POST endpoint** with method-based routing. Instead of different URLs for different operations, you specify the `method` field in the request body.

```json Example Request theme={null}
{
  "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",
        "person": { "first_name": "John", "last_name": "Doe" }
      }
    }
  }
}
```

```json Example Response theme={null}
{
  "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": "req_7f3a9b2c",
  "processing_time": 42
}
```

## Available Methods

| Method                 | Description                                            |
| ---------------------- | ------------------------------------------------------ |
| `payment.in`           | Create an incoming payment (deposit)                   |
| `payment.out`          | Create an outgoing payment (withdrawal/payout)         |
| `payment.status`       | Check the status of an existing payment                |
| `payment.notification` | Re-send webhook notification for a payment             |
| `balance.get`          | Retrieve your account balance                          |
| `gateway.ping`         | Health check to verify connectivity and authentication |

## Features

<AccordionGroup>
  <Accordion title="Multiple Payment Methods">
    Accept payments via bank transfers, UPI, e-wallets, cash payments, card payments, and cryptocurrency. Multiple currencies supported (ARS, AUD, INR, LKR, MXN, TRY, UYU).
  </Accordion>

  <Accordion title="Real-time Webhooks">
    Receive instant notifications when payment status changes. Secure webhook delivery with SHA512 signatures and automatic retries.
  </Accordion>

  <Accordion title="Single Endpoint, Method-Based Routing">
    All API operations go through one URL. The `method` field in the request body determines the action. Simplifies integration and reduces configuration overhead.
  </Accordion>

  <Accordion title="Unified Response Format">
    Every response follows the same envelope structure with `success`, `result`, `error`, `request_id`, and `processing_time` fields. Successful responses return HTTP 200, errors return HTTP 400 (or 404 for unknown methods).
  </Accordion>
</AccordionGroup>

## Base URL

All API requests are made to:

```
https://api.bafanglaicai88.com/public/api/multihub/v1
```

<Note>
  All requests use the `POST` method. The same endpoint is used for both test and production environments. Your credentials determine which environment is active.
</Note>

## Authentication

Every request requires `X-Data-Application-Id` and `X-Data-Hash`. The timestamp
and nonce are an optional pair:

| Header                  | Description                                  |
| ----------------------- | -------------------------------------------- |
| `X-Data-Application-Id` | Your application ID (integer)                |
| `X-Data-Hash`           | SHA512 hex hash of `requestBody + secretKey` |
| `X-Data-Timestamp`      | Optional current Unix timestamp in seconds   |
| `X-Data-Nonce`          | Optional unique nonce for this request       |

See the [Authentication](/authentication) page for full details and code examples.

## Supported Payment Methods

| Method          | Type           | Description                              | Processing Time  |
| --------------- | -------------- | ---------------------------------------- | ---------------- |
| `upi`           | Bank Transfer  | Unified Payments Interface (India)       | Up to 30 minutes |
| `imps`          | Bank Transfer  | Immediate Payment Service (India)        | Up to 30 minutes |
| `bank_transfer` | Bank Transfer  | Generic bank transfer                    | Up to 30 minutes |
| `spei`          | Bank Transfer  | Mexican interbank transfer system (SPEI) | Up to 30 minutes |
| `havale`        | Bank Transfer  | Turkish bank transfer (Havale/EFT)       | Up to 30 minutes |
| `papara`        | E-Wallet       | Papara e-wallet (Turkey)                 | Up to 15 minutes |
| `card`          | Card           | Credit and debit cards (tokenized)       | Up to 30 minutes |
| `kredikarti`    | Card           | Turkish credit/debit card                | Up to 5 minutes  |
| `oxxo`          | Cash           | Pay at 20,000+ OXXO convenience stores   | Up to 30 minutes |
| `cash`          | Cash           | Cash payments                            | Up to 30 minutes |
| `crypto`        | Cryptocurrency | Crypto payments (USDT, etc.)             | Up to 30 minutes |

## Supported Currencies

| Currency          | Code  | Country   | Default Method  | Directions           |
| ----------------- | ----- | --------- | --------------- | -------------------- |
| Argentine Peso    | `ARS` | Argentina | `bank_transfer` | Deposit & Withdrawal |
| Australian Dollar | `AUD` | Australia | `bank_transfer` | Deposit & Withdrawal |
| Indian Rupee      | `INR` | India     | `upi`           | Deposit & Withdrawal |
| Sri Lankan Rupee  | `LKR` | Sri Lanka | `bank_transfer` | Deposit & Withdrawal |
| Mexican Peso      | `MXN` | Mexico    | `spei`          | Deposit & Withdrawal |
| Turkish Lira      | `TRY` | Turkey    | `havale`        | Deposit & Withdrawal |
| Uruguayan Peso    | `UYU` | Uruguay   | `bank_transfer` | Deposit & Withdrawal |

## Response Format

All responses follow a consistent envelope:

```json Success Response (HTTP 200) theme={null}
{
  "success": true,
  "result": { ... },
  "request_id": "req_7f3a9b2c",
  "processing_time": 42
}
```

```json Error Response (HTTP 400) theme={null}
{
  "success": false,
  "error": {
    "code": 6010,
    "message": "Payment does not exist",
    "details": null,
    "context": null
  },
  "request_id": "req_8d4b1e3f",
  "processing_time": 5
}
```

<Warning>
  Successful responses return HTTP 200. Error responses return HTTP 400 (or HTTP 404 for unknown methods). Always check the `success` field in the response body to determine if the request succeeded.
</Warning>

## Need Help?

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Explore all available methods and parameters
  </Card>

  <Card title="Support" icon="envelope" href="mailto:support@123hub.pro">
    Contact our developer support team
  </Card>
</CardGroup>
