{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/en/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["signatureVerifier","codeTabs","tab"]},"type":"markdown"},"seo":{"title":"Payment refunds","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":"payment-refunds","__idx":0},"children":["Payment refunds"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This method initiates a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["refund"]}," of a successful ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["bank card"]}," payment. Pass the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}," of the original payment and a separate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}," for the refund operation. After the request is accepted, the API returns ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_order_id"]}," and status ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]},"; the final result arrives at the project ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Request format and signatures — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/init-request"},"children":["API request format"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"how-it-works","__idx":1},"children":["How it works"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Original payment"]}," — a refund is possible for an ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}," of a payment in success status (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUCCESS"]},", code ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]},"). The ID comes from the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/init-form"},"children":["form"]}," or ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/host2host"},"children":["host2host (GATE)"]}," creation response."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Initiation"]}," — signed request to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_refund"]}," with a unique ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["refund"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]}," (different from the payment ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]},")."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Response"]}," — ",{"$$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"]},"), and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Final status"]}," — callback POST JSON to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]},"; if needed, poll status by ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund_order_id"]}," via ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["Payment statuses"]},"."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Interpretation of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["status_description"]}," for refunds — in ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/transaction-statuses"},"children":["Transaction statuses"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["REFUND_PENDING"]},")."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"technical-information","__idx":2},"children":["Technical information"]},{"$$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":["Endpoint"]}]},{"$$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":["Methods"]}]},{"$$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":["Response format"]}]},{"$$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":["Callback type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_type"]}," — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/payment-types"},"children":["Payment types"]}," (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["refund"]}," in refund notifications)"]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request-parameters","__idx":3},"children":["Request parameters"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"required","__idx":4},"children":["Required"]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$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":["Your unique ID in the 1Payment system."]}]},{"$$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":["Your project identifier."]}]},{"$$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"]}," of the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["original successful"]}," card payment."]}]},{"$$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":["Unique ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["refund"]}," ID on your side (different from the payment ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_data"]},"). Up to 255 characters; UUID is recommended."]}]},{"$$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":["Request signature (see the \"Signature\" section)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional","__idx":5},"children":["Optional"]},{"$$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":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$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":["Partial"]}," refund amount. Contact your 1Payment account manager to confirm partial refund availability."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"signature-generation--sign-","__idx":6},"children":["Signature generation (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["sign"]},")"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Signature: MD5, lowercase (hex). General rules — ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/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 request format"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Formula:"]}]},{"$$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":["Example string before hashing:"]}]},{"$$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":["For partial refunds, the passed ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}," is included in the signature."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"signature-verification-in-the-documentation","__idx":7},"children":["Signature verification in the documentation"]},{"$$mdtype":"Tag","name":"SignatureVerifier","attributes":{"method":"init_refund","preset":"card_init_refund"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request-examples","__idx":8},"children":["Request examples"]},{"$$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 initCardRefund(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\ninitCardRefund(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_card_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_card_refund(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 initCardRefund(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_refund)\n    $params['sign'] = md5('init_refund' . $tail . $apiKey);\n\n    // 3. Запрос к API\n    $url = 'https://api.1payment.com/init_refund?' . 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    'order_id' => '8p3brmb19gfg0sg8gcwhws8kgc748s87',\n    'user_data' => 'abcd1234',\n];\n\necho initCardRefund($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":"# 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-response","__idx":9},"children":["API response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Successful response (",{"$$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":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$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":["Refund ID in 1Payment; use for status polling and accounting."]}]},{"$$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":["Numeric code (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["9"]}," — refund in progress)."]}]},{"$$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"]},", etc."]}]},{"$$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":["Decline code on refund error (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/decline-error-codes"},"children":["decline codes"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Request error (",{"$$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":"status-notifications-callbacks","__idx":10},"children":["Status notifications (callbacks)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After the refund status changes, the server sends ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST"]}," JSON to the project ",{"$$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":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Req."},"children":["Req."]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Operation type (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/payment-types"},"children":["Payment types"]},")."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Refund"]}," identifier in 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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your project 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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Refund state (",{"$$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"]},", etc.)."]}]},{"$$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":["Yes"]},{"$$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"]},", etc."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Refund creation time."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Time the status was received."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Original payment amount for the payer."]}]},{"$$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":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount at initialization."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Refund debit amount."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Refund ID passed in ",{"$$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":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["order_id"]}," of the original payment."]}]},{"$$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":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Decline error code."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Callback signature."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Important:"]}," your server must return ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["HTTP 200 OK"]},". Otherwise, the system retries the callback ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["once per minute for 10 minutes"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Callback signature verification:"]}," MD5 of all parameters in alphabetical order joined with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["&"]}," + ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["API_KEY"]}," (",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["without"]}," the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_refund"]}," prefix). For details, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/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 request format"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-sections","__idx":11},"children":["Related sections"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/init-form"},"children":["Create payment via form"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/host2host"},"children":["Create host2host (GATE) payment"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/recurring"},"children":["Create subscription payment"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["Payment statuses"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/transaction-statuses"},"children":["Transaction statuses"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/payment-types"},"children":["Payment types"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/error-codes-api"},"children":["Error codes (API)"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/decline-error-codes"},"children":["Error codes (declines)"]}]}]}]},"headings":[{"value":"Payment refunds","id":"payment-refunds","depth":1},{"value":"How it works","id":"how-it-works","depth":2},{"value":"Technical information","id":"technical-information","depth":2},{"value":"Request parameters","id":"request-parameters","depth":2},{"value":"Required","id":"required","depth":3},{"value":"Optional","id":"optional","depth":3},{"value":"Signature generation ( sign )","id":"signature-generation--sign-","depth":2},{"value":"Signature verification in the documentation","id":"signature-verification-in-the-documentation","depth":3},{"value":"Request examples","id":"request-examples","depth":2},{"value":"API response","id":"api-response","depth":2},{"value":"Status notifications (callbacks)","id":"status-notifications-callbacks","depth":2},{"value":"Related sections","id":"related-sections","depth":2}],"frontmatter":{"seo":{"title":"Payment refunds"}},"lastModified":"2026-07-09T09:48:51.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/en/pages/card/refund","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}