> ## 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.

# 🇹🇷 Turkey

> Deposits and withdrawals in Turkey (TRY): methods, required fields, request and response examples.

Everything you need to accept and pay out TRY in Turkey. Signing, statuses and
webhooks work the same in every country — see the links at the bottom of the page.

## At a glance

| | |
| - | - |
| Currency | `TRY` — 2 decimal places; `amount.value: 100000` means ₺1,000.00 |
| Deposit methods | `havale`, `deposit_pp`, `kredikarti` |
| Withdrawals | IBAN |
| Unpaid deposit expires | 10–30 minutes depending on the route |
| Limits and `service_id` | Set per route — issued by your account manager |

## Choose a method

The method is fixed by the `service_id` you send; you never send a method code.

| If | Use | You get back |
| - | - | - |
| You show bank details on your own page | `havale` host-to-host | IBAN, account holder and bank name |
| You prefer a ready payment page | `havale` page or `deposit_pp` | An HTTPS page to redirect to |
| Card payments | `kredikarti` | An HTTPS card page |

## Deposit

A complete request with this country's values filled in. Replace `service_id` (`100001` here) with the one
issued for the method you chose.

payment.in
Build a deposit request

Body
cURL

<pre />

Copy sends the body as one line — sign and send exactly that string.

<details>
  <summary>Sign with a test key</summary>

  Computed in your browser; the key is never sent anywhere. Use test credentials only.
</details>

```bash cURL theme={null}
BODY='{"method":"payment.in","service_id":100001,"params":{"payment":{"description":"Order #12345","identifiers":{"c_id":"order-12345"},"amount":{"value":100000,"currency":"TRY"},"payer":{"email":"customer@example.com","phone":"5321234567","person":{"first_name":"Mehmet","last_name":"Yilmaz"},"customer_account":{"id":"player-1001"}}}}}'
HASH=$(printf '%s%s' "$BODY" "YOUR_SECRET_KEY" | sha512sum | awk '{print $1}')

curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: YOUR_APPLICATION_ID" \
  -H "X-Data-Hash: $HASH" \
  --data-binary "$BODY"
```

```python Python theme={null}
import hashlib, json, requests

payload = {
    "method": "payment.in",
    "service_id": 100001,
    "params": {
        "payment": {
            "description": "Order #12345",
            "identifiers": {
                "c_id": "order-12345"
            },
            "amount": {
                "value": 100000,
                "currency": "TRY"
            },
            "payer": {
                "email": "customer@example.com",
                "phone": "5321234567",
                "person": {
                    "first_name": "Mehmet",
                    "last_name": "Yilmaz"
                },
                "customer_account": {
                    "id": "player-1001"
                }
            }
        }
    }
}

body = json.dumps(payload, separators=(",", ":"), ensure_ascii=False)
headers = {
    "Content-Type": "application/json",
    "X-Data-Application-Id": "YOUR_APPLICATION_ID",
    "X-Data-Hash": hashlib.sha512((body + "YOUR_SECRET_KEY").encode()).hexdigest(),
}
print(requests.post("https://api.bafanglaicai88.com/public/api/multihub/v1", data=body.encode(), headers=headers, timeout=30).json())
```

```javascript Node.js theme={null}
const crypto = require('crypto');

const payload = {
  method: 'payment.in',
  service_id: 100001,
  params: {
    payment: {
      description: 'Order #12345',
      identifiers: {
        c_id: 'order-12345'
      },
      amount: {
        value: 100000,
        currency: 'TRY'
      },
      payer: {
        email: 'customer@example.com',
        phone: '5321234567',
        person: {
          first_name: 'Mehmet',
          last_name: 'Yilmaz'
        },
        customer_account: {
          id: 'player-1001'
        }
      }
    }
  }
};

const body = JSON.stringify(payload);
const res = await fetch('https://api.bafanglaicai88.com/public/api/multihub/v1', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Data-Application-Id': 'YOUR_APPLICATION_ID',
    'X-Data-Hash': crypto.createHash('sha512').update(body + 'YOUR_SECRET_KEY').digest('hex'),
  },
  body,
});
console.log(await res.json());
```

### Request fields

Fields are inside `params.payment` unless shown at the top level.

| Field | Type | Required | Description |
| - | - | - | - |
| `service_id` | integer | Yes | Route issued for the method you chose |
| `method` | string | Yes | `payment.in` |
| `description` | string | No | Shown to the payer where the route supports it (max 1024) |
| `identifiers.c_id` | string | Yes | Your unique order ID (max 255); also the idempotency key. A request rejected during processing uses it up — retry with a new `c_id` |
| `amount.value` | integer | Yes | Amount in minor units |
| `amount.currency` | string | Yes | `TRY` |
| `payer.email` | string | Recommended | Payer email (valid address, max 255) |
| `payer.phone` | string | Recommended | Payer phone (max 50) |
| `payer.person.first_name` | string | Recommended | Payer first name only (max 255); routes receive first and last name as separate fields |
| `payer.person.last_name` | string | Recommended | Payer last name only (max 255) |
| `payer.customer_account.id` | string | Recommended | Your stable player ID (max 255) |
| `payer.custom_fields.tcid` | string | Only on routes your account manager flags | 11-digit TC identity number. Not taken from `payer.person` |
| `payer.custom_fields.first_name` | string | Same routes as `tcid` | Payer name. Withdrawals on those routes need the same keys in `receiver.custom_fields` |
| `payer.custom_fields.last_name` | string | Same routes as `tcid` | Payer name. Withdrawals on those routes need the same keys in `receiver.custom_fields` |
| `redirect.on_success` | string | No | Echoed back in the create response only; currently not passed to the payment page |
| `redirect.on_fail` | string | No | Echoed back in the create response only; currently not passed to the payment page |

Fields marked **Yes** are required for this country. Do not send `custom_fields` that are not listed here.

### Response fields

Fields are inside `result.payment` unless shown at the top level.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | `true` when the request was accepted; on `false` read `error.code`, see [Errors](https://prod-docs.123hub.pro/errors/error-codes.md) |
| `identifiers.c_id` | string | Your order ID |
| `identifiers.h_id` | string | 123hub payment ID — store it |
| `identifiers.p_id` | string | Provider reference, when available |
| `amount` | object | `value` (minor units), `currency` |
| `status.status` | string | `created` or `processing` right after creation, then a final status — see [Statuses](https://prod-docs.123hub.pro/guides/payments.md#payment-statuses) |
| `status.final / success` | boolean | `final: true` once the status will not change; `success` tells whether it succeeded |
| `redirect.to` | string | Where the payer completes the payment. Returned for: Payment page. Absent for: Havale host-to-host. |
| `receiver.bank_account` | object | `id` — account, IBAN, CBU/CVU, CLABE or VPA to pay to (on push flows: an instruction text); `name` — holder |
| `receiver.bank` | object | `name`, `code` — receiving bank, wallet or operator |
| `timestamps` | object | `created`, `updated` |
| `destination` | string | `in` for deposits |
| `request_id` | string | Request ID — quote it to support |

### What to show the payer

**Havale host-to-host.** No `redirect`. Show `receiver.bank_account.id` (IBAN), `receiver.bank_account.name` (holder) and `receiver.bank.name` to the payer.

> [accordion] Full response example
>
> ```json theme={null}
> {
>   "success": true,
>   "result": {
>     "payment": {
>       "payer": {
>         "customer_account": {
>           "id": "doctest-tr-1"
>         },
>         "email": "customer@example.com",
>         "phone": "5321234567",
>         "person": {
>           "first_name": "Mehmet",
>           "last_name": "Yilmaz"
>         }
>       },
>       "receiver": {
>         "bank_account": {
>           "id": "TR190001009011193774305001",
>           "name": "Valida Samadova"
>         },
>         "bank": {
>           "name": "Ziraat Bank"
>         }
>       },
>       "amount": {
>         "value": 50000,
>         "currency": "TRY"
>       },
>       "identifiers": {
>         "c_id": "order-12345",
>         "h_id": "d58ffe6f-dd9f-41d3-9a57-a762e0c0e856",
>         "p_id": "d58ffe6f-dd9f-41d3-9a57-a762e0c0e856"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null,
>         "history": [
>           {
>             "status": "created",
>             "final": false,
>             "success": null,
>             "created": "2026-10-20T17:38:39.987Z",
>             "reason": null,
>             "amount": 50000
>           },
>           {
>             "status": "processing",
>             "final": false,
>             "success": null,
>             "created": "2026-10-20T17:38:39.987Z",
>             "reason": null,
>             "amount": 50000
>           }
>         ]
>       },
>       "timestamps": {
>         "created": "2026-10-20T17:38:39.987Z",
>         "updated": "2026-10-20T17:38:39.987Z"
>       },
>       "destination": "in",
>       "operations": [
>         {
>           "id": "d58ffe6f-dd9f-41d3-9a57-a762e0c0e856",
>           "operation_type": "payment.in",
>           "amount": {
>             "value": 50000,
>             "currency": "TRY"
>           },
>           "timestamps": {
>             "created": "2026-10-20T17:38:39.987Z"
>           },
>           "status": {
>             "status": "processing",
>             "final": false,
>             "success": null,
>             "error": null
>           }
>         }
>       ]
>     },
>     "operation": {
>       "id": "d58ffe6f-dd9f-41d3-9a57-a762e0c0e856",
>       "operation_type": "payment.in",
>       "amount": {
>         "value": 50000,
>         "currency": "TRY"
>       },
>       "timestamps": {
>         "created": "2026-10-20T17:38:39.987Z"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null
>       }
>     }
>   },
>   "processing_time": 586,
>   "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
> }
> ```

**Payment page.** `redirect.to` is the payment page; redirect the payer.

> [accordion] Full response example
>
> ```json theme={null}
> {
>   "success": true,
>   "result": {
>     "payment": {
>       "payer": {
>         "customer_account": {
>           "id": "doctest-tr-1"
>         },
>         "email": "customer@example.com",
>         "phone": "5321234567",
>         "person": {
>           "first_name": "Mehmet",
>           "last_name": "Yilmaz"
>         }
>       },
>       "receiver": {},
>       "amount": {
>         "value": 50000,
>         "currency": "TRY"
>       },
>       "identifiers": {
>         "c_id": "order-12345",
>         "h_id": "bff468fd-2c93-4f66-bd39-1236fe7feb5e",
>         "p_id": "bff468fd-2c93-4f66-bd39-1236fe7feb5e"
>       },
>       "redirect": {
>         "to": "https://pay.example.com/checkout/8f3c2a91"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null,
>         "history": [
>           {
>             "status": "created",
>             "final": false,
>             "success": null,
>             "created": "2026-10-20T17:38:41.504Z",
>             "reason": null,
>             "amount": 50000
>           },
>           {
>             "status": "processing",
>             "final": false,
>             "success": null,
>             "created": "2026-10-20T17:38:41.504Z",
>             "reason": null,
>             "amount": 50000
>           }
>         ]
>       },
>       "timestamps": {
>         "created": "2026-10-20T17:38:41.504Z",
>         "updated": "2026-10-20T17:38:41.504Z"
>       },
>       "destination": "in",
>       "operations": [
>         {
>           "id": "bff468fd-2c93-4f66-bd39-1236fe7feb5e",
>           "operation_type": "payment.in",
>           "amount": {
>             "value": 50000,
>             "currency": "TRY"
>           },
>           "timestamps": {
>             "created": "2026-10-20T17:38:41.504Z"
>           },
>           "status": {
>             "status": "processing",
>             "final": false,
>             "success": null,
>             "error": null
>           }
>         }
>       ]
>     },
>     "operation": {
>       "id": "bff468fd-2c93-4f66-bd39-1236fe7feb5e",
>       "operation_type": "payment.in",
>       "amount": {
>         "value": 50000,
>         "currency": "TRY"
>       },
>       "timestamps": {
>         "created": "2026-10-20T17:38:41.504Z"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null
>       }
>     }
>   },
>   "processing_time": 314,
>   "request_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
> }
> ```

## Withdrawal

### Request fields

Fields are inside `params.payment` unless shown at the top level.

| Field | Type | Required | Description |
| - | - | - | - |
| `service_id` | integer | Yes | Withdrawal route issued by your account manager |
| `method` | string | Yes | `payment.out` |
| `description` | string | No | Your note for the withdrawal |
| `identifiers.c_id` | string | Yes | Your unique withdrawal ID (max 255); also the idempotency key. A request rejected during processing uses it up — retry with a new `c_id` |
| `amount.value` | integer | Yes | Amount in minor units |
| `amount.currency` | string | Yes | `TRY` |
| `receiver.bank.account.id` | string | Yes | IBAN `TR` + 24 digits (checksum-validated by the bank) |
| `receiver.bank.code` | string | No | Bank or wallet code (max 50) |
| `receiver.custom_fields.tcid` | string | Only on flagged routes | As on deposits |
| `receiver.custom_fields.first_name / last_name` | string | Only on flagged routes | As on deposits |
| `receiver.email` | string | No | Recipient email |
| `receiver.phone` | string | No | Recipient phone |
| `receiver.person.first_name` | string | Yes in practice | Account holder name |
| `receiver.person.last_name` | string | Yes in practice | Account holder name |
| `receiver.customer_account.id` | string | No | Your stable recipient ID (max 255) |

### Request

payment.out
Build a withdrawal request

Body
cURL

<pre />

Copy sends the body as one line — sign and send exactly that string.

<details>
  <summary>Sign with a test key</summary>

  Computed in your browser; the key is never sent anywhere. Use test credentials only.
</details>

```bash cURL theme={null}
BODY='{"method":"payment.out","service_id":100002,"params":{"payment":{"description":"Withdrawal #987","identifiers":{"c_id":"payout-987"},"amount":{"value":100000,"currency":"TRY"},"receiver":{"bank":{"account":{"id":"TR330006100519786457841326"}},"person":{"first_name":"Mehmet","last_name":"Yilmaz"}}}}}'
HASH=$(printf '%s%s' "$BODY" "YOUR_SECRET_KEY" | sha512sum | awk '{print $1}')

curl -X POST "https://api.bafanglaicai88.com/public/api/multihub/v1" \
  -H "Content-Type: application/json" \
  -H "X-Data-Application-Id: YOUR_APPLICATION_ID" \
  -H "X-Data-Hash: $HASH" \
  --data-binary "$BODY"
```

```python Python theme={null}
import hashlib, json, requests

payload = {
    "method": "payment.out",
    "service_id": 100002,
    "params": {
        "payment": {
            "description": "Withdrawal #987",
            "identifiers": {
                "c_id": "payout-987"
            },
            "amount": {
                "value": 100000,
                "currency": "TRY"
            },
            "receiver": {
                "bank": {
                    "account": {
                        "id": "TR330006100519786457841326"
                    }
                },
                "person": {
                    "first_name": "Mehmet",
                    "last_name": "Yilmaz"
                }
            }
        }
    }
}

body = json.dumps(payload, separators=(",", ":"), ensure_ascii=False)
headers = {
    "Content-Type": "application/json",
    "X-Data-Application-Id": "YOUR_APPLICATION_ID",
    "X-Data-Hash": hashlib.sha512((body + "YOUR_SECRET_KEY").encode()).hexdigest(),
}
print(requests.post("https://api.bafanglaicai88.com/public/api/multihub/v1", data=body.encode(), headers=headers, timeout=30).json())
```

```javascript Node.js theme={null}
const crypto = require('crypto');

const payload = {
  method: 'payment.out',
  service_id: 100002,
  params: {
    payment: {
      description: 'Withdrawal #987',
      identifiers: {
        c_id: 'payout-987'
      },
      amount: {
        value: 100000,
        currency: 'TRY'
      },
      receiver: {
        bank: {
          account: {
            id: 'TR330006100519786457841326'
          }
        },
        person: {
          first_name: 'Mehmet',
          last_name: 'Yilmaz'
        }
      }
    }
  }
};

const body = JSON.stringify(payload);
const res = await fetch('https://api.bafanglaicai88.com/public/api/multihub/v1', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-Data-Application-Id': 'YOUR_APPLICATION_ID',
    'X-Data-Hash': crypto.createHash('sha512').update(body + 'YOUR_SECRET_KEY').digest('hex'),
  },
  body,
});
console.log(await res.json());
```

### Response fields

Fields are inside `result.payment` unless shown at the top level.

| Field | Type | Description |
| - | - | - |
| `success` | boolean | `true` when the withdrawal was accepted; on `false` read `error.code` |
| `identifiers.c_id` / `h_id` | string | Your withdrawal ID / 123hub payment ID |
| `amount` | object | `value` (minor units), `currency` |
| `status.status` | string | `created` or `processing` at first; the final status arrives by webhook |
| `receiver.bank` | object | Echo of the recipient account you sent — in this create response only; `payment.status` and webhooks do not return it |
| `destination` | string | `out` for withdrawals |

> [accordion] Full response example
>
> ```json theme={null}
> {
>   "success": true,
>   "result": {
>     "payment": {
>       "receiver": {
>         "email": "mehmet@test.com",
>         "phone": "905551234567",
>         "person": { "first_name": "Mehmet", "last_name": "Yilmaz" },
>         "bank": {
>           "account": { "id": "TR330006100519786457841326" }
>         }
>       },
>       "amount": { "value": 10000, "currency": "TRY" },
>       "identifiers": {
>         "c_id": "your-payout-id",
>         "h_id": "7fdfc6f1-a302-4b7b-9585-b3fd677415ce",
>         "p_id": "e77e2693-d9ee-4ce5-ad33-ba07ea9c0801"
>       },
>       "status": {
>         "status": "processing",
>         "final": false,
>         "success": null,
>         "error": null,
>         "history": [
>           { "status": "created", "final": false, "success": null, "created": "2026-04-02T08:37:54.885Z", "reason": null, "amount": 10000 }
>         ]
>       },
>       "timestamps": { "created": "2026-04-02T08:37:54.885Z" },
>       "destination": "out",
>       "operations": [{
>         "id": "7fdfc6f1-a302-4b7b-9585-b3fd677415ce",
>         "operation_type": "payment.out",
>         "amount": { "value": 10000, "currency": "TRY" },
>         "timestamps": { "created": "2026-04-02T08:37:54.885Z" },
>         "status": { "status": "processing", "final": false, "success": null, "error": null }
>       }],
>       "service_id": 13101
>     },
>     "operation": {
>       "id": "7fdfc6f1-a302-4b7b-9585-b3fd677415ce",
>       "operation_type": "payment.out",
>       "amount": { "value": 10000, "currency": "TRY" },
>       "timestamps": { "created": "2026-04-02T08:37:54.885Z" },
>       "status": { "status": "processing", "final": false, "success": null, "error": null }
>     }
>   },
>   "request_id": "2da38a4f-d9d4-4487-9ce1-950abbd001d1",
>   "processing_time": 5687
> }
> ```

The first response is `created` or `processing`; the final status arrives by [webhook](https://prod-docs.123hub.pro/guides/webhooks.md) or
[`payment.status`](https://prod-docs.123hub.pro/guides/payments#checking-payment-status-payment-status).

## Test it

Use the test application and `service_id` values your account manager issues. A test deposit stays
`processing` until it is paid or expires; ask your account manager to complete or fail it when you
need to see the webhook. See [Testing](https://prod-docs.123hub.pro/guides/testing.md).

## Things to know

> [!WARNING]
>
> * Some routes accept whole lira only for bank-transfer deposits.
> * The paid amount can differ from the requested one. Reconcile with the amount in the webhook.
> * Some routes close an unpaid deposit after 10 minutes.

## Next steps

> [card] [Webhooks](https://prod-docs.123hub.pro/guides/webhooks.md)
>
> Receive and verify status updates.

> [card] [Statuses](https://prod-docs.123hub.pro/guides/payments.md#payment-statuses)
>
> What each status means.

> [card] [Errors](https://prod-docs.123hub.pro/errors/error-codes.md)
>
> Codes and what to do.

> [card] [Go-live checklist](https://prod-docs.123hub.pro/go-live.md)
>
> Before your first real payment.


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