{"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":["link"]},"). Передайте ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}," исходной оплаты и отдельный ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}," для операции возврата. После принятия запроса API вернёт ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_order_id"]}," и статус ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]},"; финальный результат придёт на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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":["order_id"]}," платежа в статусе успеха (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUCCESS"]},", код ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]},"). ID берётся из ответа ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/link/init-form"},"children":["создания по форме"]}," или ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/link/host2host"},"children":["GATE"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Инициация"]}," — подписанный запрос на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_refund"]}," с уникальным ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["возврата"]}," (не совпадает с ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}," платежа)."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Ответ"]}," — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_order_id"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]},") и ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Финал"]}," — колбек POST JSON на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]},"; при необходимости опросите статус по ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_order_id"]}," через ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/link/status"},"children":["Статусы платежей"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Расшифровка ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," и ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]}," для возвратов — в ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/transaction-statuses"},"children":["Статусы транзакций"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]},")."]},{"$$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_refund"]}]}]},{"$$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":"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":["payment_type"]}," — см. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/payment-types"},"children":["Типы платежей"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund"]}," в уведомлениях по возврату)"]}]}]}]}]},{"$$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":["order_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["исходного успешного"]}," платежа (канал ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["link"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Уникальный ID ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["возврата"]}," на вашей стороне (отличный от ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}," платежа). До 255 символов; рекомендуется UUID."]}]},{"$$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":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Сумма ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["частичного"]}," возврата. Доступность частичных возвратов уточняйте у менеджера 1Payment."]}]}]}]}]},{"$$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_refund + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Пример строки до хеширования:"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"init_refundorder_id=8p3brmb19gfg0sg8gcwhws8kgc748s87&partner_id=1234&project_id=5678&user_data=abcd1234secret_key\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["При частичном возврате в подпись включается переданный ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"проверка-подписи-в-документации","__idx":7},"children":["Проверка подписи в документации"]},{"$$mdtype":"Tag","name":"SignatureVerifier","attributes":{"method":"init_refund","preset":"link_init_refund"},"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 initLinkRefund(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((key) => `${key}=${params[key]}`).join('&');\n\n  const baseString = `init_refund${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.get('https://api.1payment.com/init_refund', { 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  order_id: '8p3brmb19gfg0sg8gcwhws8kgc748s87',\n  user_data: 'abcd1234',\n};\n\ninitLinkRefund(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 init_link_refund(api_key: str, params: dict) -> dict:\n    sorted_keys = sorted(params.keys())\n    query_string = \"&\".join(f\"{k}={params[k]}\" for k in sorted_keys)\n\n    base_string = f\"init_refund{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n\n    response = requests.get(\"https://api.1payment.com/init_refund\", 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    \"order_id\": \"8p3brmb19gfg0sg8gcwhws8kgc748s87\",\n    \"user_data\": \"abcd1234\",\n}\n\nprint(init_link_refund(api_key, data))\n","lang":"python"},"children":[]}]},{"$$mdtype":"Tag","name":"Tab","attributes":{"label":"cURL"},"children":[{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"# sign = md5(\"init_refund\" + order_id=...&partner_id=1234&project_id=5678&user_data=abcd1234 + API_KEY)\ncurl -sS \"https://api.1payment.com/init_refund?partner_id=1234&project_id=5678&order_id=8p3brmb19gfg0sg8gcwhws8kgc748s87&user_data=abcd1234&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  \"refund_order_id\": \"crf_1p3brmb19gfg0sg8gcwhws8kgc748s87\",\n  \"status\": 9,\n  \"status_description\": \"REFUND_PENDING\",\n  \"status_code\": 0\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":["refund_order_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":["status"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Числовой код (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9"]}," — возврат в обработке)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]}," и др."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_code"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Код отказа при ошибке возврата (см. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/decline-error-codes"},"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":["POST"]}," JSON на ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]}," проекта."]},{"$$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":["payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Да"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Тип операции (см. ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/payment-types"},"children":["Типы платежей"]},")."]}]},{"$$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":["Идентификатор ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["возврата"]}," в 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":"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":["5"]}," — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9"]}," — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]}," и др.)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]}]},{"$$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":["REFUND"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["FAILURE"]}," и др."]}]},{"$$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":["status_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":["merchant_price"]}]},{"$$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":["init_price"]}]},{"$$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":["user_price"]}]},{"$$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":["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":"code","attributes":{},"children":["init_refund"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["original_order_id"]}]},{"$$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":["order_id"]}," исходного платежа."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_code"]}]},{"$$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":["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_refund"]},"). Подробнее — в разделе ",{"$$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/link/init-form"},"children":["Создание платежа по форме"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/link/host2host"},"children":["Создание платежа по host2host (GATE)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/pages/link/status"},"children":["Статусы платежей"]}]},{"$$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/payment-types"},"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-07-03T08:42:59.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/pages/link/refund","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}