# Payout status This method returns the **current status** of a payout by the identifier from the initiation response (`order_id`) or by your `user_data` if `order_id` was not saved. Use it to poll status after creating a payout, and when callback delivery fails. Request and signature format — see [API request format](../init-request.md). ## How it works 1. **Identification** — pass `order_id` (from the payout creation response) **or** `user_data` (payout ID on your side). 2. **Request** — the server sends a signed request to the `status_payout` endpoint. 3. **Response** — the API returns JSON with the current `status`, amounts, recipient details, and if needed additional fields `paid_amount` or `init_amount`. See [Transaction statuses](../transaction-statuses.md) for `status` and `status_description` codes. ## Technical details | | | | --- | --- | | **Endpoint** | `https://api.1payment.com/status_payout` | | **Methods** | `GET`, `POST` | | **Response format** | JSON | | **Type in response** | `payout_type` field — see [Payout types](../payout-types.md) | ## Request parameters ### Required | Parameter | Type | Description | | --- | --- | --- | | `partner_id` | Integer | Your unique ID in the 1Payment system. | | `project_id` | Integer | Your project identifier. | | `sign` | String | Request signature (see the Signature section). | ### Payout identification Pass **one** of the following parameters: | Parameter | Type | Description | | --- | --- | --- | | `order_id` | String | Payout ID in 1Payment (from the initiation response). | | `user_data` | String | Your payout ID; used when `order_id` is not specified. | ## Signature (`sign`) Signature: MD5, lowercase (hex). General rules — [API request format](../init-request.md#подпись-запроса-sign). **Formula:** ```text MD5(status_payout + + ) ``` **Example string before hashing** (lookup by `order_id`): ```text status_payoutorder_id=8p3brmb19gfg0sg8gcwhws8kgc748s87&partner_id=1234&project_id=5678secret_key ``` ### Verify signature in the documentation {% signatureVerifier method="status_payout" preset="status_payout" /%} ## Request examples {% codeTabs %} {% tab label="Node.js" %} ```javascript const crypto = require('crypto'); const axios = require('axios'); async function getPayoutStatus(apiKey, params) { // 1. Сортируем параметры по алфавиту const sortedKeys = Object.keys(params).sort(); const queryString = sortedKeys.map((key) => `${key}=${params[key]}`).join('&'); // 2. Подпись с префиксом status_payout const baseString = `status_payout${queryString}${apiKey}`; params.sign = crypto.createHash('md5').update(baseString).digest('hex'); // 3. GET-запрос const response = await axios.get('https://api.1payment.com/status_payout', { params }); return response.data; } const apiKey = process.env.ONEPAYMENT_API_KEY; const data = { partner_id: 1234, project_id: 5678, order_id: '8p3brmb19gfg0sg8gcwhws8kgc748s87', }; getPayoutStatus(apiKey, data).then(console.log); ``` {% /tab %} {% tab label="Python" %} ```python import hashlib import os import requests def get_payout_status(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. Подпись status_payout base_string = f"status_payout{query_string}{api_key}" params["sign"] = hashlib.md5(base_string.encode("utf-8")).hexdigest() # 3. GET-запрос response = requests.get("https://api.1payment.com/status_payout", params=params) response.raise_for_status() return response.json() api_key = os.environ["ONEPAYMENT_API_KEY"] data = { "partner_id": 1234, "project_id": 5678, "order_id": "8p3brmb19gfg0sg8gcwhws8kgc748s87", } print(get_payout_status(api_key, data)) ``` {% /tab %} {% tab label="PHP" %} ```php $v) { if ($k === 'sign') { continue; } $tail .= "{$k}={$v}&"; } $tail = substr($tail, 0, -1); // 2. Формирование подписи (префикс status_payout) $params['sign'] = md5('status_payout' . $tail . $apiKey); // 3. Запрос к API $url = 'https://api.1payment.com/status_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 = [ 'partner_id' => 1234, 'project_id' => 5678, 'order_id' => '8p3brmb19gfg0sg8gcwhws8kgc748s87', ]; echo getPayoutStatus($apiKey, $data); ``` {% /tab %} {% tab label="cURL" %} ```bash # 1–2. Подпись: md5("status_payout" + order_id=...&partner_id=1234&project_id=5678 + API_KEY) curl -sS "https://api.1payment.com/status_payout?partner_id=1234&project_id=5678&order_id=8p3brmb19gfg0sg8gcwhws8kgc748s87&sign=PASTE_MD5_HEX" ``` {% /tab %} {% /codeTabs %} ## API response Successful response (`200`): ```json { "payout_type": "card", "project_id": 5678, "order_id": "8p3brmb19gfg0sg8gcwhws8kgc748s87", "user_data": "12345", "status": 3, "status_description": "SUCCESS", "init_time": "2019-04-01 18:01:55", "status_time": "2019-04-01 18:02:59", "amount": "100", "balance_amount": "102.5", "destination": "411111******1111", "status_code": 0 } ``` | Field | Description | | --- | --- | | `payout_type` | Payout type (see [Payout types](../payout-types.md)). | | `project_id` | Your project ID. | | `order_id` | Payout ID in the 1Payment system. | | `user_data` | Identifier passed when creating the payout. | | `status` | Numeric code: `2` — pending, `3` — success, `4` — declined. | | `status_description` | `PENDING`, `SUCCESS`, or `FAILURE`. | | `init_time` | Payout creation time. | | `status_time` | Time the current status was received. | | `amount` | Payout amount. | | `balance_amount` | Amount debited from balance. | | `currency` | Payout currency (ISO 4217). | | `destination` | Recipient; for card payouts — masked card number. | | `status_code` | Decline reason code (when `status` = `4`). | | `paid_amount` | Only when `status` = `2` (`PENDING`) and partial payout: cumulative partial payout amount at the moment. | | `init_amount` | Only when `status` = `3` (`SUCCESS`) and initiation amount differs from payout amount: initiation amount; `amount` and `balance_amount` contain actual processed amounts. | Request error (`400`): ```json { "error_code": 2 } ``` ## Related sections - [Bank card](./card.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)