{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/en/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["signatureVerifier","codeTabs","tab"]},"type":"markdown"},"seo":{"title":"Create subscription payment","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":"create-subscription-payment","__idx":0},"children":["Create subscription payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Recurring ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["bank card"]}," payments allow you to charge a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["token"]}," of a saved card without the payer re-entering card details. With an active binding, charges are processed through GATE (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},")."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Contact your 1Payment account manager to enable this feature for your project."]},{"$$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":"p","attributes":{},"children":["The card subscription process consists of four steps:"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["First payment (card binding)"]}," — complete a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["successful"]}," payment with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]}," via the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/init-form"},"children":["payment form"]}," or ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/host2host"},"children":["GATE (host2host)"]},". The payer enters card details and completes 3-D Secure if required."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Receive token"]}," — after successful payment, 1Payment sends a unique ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," in the callback to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]}," or in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["status request"]}," response. Save it for subsequent charges."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Automatic charge (recurring)"]}," — for repeat payments, your server calls GATE (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},"), passing the saved ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["instead of"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card_holder"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cvc"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Notification"]}," — after each charge attempt, a callback arrives with the final transaction result."]}]},{"$$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":"Stage"},"children":["Stage"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Endpoint"},"children":["Endpoint"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Methods"},"children":["Methods"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Subscription registration (form)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_form"]}]},{"$$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":["Subscription registration (GATE)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_payment"]}]},{"$$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":["Recurring charge (GATE)"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["https://api.1payment.com/init_payment"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST"]}," (recommended), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET"]}]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Response format: ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["JSON"]},". For cards, specify ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_type=card"]}," in GATE requests."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"1-obtain-token-first-payment","__idx":3},"children":["1. Obtain token (first payment)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To bind a card, complete a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["successful"]}," payment with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]},". For form and GATE parameters, see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/init-form"},"children":["Create payment via form"]}," and ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/host2host"},"children":["Create host2host (GATE) payment"]},". Below is the required set for binding."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"required-parameters-form-initialization","__idx":4},"children":["Required parameters (form initialization)"]},{"$$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":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment amount for binding (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["50.00"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Subscription creation flag. Always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},". Without it, no token is returned."]}]},{"$$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":["Your unique order ID for matching."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shop_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL of the website where the purchase is made."]}]},{"$$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 below)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"required-parameters-gate-initialization","__idx":5},"children":["Required parameters (GATE initialization)"]},{"$$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":["payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]},"."]}]},{"$$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":["account"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Bank card number."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card_holder"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Cardholder name (as printed on the card)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card expiry year, last two digits (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["22"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card expiry month (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["01"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cvc"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Card CVV/CVC code."]}]},{"$$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":["Payment amount for binding (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["50.00"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Subscription creation flag. Always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]},". Without it, no token is returned."]}]},{"$$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":["Your unique order ID for matching."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shop_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL of the website where the payment originates."]}]},{"$$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 below)."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-parameters-initialization","__idx":6},"children":["Optional parameters (initialization)"]},{"$$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":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment description."]}]},{"$$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":["Customer redirect URL on success (form)."]}]},{"$$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":["Customer redirect URL on error (form)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["return_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payer redirect URL after payment (GATE)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ip"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payer IP address (GATE)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payer ID in your system."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Signature for form registration"]}," — prefix ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_form"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Via GATE"]}," — prefix ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},"."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"MD5(init_form + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"text","header":{"controls":{"copy":{}}},"source":"MD5(init_payment + <параметры_без_sign_в_алфавитном_порядке_через_&> + <API_KEY>)\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After the final ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUCCESS"]}," status, save the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," value from the callback or from the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["Payment statuses"]}," response."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"2-recurring-charge-repeat-payments","__idx":7},"children":["2. Recurring charge (repeat payments)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For automatic charging, send a GATE request with the saved ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]},". ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Do not pass"]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card_holder"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]},", and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cvc"]}," — use only ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," instead."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"required-parameters-recurring","__idx":8},"children":["Required parameters (recurring)"]},{"$$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":["payment_type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]},"."]}]},{"$$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":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Number"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Amount of the recurring charge (for example, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["500.00"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token received from the first successful payment (from callback or status request)."]}]},{"$$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":["New unique transaction ID on your side."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["shop_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL of the website where the payment originates."]}]},{"$$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 (prefix ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["init_payment"]},")."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"optional-parameters-recurring","__idx":9},"children":["Optional parameters (recurring)"]},{"$$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":["description"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment description."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ip"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payer IP address."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["return_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payer redirect URL after payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["user_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payer ID in your system."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"signature-generation--sign-","__idx":10},"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_payment + <параметры_без_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_paymentamount=500.00&partner_id=1234&payment_type=card&project_id=5678&shop_url=https://test.com&token=card_t_1a2b3c&user_data=card_order_888secret_key\n","lang":"text"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"signature-verification-recurring-charge","__idx":11},"children":["Signature verification (recurring charge)"]},{"$$mdtype":"Tag","name":"SignatureVerifier","attributes":{"method":"init_payment","preset":"card_recurring_payment"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"request-examples","__idx":12},"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\n// 1. Инициация подписки через форму (первичная привязка)\nasync function setupCardSubscriptionForm(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((k) => `${k}=${params[k]}`).join('&');\n\n  const baseString = `init_form${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.post('https://api.1payment.com/init_form', params);\n  return response.data; // поле url — ссылка на форму\n}\n\n// 2. Инициация подписки через GATE\nasync function setupCardSubscriptionGate(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((k) => `${k}=${params[k]}`).join('&');\n\n  const baseString = `init_payment${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.post('https://api.1payment.com/init_payment', params);\n  return response.data; // redirect_url при необходимости 3-D Secure\n}\n\n// 3. Рекуррентное списание (по токену)\nasync function chargeCardByToken(apiKey, params) {\n  const sortedKeys = Object.keys(params).sort();\n  const queryString = sortedKeys.map((k) => `${k}=${params[k]}`).join('&');\n\n  const baseString = `init_payment${queryString}${apiKey}`;\n  params.sign = crypto.createHash('md5').update(baseString).digest('hex');\n\n  const response = await axios.post('https://api.1payment.com/init_payment', params);\n  return response.data;\n}\n\nconst apiKey = process.env.ONEPAYMENT_API_KEY;\n\n// Пример: привязка через форму\nconst setupFormData = {\n  partner_id: 1234,\n  project_id: 5678,\n  amount: '50.00',\n  subscription: 1,\n  user_data: 'card_setup_777',\n  shop_url: 'https://test.com',\n};\n// setupCardSubscriptionForm(apiKey, setupFormData).then(console.log);\n\n// Пример: привязка через GATE\nconst setupGateData = {\n  partner_id: 1234,\n  payment_type: 'card',\n  project_id: 5678,\n  account: '4111111111111111',\n  card_holder: 'TEST',\n  year: '22',\n  month: '01',\n  cvc: '111',\n  amount: '50.00',\n  subscription: 1,\n  user_data: 'card_setup_777',\n  shop_url: 'https://test.com',\n};\n// setupCardSubscriptionGate(apiKey, setupGateData).then(console.log);\n\n// Пример: списание\nconst recurringData = {\n  partner_id: 1234,\n  payment_type: 'card',\n  project_id: 5678,\n  token: 'card_t_1a2b3c',\n  amount: '500.00',\n  user_data: 'card_order_888',\n  shop_url: 'https://test.com',\n};\nchargeCardByToken(apiKey, recurringData).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 setup_card_subscription_form(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    base_string = f\"init_form{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n    response = requests.post(\"https://api.1payment.com/init_form\", data=params)\n    response.raise_for_status()\n    return response.json()\n\ndef setup_card_subscription_gate(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    base_string = f\"init_payment{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n    response = requests.post(\"https://api.1payment.com/init_payment\", data=params)\n    response.raise_for_status()\n    return response.json()\n\ndef charge_card_by_token(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    base_string = f\"init_payment{query_string}{api_key}\"\n    params[\"sign\"] = hashlib.md5(base_string.encode(\"utf-8\")).hexdigest()\n    response = requests.post(\"https://api.1payment.com/init_payment\", data=params)\n    response.raise_for_status()\n    return response.json()\n\napi_key = os.environ[\"ONEPAYMENT_API_KEY\"]\n\nsetup_form_data = {\n    \"partner_id\": 1234,\n    \"project_id\": 5678,\n    \"amount\": \"50.00\",\n    \"subscription\": 1,\n    \"user_data\": \"card_setup_777\",\n    \"shop_url\": \"https://test.com\",\n}\n# print(setup_card_subscription_form(api_key, setup_form_data))\n\nsetup_gate_data = {\n    \"partner_id\": 1234,\n    \"payment_type\": \"card\",\n    \"project_id\": 5678,\n    \"account\": \"4111111111111111\",\n    \"card_holder\": \"TEST\",\n    \"year\": \"22\",\n    \"month\": \"01\",\n    \"cvc\": \"111\",\n    \"amount\": \"50.00\",\n    \"subscription\": 1,\n    \"user_data\": \"card_setup_777\",\n    \"shop_url\": \"https://test.com\",\n}\n# print(setup_card_subscription_gate(api_key, setup_gate_data))\n\nrecurring_data = {\n    \"partner_id\": 1234,\n    \"payment_type\": \"card\",\n    \"project_id\": 5678,\n    \"token\": \"card_t_1a2b3c\",\n    \"amount\": \"500.00\",\n    \"user_data\": \"card_order_888\",\n    \"shop_url\": \"https://test.com\",\n}\nprint(charge_card_by_token(api_key, recurring_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 signParams(string $prefix, string $apiKey, array $params): array\n{\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    $params['sign'] = md5($prefix . $tail . $apiKey);\n    return $params;\n}\n\nfunction setupCardSubscriptionForm(string $apiKey, array $params): string\n{\n    $params = signParams('init_form', $apiKey, $params);\n    $ch = curl_init('https://api.1payment.com/init_form');\n    curl_setopt($ch, CURLOPT_POST, true);\n    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n    return $response;\n}\n\nfunction setupCardSubscriptionGate(string $apiKey, array $params): string\n{\n    $params = signParams('init_payment', $apiKey, $params);\n    $ch = curl_init('https://api.1payment.com/init_payment');\n    curl_setopt($ch, CURLOPT_POST, true);\n    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n    return $response;\n}\n\nfunction chargeCardByToken(string $apiKey, array $params): string\n{\n    $params = signParams('init_payment', $apiKey, $params);\n    $ch = curl_init('https://api.1payment.com/init_payment');\n    curl_setopt($ch, CURLOPT_POST, true);\n    curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));\n    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n    $response = curl_exec($ch);\n    curl_close($ch);\n    return $response;\n}\n\n$apiKey = getenv('ONEPAYMENT_API_KEY');\n\n$setupFormData = [\n    'partner_id' => 1234,\n    'project_id' => 5678,\n    'amount' => '50.00',\n    'subscription' => 1,\n    'user_data' => 'card_setup_777',\n    'shop_url' => 'https://test.com',\n];\n// echo setupCardSubscriptionForm($apiKey, $setupFormData);\n\n$setupGateData = [\n    'partner_id' => 1234,\n    'payment_type' => 'card',\n    'project_id' => 5678,\n    'account' => '4111111111111111',\n    'card_holder' => 'TEST',\n    'year' => '22',\n    'month' => '01',\n    'cvc' => '111',\n    'amount' => '50.00',\n    'subscription' => 1,\n    'user_data' => 'card_setup_777',\n    'shop_url' => 'https://test.com',\n];\n// echo setupCardSubscriptionGate($apiKey, $setupGateData);\n\n$recurringData = [\n    'partner_id' => 1234,\n    'payment_type' => 'card',\n    'project_id' => 5678,\n    'token' => 'card_t_1a2b3c',\n    'amount' => '500.00',\n    'user_data' => 'card_order_888',\n    'shop_url' => 'https://test.com',\n];\necho chargeCardByToken($apiKey, $recurringData);\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_form\" + amount=50.00&partner_id=1234&project_id=5678&shop_url=...&subscription=1&user_data=... + API_KEY)\ncurl -sS -X POST \"https://api.1payment.com/init_form\" \\\n  -d \"partner_id=1234&project_id=5678&amount=50.00&subscription=1&user_data=card_setup_777&shop_url=https%3A%2F%2Ftest.com&sign=PASTE_MD5_HEX\"\n\n# Рекуррент: sign = md5(\"init_payment\" + amount=500.00&partner_id=1234&payment_type=card&project_id=5678&shop_url=...&token=...&user_data=... + API_KEY)\ncurl -sS -X POST \"https://api.1payment.com/init_payment\" \\\n  -d \"partner_id=1234&payment_type=card&project_id=5678&token=card_t_1a2b3c&amount=500.00&user_data=card_order_888&shop_url=https%3A%2F%2Ftest.com&sign=PASTE_MD5_HEX\"\n","lang":"bash"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"api-response","__idx":13},"children":["API response"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["On a successful ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["recurring"]}," request (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":"{\n  \"order_id\": \"8p3brmb19gfg0sg8gcwhws8kgc748s87\",\n  \"status\": 2,\n  \"status_description\": \"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":["order_id"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment ID in the 1Payment system; use for ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["status requests"]},"."]}]},{"$$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 status code (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2"]}," — 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":["Text status description (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["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 error code (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/decline-error-codes"},"children":["decline codes"]},")."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redirect_url"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["URL for 3-D Secure if additional authentication is required (may be absent)."]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For the ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["first payment with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]}," via form"]},", the response contains the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["url"]}," field (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/init-form"},"children":["Create payment via form"]},"); via GATE — ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redirect_url"]}," if 3-D Secure is required (see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/host2host"},"children":["Create host2host (GATE) payment"]},"). After successful payment, the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," field arrives in the callback to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["notify_url"]}," or in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["status request"]}," response — without ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["subscription=1"]},", no token is issued."]},{"$$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":14},"children":["Status notifications (callbacks)"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After successful card binding or a recurring charge, the system sends a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["POST"]}," request in JSON format to your ",{"$$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":["Payment type (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["card"]},")."]}]},{"$$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":["Payment 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":["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":["State: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["2"]}," (pending), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["3"]}," (success), ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["4"]}," (declined)."]}]},{"$$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":["PENDING"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SUCCESS"]},", or ",{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment 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 final 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":["Amount charged to 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":["Partner payout amount."]}]},{"$$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":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Payment currency (ISO 4217)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["account"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Yes"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Masked card number."]}]},{"$$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":["Transaction ID passed at creation."]}]},{"$$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":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["String"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Token for subsequent charges — ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["save"]}," after the first successful payment."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["test"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["No"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["1"]}," for test payments."]}]},{"$$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 reason code."]}]}]}]}]},{"$$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_payment"]}," 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":"p","attributes":{},"children":["You can also obtain the token via ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/status"},"children":["payment status request"]}," — the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["token"]}," field in the API response."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"related-sections","__idx":15},"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/status"},"children":["Payment statuses"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/en/pages/card/refund"},"children":["Payment refunds"]}]},{"$$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/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":"Create subscription payment","id":"create-subscription-payment","depth":1},{"value":"How it works","id":"how-it-works","depth":2},{"value":"Technical information","id":"technical-information","depth":2},{"value":"1. Obtain token (first payment)","id":"1-obtain-token-first-payment","depth":2},{"value":"Required parameters (form initialization)","id":"required-parameters-form-initialization","depth":3},{"value":"Required parameters (GATE initialization)","id":"required-parameters-gate-initialization","depth":3},{"value":"Optional parameters (initialization)","id":"optional-parameters-initialization","depth":3},{"value":"2. Recurring charge (repeat payments)","id":"2-recurring-charge-repeat-payments","depth":2},{"value":"Required parameters (recurring)","id":"required-parameters-recurring","depth":3},{"value":"Optional parameters (recurring)","id":"optional-parameters-recurring","depth":3},{"value":"Signature generation ( sign )","id":"signature-generation--sign-","depth":3},{"value":"Signature verification (recurring charge)","id":"signature-verification-recurring-charge","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":"Create subscription payment"}},"lastModified":"2026-07-09T09:48:51.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/en/pages/card/recurring","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}