# Bank card This method initiates a **payout to a bank card**. Send a request to the `init_payout` endpoint with `payout_type=card`. The final status is sent to `notify_url` configured in the project payout settings; you can also poll status via [Payout status](./status.md). Request and signature format — see [API request format](../init-request.md). ## How it works 1. **Request** — your server sends a signed request to `init_payout` with card details and the payout amount. 2. **Response** — the API returns `order_id` and initial `status` (`2`, `PENDING`). 3. **Processing** — the system processes the payout; for partial crediting, an intermediate `PENDING` status is possible with `paid_amount` in the callback. 4. **Notification (callback)** — the final status is sent as **POST** JSON to your `notify_url`. See [Transaction statuses](../transaction-statuses.md) for `status` and `status_description` codes. ## Technical details | | | | --- | --- | | **Endpoint** | `https://api.1payment.com/init_payout` | | **Methods** | `GET`, `POST` | | **Response format** | JSON | | **Payout type** | The request must include `payout_type=card` (see [Payout types](../payout-types.md)) | ## Request parameters ### Required | Parameter | Type | Description | | --- | --- | --- | | `payout_type` | String | Always `card`. | | `partner_id` | Integer | Your unique ID in the 1Payment system. | | `project_id` | Integer | Your project identifier. | | `amount` | Number | Payout amount in the project currency (for example, `50`). | | `destination` | String | Recipient bank card number. | | `user_data` | String | Your internal payout ID (unique on the partner side). | | `receiver_country` | String | Recipient country per passport, ISO 3166-1 alpha-2 code (for example, `RU`). | | `sign` | String | Request signature (see the Signature section). | ### Recipient parameters (by agreement) Confirm whether these are required with your 1Payment account manager: | Parameter | Type | Description | | --- | --- | --- | | `first_name` | String | Recipient first name. | | `last_name` | String | Recipient last name. | | `card_holder` | String | Cardholder name as on the card. | ### Optional | Parameter | Type | Description | | --- | --- | --- | | `year` | String | Card expiry year, last two digits (for example, `26`). | | `month` | String | Card expiry month (for example, `01`). | | `email` | String | Recipient email. | | `receiver_city` | String | Recipient city of residence. | | `receiver_address` | String | Recipient address of residence. | | `receiver_zip` | String | Recipient postal code. | ## Signature (`sign`) Signature: MD5, lowercase (hex). General rules — [API request format](../init-request.md#подпись-запроса-sign). **Formula:** ```text MD5(init_payout + + ) ``` **Example string before hashing:** ```text init_payoutamount=50&destination=1234123412341234&partner_id=1234&payout_type=card&project_id=5678&user_data=1secret_key ``` ### Verify signature in the documentation {% signatureVerifier method="init_payout" preset="card_init_payout" /%} ## Request examples {% codeTabs %} {% tab label="Node.js" %} ```javascript const crypto = require('crypto'); const axios = require('axios'); async function createCardPayout(apiKey, params) { // 1. Сортируем параметры по алфавиту const sortedKeys = Object.keys(params).sort(); const queryString = sortedKeys.map((key) => `${key}=${params[key]}`).join('&'); // 2. Подпись с префиксом init_payout const baseString = `init_payout${queryString}${apiKey}`; params.sign = crypto.createHash('md5').update(baseString).digest('hex'); // 3. GET-запрос const response = await axios.get('https://api.1payment.com/init_payout', { params }); return response.data; } const apiKey = process.env.ONEPAYMENT_API_KEY; const data = { payout_type: 'card', partner_id: 1234, project_id: 5678, amount: 50, destination: '1234123412341234', user_data: '1', receiver_country: 'RU', }; createCardPayout(apiKey, data).then(console.log); ``` {% /tab %} {% tab label="Python" %} ```python import hashlib import os import requests def create_card_payout(api_key: str, params: dict) -> dict: # 1. Сортировка параметров по алфавиту sorted_keys = sorted(params.keys()) query_string = "&".join(f"{k}={params[k]}" for k in sorted_keys) # 2. Подпись init_payout base_string = f"init_payout{query_string}{api_key}" params["sign"] = hashlib.md5(base_string.encode("utf-8")).hexdigest() # 3. GET-запрос response = requests.get("https://api.1payment.com/init_payout", params=params) response.raise_for_status() return response.json() api_key = os.environ["ONEPAYMENT_API_KEY"] data = { "payout_type": "card", "partner_id": 1234, "project_id": 5678, "amount": 50, "destination": "1234123412341234", "user_data": "1", "receiver_country": "RU", } print(create_card_payout(api_key, data)) ``` {% /tab %} {% tab label="PHP" %} ```php $v) { if ($k === 'sign') { continue; } $tail .= "{$k}={$v}&"; } $tail = substr($tail, 0, -1); // 2. Формирование подписи (префикс init_payout) $params['sign'] = md5('init_payout' . $tail . $apiKey); // 3. Запрос к API $url = 'https://api.1payment.com/init_payout?' . http_build_query($params); $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); return $response; } // Пример данных запроса $apiKey = getenv('ONEPAYMENT_API_KEY'); $data = [ 'payout_type' => 'card', 'partner_id' => 1234, 'project_id' => 5678, 'amount' => 50, 'destination' => '1234123412341234', 'user_data' => '1', 'receiver_country' => 'RU', ]; echo createCardPayout($apiKey, $data); ``` {% /tab %} {% tab label="cURL" %} ```bash # 1–2. Подпись: md5("init_payout" + amount=50&destination=1234123412341234&partner_id=1234&payout_type=card&project_id=5678&receiver_country=RU&user_data=1 + API_KEY) curl -sS "https://api.1payment.com/init_payout?payout_type=card&partner_id=1234&project_id=5678&amount=50&destination=1234123412341234&user_data=1&receiver_country=RU&sign=PASTE_MD5_HEX" ``` {% /tab %} {% /codeTabs %} ## API response Successful response (`200`): ```json { "order_id": "8p3brmb19gfg0sg8gcwhws8kgc748s87", "status": 2, "status_description": "PENDING", "status_code": 0 } ``` | Field | Description | | --- | --- | | `order_id` | Payout ID in the 1Payment system; use for [status requests](./status.md). | | `status` | Numeric status code: `2` — pending, `3` — success, `4` — declined. | | `status_description` | `PENDING`, `SUCCESS`, or `FAILURE`. | | `status_code` | Decline reason code (when `status` = `4`); see [Error codes (declines)](../decline-error-codes.md). | Request error (`400`): ```json { "error_code": 2 } ``` ## Status notifications (callbacks) After the payout reaches a **final** status, a **POST** notification in JSON format is sent to your `notify_url` (from project payout settings). | Parameter | Type | Description | | --- | --- | --- | | `payout_type` | String | Payout type (`card`; see [Payout types](../payout-types.md)). | | `project_id` | Integer | Your project ID. | | `order_id` | String | Payout ID from the initiation response. | | `status` | Integer | `2` — pending, `3` — successful payout, `4` — declined. | | `status_description` | String | `PENDING`, `SUCCESS`, or `FAILURE`. | | `init_time` | String | Payout creation time. | | `status_time` | String | Time the status was received. | | `amount` | String | Payout amount. | | `balance_amount` | String | Amount debited from balance. | | `destination` | String | Recipient; for card payouts — masked card number. | | `status_code` | Integer | Decline reason code (when `status` = `4`). | | `paid_amount` | String | Only when `status` = `2` (`PENDING`) and partial payout: cumulative partial payout amount at the moment. | | `init_amount` | String | Only when `status` = `3` (`SUCCESS`) and initiation amount differs from payout amount: initiation amount; `amount` and `balance_amount` contain actual processed amounts. | | `sign` | String | Callback signature. | **Important:** your server must return **HTTP 200 OK**. Otherwise the system retries the callback **once per minute for 10 minutes**. **Callback signature verification:** MD5 of all parameters in alphabetical order joined with `&` + `API_KEY` (**without** the `init_payout` prefix). See [API request format](../init-request.md#колбеки-уведомления) for details. ## Related sections - [Payout status](./status.md) - [PIX](./pix.md) - [SEPA](./sepa.md) - [FPS](./fps.md) - [SBP payout](./sbp.md) - [Payout types](../payout-types.md) - [Transaction statuses](../transaction-statuses.md) - [Error codes (API)](../error-codes-api.md) - [Error codes (declines)](../decline-error-codes.md)