> ## Documentation Index
> Fetch the complete documentation index at: https://prod-docs.123hub.pro/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.

# API Methods

> Request and response contracts for payment, balance, notification, and ping methods

# API Methods

All API methods are sent to one endpoint:

```http theme={null}
POST /public/api/multihub/v1
```

## Request Envelope

```json theme={null}
{
  "method": "payment.in",
  "service_id": 14701,
  "params": {
    "payment": {}
  }
}
```

| Field | Type | Required | Description |
| - | - | :-: | - |
| `method` | string | Yes | `payment.in`, `payment.out`, `payment.status`, `payment.notification`, `balance.get` or `gateway.ping`; any other value returns `9000` |
| `service_id` | integer | Conditional | Required for `payment.in` and `payment.out`; optional elsewhere |
| `params.payment` | object | Conditional | Required for payment methods |

The API also accepts `method` as `{ "const": "balance.get" }` and numeric-string `service_id` values. Payment identifiers must be strings; numeric `c_id` and `h_id` values are rejected to avoid precision loss.

## Application Rate Limits

Authenticated merchant applications have separate per-method protective rate-limit buckets for `payment.in`, `payment.out`, `payment.status`, `payment.notification` and `balance.get`. Buckets are keyed by merchant and application, not by client IP address. The payment creation buckets are configured as high safety ceilings for runaway or abusive traffic, not as normal operating limits; `payment.notification` is limited to 10 requests per minute. When a bucket is exhausted, the endpoint returns HTTP `429` with the standard API error envelope (`error.code` `1000`, message `Too many requests`) and `Retry-After-*` rate-limit headers. See [Authentication](https://prod-docs.123hub.pro/authentication.md#rate-limits) for default limits.

## `payment.in`

Creates a deposit.

### Required Fields

| Field | Type | Description |
| - | - | - |
| `service_id` | integer | Route assigned during onboarding |
| `params.payment.amount.value` | integer | Amount in minor units; fractional values are rejected |
| `params.payment.amount.currency` | string | ISO 4217 currency code; must match the `service_id` route |
| `params.payment.identifiers.c_id` | string | Merchant reference, unique per payment; 1–255 characters, not blank |
| `params.payment.payer` | object | Customer who sends funds |

### Optional Fields

| Field | Type | Description |
| - | - | - |
| `description` | string | Max 1024 characters |
| `payer.email` | string | Customer email; valid email, max 255 characters |
| `payer.phone` | string | Customer phone, max 50 characters |
| `payer.person.first_name` | string | Customer first name only, max 255 characters; passed to the route as a separate field |
| `payer.person.last_name` | string | Customer last name only, max 255 characters; passed to the route as a separate field |
| `payer.customer_account.id` | string | Merchant-side customer identifier, max 255 characters |
| `payer.custom_fields` | object | Route-specific string fields; maximum 20 safe entries |
| `client.language` | string | Max 10 characters; accepted but currently not passed to the route |
| `client.country` | string | Max 3 characters; accepted but currently not passed to the route |
| `redirect.on_success` | string | HTTP(S) URL, max 2048 characters; echoed in the create response only, not passed to the payment page |
| `redirect.on_fail` | string | HTTP(S) URL, max 2048 characters; echoed in the create response only, not passed to the payment page |
| `webhook_url` | string | Per-payment callback URL; temporarily unavailable — see [Webhooks](https://prod-docs.123hub.pro/api-reference/webhooks.md) |

All optional fields are under `params.payment`. Unknown fields are rejected with `9000`. Without any
name the payment is recorded as `Unknown`.

### Example

```json theme={null}
{
  "method": "payment.in",
  "service_id": 14701,
  "params": {
    "payment": {
      "description": "Order #12345",
      "identifiers": { "c_id": "order-12345" },
      "amount": { "value": 10000, "currency": "INR" },
      "payer": {
        "email": "customer@example.com",
        "phone": "9876543210",
        "person": { "first_name": "John", "last_name": "Doe" },
        "customer_account": { "id": "cust-123" }
      },
      "client": { "language": "EN", "country": "IN" }
    }
  }
}
```

## `payment.out`

Creates a withdrawal/payout.

### Required Fields

| Field | Type | Description |
| - | - | - |
| `service_id` | integer | Route assigned during onboarding |
| `params.payment.amount.value` | integer | Amount in minor units |
| `params.payment.amount.currency` | string | ISO 4217 currency code; must match the `service_id` route |
| `params.payment.identifiers.c_id` | string | Merchant payout reference and idempotency key, unique per payment |
| `params.payment.receiver.bank.account.id` | string | Recipient account identifier |

### Optional Fields

| Field | Type | Description |
| - | - | - |
| `params.payment.description` | string | Max 1024 characters |
| `params.payment.receiver.bank.ifsc` | string | IFSC for INR routes, max 50 characters; wins over `bank.code` if both are sent |
| `params.payment.receiver.bank.code` | string | Bank or wallet code for routes that need it, max 50 characters |
| `params.payment.receiver.email` | string | Recipient email; valid email, max 255 characters |
| `params.payment.receiver.phone` | string | Recipient phone, max 50 characters |
| `params.payment.receiver.person.first_name` | string | Recipient first name only, max 255 characters; recommended |
| `params.payment.receiver.person.last_name` | string | Recipient last name only, max 255 characters; recommended |
| `params.payment.receiver.customer_account.id` | string | Merchant-side recipient identifier, max 255 characters |
| `params.payment.receiver.custom_fields` | object | Route-specific string fields; maximum 20 safe entries |
| `params.payment.webhook_url` | string | Per-payment callback URL; temporarily unavailable |

The recipient's first and last name are passed to the route separately and as a combined name;
without any name the recipient is recorded as `Unknown`, which many routes reject.

### Region-Specific Bank Fields

| Region | Account Field | Additional Field |
| - | - | - |
| India | `receiver.bank.account.id` | `receiver.bank.ifsc` |
| Mexico | `receiver.bank.account.id` with 18-digit CLABE | None |
| Argentina | `receiver.bank.account.id` with CBU/CVU | Optional `receiver.bank.code` |
| Turkey | `receiver.bank.account.id` with IBAN | None |

`receiver.bank.clabe` is not part of the current request DTO. For Mexico, send the CLABE in `receiver.bank.account.id`.

### Tracking

The create response returns your `c_id`, a 123hub `h_id`, and, when available, an opaque provider `p_id`. Use `c_id` or `h_id` with `payment.status`; payout webhooks also include these identifiers under `data.result.payment.identifiers`.

Provider-specific callback fields such as `order_id`, `transaction_id`, `session_token`, or `user_id` are not part of the public API contract.

### Example

```json theme={null}
{
  "method": "payment.out",
  "service_id": 14702,
  "params": {
    "payment": {
      "description": "Payout #67890",
      "identifiers": { "c_id": "payout-67890" },
      "amount": { "value": 50000, "currency": "INR" },
      "receiver": {
        "bank": {
          "account": { "id": "1234567890" },
          "ifsc": "SBIN0001234"
        },
        "email": "recipient@example.com",
        "phone": "9876543210",
        "person": { "first_name": "Jane", "last_name": "Doe" }
      }
    }
  }
}
```

## `payment.status`

Returns the current payment state.

```json theme={null}
{
  "method": "payment.status",
  "params": {
    "payment": {
      "identifiers": { "c_id": "order-12345" }
    }
  }
}
```

At least one lookup identifier is required (otherwise `1005`). If both are sent, `h_id` is used.
`service_id` is not required.

| Identifier | Supported | Notes |
| - | :-: | - |
| `c_id` | Yes | Merchant reference |
| `h_id` | Yes | Hub payment ID |
| `p_id` | No | Returned in responses only; sending it is rejected with `9000` |

## `payment.notification`

Queues a webhook re-delivery for a payment and returns the same payment result shape as `payment.status`.

The delivered merchant webhook uses the same envelope as automatic lifecycle webhooks: `data.success`, `data.result.payment`, `data.next: null`, `data.request_id`, and `data.processing_time`. The public webhook `id` stays payment/event-stable; durable delivery idempotency uses `operation_id` when supplied.

```json theme={null}
{
  "method": "payment.notification",
  "operation_id": "notification-retry-1001",
  "params": {
    "payment": {
      "identifiers": { "h_id": "pay_1774892151645_abcd" }
    }
  }
}
```

`operation_id` is optional but recommended. Reuse it only for an exact retry; a
changed intent needs a new value. Without it, the compatibility identity is
derived from the payment, canonical request and current minute. The method is
limited to 10 requests per minute. `service_id` is optional; stored payment
metadata is preferred.

## `balance.get`

Returns balances for the authenticated merchant.

`value_blocking` and `enabled` are currently constant runtime compatibility fields: `value_blocking` is always `0`, and `enabled` is always `true` at both the balance and currency levels.

```json theme={null}
{
  "method": "balance.get",
  "params": {}
}
```

Response:

```json theme={null}
{
  "success": true,
  "result": {
    "balance": {
      "id": 0,
      "amounts": [
        {
          "value": 150000,
          "value_freezing": 25000,
          "value_blocking": 0,
          "currency": "INR",
          "enabled": true
        }
      ],
      "enabled": true
    }
  },
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "processing_time": 15
}
```

All balance values are integers in minor units.

## `gateway.ping`

Validates authentication and connectivity.

```json theme={null}
{
  "method": "gateway.ping",
  "params": {}
}
```

Response:

```json theme={null}
{
  "success": true,
  "result": { "message": "pong" },
  "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "processing_time": 5
}
```

## Payment Response Object

| Field | Type | Description |
| - | - | - |
| `payment.payer` | object | Present for deposits when customer data is known. In `payment.status` and webhooks, `person` is rebuilt from the stored full name (first word → `first_name`, rest → `last_name`) |
| `payment.receiver` | object | Deposits: where the payer pays (fields below). Withdrawals: recipient name and contacts; `receiver.bank` is echoed only in the create response |
| `payment.receiver.bank_account.id` | string | Deposit account number, IBAN, CBU or CLABE when supplied by the provider |
| `payment.receiver.bank_account.name` | string | Deposit account holder name |
| `payment.receiver.bank.name` | string | Deposit bank or payment-network name |
| `payment.receiver.bank.code` | string | Deposit bank or payment-network code |
| `payment.receiver.phone` | string | P2P receiver phone when required to complete the deposit |
| `payment.receiver.document.type` | string | Receiver document type, for example `cedula` |
| `payment.receiver.document.number` | string | Receiver document number |
| `payment.receiver.qr_payload` | string | Provider-issued QR payload, capped at 4096 characters |
| `payment.amount.value` | integer | Amount in minor units |
| `payment.amount.currency` | string | ISO 4217 code |
| `payment.description` | string | Description when available |
| `payment.identifiers.c_id` | string | Merchant reference |
| `payment.identifiers.h_id` | string | Hub payment ID |
| `payment.identifiers.p_id` | string | Provider reference when available |
| `payment.identifiers.utr` | string | Bank/provider tracking reference when available |
| `payment.redirect.to` | string or string\[] | Payment URL or payment-app deep links |
| `payment.redirect.on_success` / `on_fail` | string | Create response: your request values echoed back. Status/webhooks: only when the route returns them |
| `payment.status` | object | Current status and optional history |
| `payment.timestamps` | object | `created`, `updated`, and terminal `finished` timestamps when available |
| `payment.destination` | string | `in` or `out` |
| `payment.operations` | array | Operation records derived from the payment |
| `payment.service_id` | integer | Route ID when known |
| `operation` | object | Shortcut to the primary operation |

## Status Values

| Status | Final | Success | Internal Source |
| - | :-: | :-: | - |
| `created` | No | `null` | `created`, `pending` |
| `processing` | No | `null` | `processing` |
| `success` | Yes | `true` | `completed` |
| `error` | Yes | `false` | `failed` |
| `canceled` | Yes | `false` | `cancelled` |
| `declined` | Yes | `false` | `expired` |
| `refunded` | Yes | `true` | `refunded` |
| `partially_refunded` | Yes | `true` | `partial_refund` |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.