{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["signatureVerifier","codeTabs","tab"]},"type":"markdown"},"seo":{"title":"Создание инвойса","description":"Документация API 1Payment — приём платежей и выплаты.","llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"создание-инвойса","__idx":0},"children":["Создание инвойса"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Метод позволяет ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["выставить инвойс"]}," (счёт на оплату) и получить ссылку на платёжную форму. Запрос отправляется на эндпоинт ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_invoice"]},". После оплаты или истечения срока действия инвойса финальный статус приходит на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_notify_url"]},", указанный в настройках проекта."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Формат запросов и подписи — в разделе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request"},"children":["Формат запроса к API"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"принцип-работы","__idx":1},"children":["Принцип работы"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Запрос"]}," — ваш сервер отправляет подписанный запрос на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_invoice"]}," с суммой и ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_user_data"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ответ"]}," — API возвращает ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_id"]}," и ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," платёжной страницы."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Оплата"]}," — вы перенаправляете плательщика по ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," или передаёте ссылку иным способом."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Уведомление (колбек)"]}," — при финальном статусе инвойса отправляется ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST"]}," JSON на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_notify_url"]}," проекта."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Расшифровка кодов ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," — в разделе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/transaction-statuses"},"children":["Статусы транзакций"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"техническая-информация","__idx":2},"children":["Техническая информация"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":""},"children":[]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Эндпоинт"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_invoice"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Методы"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Формат ответа"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["JSON"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"параметры-запроса","__idx":3},"children":["Параметры запроса"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"обязательные","__idx":4},"children":["Обязательные"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["partner_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш уникальный ID в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Идентификатор вашего проекта."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма инвойса в валюте проекта (например, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["50"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ваш внутренний ID инвойса (уникальное значение на стороне партнёра)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Контрольная подпись запроса (см. раздел «Подпись»)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"дополнительные","__idx":5},"children":["Дополнительные"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Описание платежа для плательщика."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL возврата плательщика после успешной оплаты."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["failure_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL возврата плательщика после ошибки оплаты."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"формирование-подписи--sign-","__idx":6},"children":["Формирование подписи (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]},")"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Подпись: MD5, lowercase (hex). Общие правила — ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request#%D0%BF%D0%BE%D0%B4%D0%BF%D0%B8%D1%81%D1%8C-%D0%B7%D0%B0%D0%BF%D1%80%D0%BE%D1%81%D0%B0-sign"},"children":["Формат запроса к API"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Формула:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"MD5(init_invoice + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Пример строки до хеширования"]}," (как в архивной документации, без ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_user_data"]}," в минимальном примере):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"init_invoiceamount=50&description=test_payment&partner_id=1234&project_id=5678secret_key\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Если передаёте ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_user_data"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["success_url"]}," и другие поля, они участвуют в строке подписи в алфавитном порядке."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"проверка-подписи-в-документации","__idx":7},"children":["Проверка подписи в документации"]},{"$$mdtype":"Tag","name":"SignatureVerifier","attributes":{"method":"init_invoice","preset":"init_invoice"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"примеры-запроса","__idx":8},"children":["Примеры запроса"]},{"$$mdtype":"Tag","name":"CodeTabs","attributes":{},"children":[{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"Node.js"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"javascript","header":{"controls":{"copy":{}}},"source":"const crypto = require('crypto');\nconst axios = require('axios');\n\nasync function createInvoice(apiKey, params) {\n  // 1. Сортируем параметры по алфавиту\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((key) => `${key}=${params[key]}`).join('&');\n\n  // 2. Подпись с префиксом init_invoice\n  const baseString = `init_invoice${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  // 3. GET-запрос\n  const response = await axios.get('https://api.1payment.com/init_invoice', { params });\n  return response.data;\n}\n\nconst apiKey = process.env.ONEPAYMENT_API_KEY;\nconst data = {\n  partner_id: 1234,\n  project_id: 5678,\n  amount: 50,\n  description: 'test_payment',\n  invoice_user_data: 'inv_12345',\n};\n\ncreateInvoice(apiKey, data).then(console.log);\n","lang":"javascript"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"Python"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"python","header":{"controls":{"copy":{}}},"source":"import hashlib\nimport os\nimport requests\n\ndef create_invoice(api_key: str, params: dict) -> dict:\n    # 1. Сортировка параметров по алфавиту\n    sorted_keys = sorted(params.keys())\n    query_string = \"&\".join(f\"{k}={params[k]}\" for k in sorted_keys)\n\n    # 2. Подпись init_invoice\n    base_string = f\"init_invoice{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n\n    # 3. GET-запрос\n    response = requests.get(\"https://api.1payment.com/init_invoice\", params=params)\n    response.raise_for_status()\n    return response.json()\n\napi_key = os.environ[\"ONEPAYMENT_API_KEY\"]\ndata = {\n    \"partner_id\": 1234,\n    \"project_id\": 5678,\n    \"amount\": 50,\n    \"description\": \"test_payment\",\n    \"invoice_user_data\": \"inv_12345\",\n}\nprint(create_invoice(api_key, data))\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"PHP"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"php","header":{"controls":{"copy":{}}},"source":"<?php\n\nfunction createInvoice(string $apiKey, array $params): string\n{\n    // 1. Сортировка параметров по алфавиту\n    ksort($params, SORT_LOCALE_STRING);\n    $tail = '';\n    foreach ($params as $k => $v) {\n        if ($k === 'sign') {\n            continue;\n        }\n        $tail .= \"{$k}={$v}&\";\n    }\n    $tail = substr($tail, 0, -1);\n\n    // 2. Формирование подписи (префикс init_invoice)\n    $params['sign'] = md5('init_invoice' . $tail . $apiKey);\n\n    // 3. Запрос к API\n    $url = 'https://api.1payment.com/init_invoice?' . http_build_query($params);\n    $ch = curl_init($url);\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n\n    return $response;\n}\n\n// Пример данных запроса\n$apiKey = getenv('ONEPAYMENT_API_KEY');\n$data = [\n    'partner_id' => 1234,\n    'project_id' => 5678,\n    'amount' => 50,\n    'description' => 'test_payment',\n    'invoice_user_data' => 'inv_12345',\n];\n\necho createInvoice($apiKey, $data);\n","lang":"php"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"cURL"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# 1–2. Подпись: md5(\"init_invoice\" + amount=50&description=test_payment&invoice_user_data=inv_12345&partner_id=1234&project_id=5678 + API_KEY)\n\ncurl -sS \"https://api.1payment.com/init_invoice?partner_id=1234&project_id=5678&amount=50&description=test_payment&invoice_user_data=inv_12345&sign=PASTE_MD5_HEX\"\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"ответ-api","__idx":9},"children":["Ответ API"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Успешный ответ (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"invoice_id\": \"inv_dp2eqgnyt008ocg88wwsw00oksgs8s88\",\n  \"url\": \"https://merchant.1payment.com/xZ5g7F\"\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Поле"},"children":["Поле"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID инвойса в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Ссылка на платёжную форму; перенаправьте плательщика по этому адресу."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Ошибка запроса (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["400"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"error_code\": 2\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"уведомления-о-статусе-колбеки","__idx":10},"children":["Уведомления о статусе (колбеки)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["После получения ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["финального"]}," статуса инвойса на ваш ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_notify_url"]}," (из настроек проекта) отправляется ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST"]},"-уведомление в формате JSON."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Параметр"},"children":["Параметр"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Тип"},"children":["Тип"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Обяз."},"children":["Обяз."]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Описание"},"children":["Описание"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Тип уведомления; для инвойса — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID инвойса в системе 1Payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Нет"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["При успешной оплате — ID транзакции, которой оплачен инвойс."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["project_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID вашего проекта."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]}," — инвойс оплачен, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4"]}," — истёк срок ожидания оплаты."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_time"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Время создания инвойса."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["vaild_till"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Время окончания срока действия инвойса (имя поля — как в API)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма, на которую выставлен инвойс."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Валюта инвойса (ISO 4217)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["invoice_user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ID инвойса, переданный при создании."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Контрольная подпись колбека."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Важно:"]}," ваш сервер должен вернуть ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTP 200 OK"]},". Иначе система повторяет отправку колбека ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["раз в минуту в течение 10 минут"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Проверка подписи колбека:"]}," MD5 от всех параметров в алфавитном порядке через ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["без"]}," префикса ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_invoice"]},"). Подробнее — в разделе ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request#%D0%BA%D0%BE%D0%BB%D0%B1%D0%B5%D0%BA%D0%B8-%D1%83%D0%B2%D0%B5%D0%B4%D0%BE%D0%BC%D0%BB%D0%B5%D0%BD%D0%B8%D1%8F"},"children":["Формат запроса к API"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"связанные-разделы","__idx":11},"children":["Связанные разделы"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/init-request"},"children":["Формат запроса к API"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/transaction-statuses"},"children":["Статусы транзакций"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/error-codes-api"},"children":["Коды ошибок (API)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/decline-error-codes"},"children":["Коды ошибок (отказы)"]}]}]}]},"headings":[{"value":"Создание инвойса","id":"создание-инвойса","depth":1},{"value":"Принцип работы","id":"принцип-работы","depth":2},{"value":"Техническая информация","id":"техническая-информация","depth":2},{"value":"Параметры запроса","id":"параметры-запроса","depth":2},{"value":"Обязательные","id":"обязательные","depth":3},{"value":"Дополнительные","id":"дополнительные","depth":3},{"value":"Формирование подписи ( sign )","id":"формирование-подписи--sign-","depth":2},{"value":"Проверка подписи в документации","id":"проверка-подписи-в-документации","depth":3},{"value":"Примеры запроса","id":"примеры-запроса","depth":2},{"value":"Ответ API","id":"ответ-api","depth":2},{"value":"Уведомления о статусе (колбеки)","id":"уведомления-о-статусе-колбеки","depth":2},{"value":"Связанные разделы","id":"связанные-разделы","depth":2}],"frontmatter":{"seo":{"title":"Создание инвойса"}},"lastModified":"2026-05-26T17:03:47.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pages/init-invoice","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}