### OpStateExt Method GET Request Example Source: https://docs.robokassa.ru/ru/xml-interfaces Example of a GET request to the OpStateExt method to retrieve extended information about a payment operation. This method only works for live transactions. ```http https://auth.robokassa.ru/Merchant/WebService/Service.asmx/OpStateExt?MerchantLogin=demo&InvoiceID=1932809606&Signature=9e2bf657364d25acf5905b4ac4f50e39 ``` -------------------------------- ### Split Payment Request Example Source: https://docs.robokassa.ru/ru/split-payments This GET request demonstrates how to initiate a split payment. It includes details for multiple merchants, their respective amounts, and itemized receipts for each. Ensure all parameters are correctly encoded. ```HTTP https://auth.robokassa.ru/Merchant/Payment/CreateV2?invoice=%7B%22outAmount%22%3A%20700.0%2C%20%22email%22%3A%20%22testlab%40test.ru%22%2C%20%22incCurr%22%3A%20%22BankCard%22%2C%20%22language%22%3A%20%22ru%22%2C%20%22expirationDate%22%3A%20%222024-08-23T12%3A53Z%22%2C%20%22merchant%22%3A%20%7B%22id%22%3A%20%22ru_split_01_shop_01%22%7D%2C%20%22splitMerchants%22%3A%20%5B%7B%22id%22%3A%20%22ru_split_01_shop_01%22%2C%20%22amount%22%3A%20500.0%2C%20%22receipt%22%3A%20%7B%22sno%22%3A%20%22osn%22%2C%20%22items%22%3A%20%5B%7B%22name%22%3A%20%22%5Cu0442%5Cu043e%5Cu0432%5Cu0430%5Cu0440%201%22%2C%20%22quantity%22%3A%202%2C%20%22sum%22%3A%20400.0%2C%20%22tax%22%3A%20%22vat110%22%2C%20%22payment_method%22%3A%20%22full_payment%22%2C%20%22payment_object%22%3A%20%22commodity%22%2C%20%22nomenclature_code%22%3A%20%221231%22%7D%2C%20%7B%22name%22%3A%20%22%5Cu0442%5Cu043e%5Cu0432%5Cu0430%5Cu0440%202%22%2C%20%22quantity%22%3A%201.0%2C%20%22sum%22%3A%20100.0%2C%20%22tax%22%3A%20%22vat120%22%2C%20%22payment_method%22%3A%20%22full_payment%22%2C%20%22payment_object%22%3A%20%22commodity%22%2C%20%22nomenclature_code%22%3A%20%221232%22%7D%5D%7D%7D%2C%20%7B%22id%22%3A%20%22ru_split_02_shop_01%22%2C%20%22amount%22%3A%20200.0%2C%20%22receipt%22%3A%20%7B%22sno%22%3A%20%22usn_income%22%2C%20%22items%22%3A%20%5B%7B%22name%22%3A%20%22%5Cu0442%5Cu043e%5Cu0432%5Cu0430%5Cu0440%203%22%2C%20%22quantity%22%3A%201.0%2C%20%22sum%22%3A%20200.0%2C%20%22tax%22%3A%20%22vat20%22%2C%20%22payment_method%22%3A%20%22full_prepayment%22%2C%20%22payment_object%22%3A%20%22commodity%22%2C%20%22nomenclature_code%22%3A%20%22123456%22%7D%5D%7D%7D%5D%7D&signature=740ecfefbb09deee8e65d01bc00a04c239efab48721170f63184c7f4336238fd ``` -------------------------------- ### PHP Example with All Parameters Source: https://docs.robokassa.ru/pay-interface This extended example demonstrates how to pass additional settings like interface language, payment method, customer email, and receipt details for fiscalization. ```php ". "
". "". "". "". "". "". "". "". "". "". "". "". "". "
". ""; ?> ``` -------------------------------- ### GetCurrencies Method GET Request Example Source: https://docs.robokassa.ru/ru/xml-interfaces Example of a GET request to the GetCurrencies method to retrieve a list of available currencies for payment. ```http https://auth.robokassa.ru/Merchant/WebService/Service.asmx/GetCurrencies?MerchantLogin=demo&Language=ru ``` -------------------------------- ### Complete SBP QR Payment Example Source: https://docs.robokassa.ru/ru/sbp-qr-payment A full HTML example demonstrating how to initiate an SBP QR payment using Robokassa.pay.startOp, including receipt details and QR code display. ```html Robokassa SBP QR
``` -------------------------------- ### ResultUrl2 Request Example Source: https://docs.robokassa.ru/ru/notifications-and-redirects Example of a GET request URL for a ResultUrl2 notification, including essential payment parameters. ```text https://auth.robokassa.ru/merchant/Index.aspx?MerchantLogin=robo-demo-test&OutSum=10&InvID=1234829&ResultUrl2=https%3A%2F%2Ftest.test%2Frobokassa&SignatureValue=b1c4a749de7617e00e19616118808372 ``` -------------------------------- ### Example Payment Request Source: https://docs.robokassa.ru/ru/saving An example of a complete URL for a payment request using a saved card, including all necessary parameters. ```URL https://auth.robokassa.ru/Merchant/Payment/CoFPayment?MerchantLogin=robo-demo&OutSum=1&Receipt=%257B%2522items%2522%253A%255B%257B%2522name%2522%253A%2522%25D0%25A2%25D0%25B5%25D1%2585%25D0%25BD%25D0%25B8%25D1%2587%25D0%25B5%25D1%2581%25D0%25BA%25D0%25B0%25D1%258F%2520%25D0%25B4%25D0%25BE%25D0%25BA%25D1%2583%25D0%25BC%25D0%25B5%25D0%25BD%25D1%2586%25D0%25B8%25D1%258F%2522%252C%2522quantity%2522%253A1%252C%2522sum%2522%253A1.00%252C%2522tax%2522%253A%2522none%2522%257D%255D%257D&Token=E1253728-48A9-488D-A045-9954C442AF5C-qNavrXC6Y4&SignatureValue=779cfc2bd6a642977fb4dce8496bdee4 ``` -------------------------------- ### ResultURL Parameters Example Source: https://docs.robokassa.ru/ru/notifications-and-redirects Example of parameters that might be received by your ResultURL script for a successful payment. ```text OutSum=100.000000 InvId=450009 Shp_login=Vasya Shp_oplata=1 ``` -------------------------------- ### GetCurrencies Method Response Example Source: https://docs.robokassa.ru/ru/xml-interfaces Example XML response from the GetCurrencies method, listing currency groups and individual currencies with their properties. ```xml 0 ``` -------------------------------- ### SignatureValue Construction Example Source: https://docs.robokassa.ru/script-parameters This example shows the format for constructing the SignatureValue string. It includes mandatory fields, optional fields like InvId, modifiers in a strict order, and custom Shp parameters. ```text MerchantLogin:OutSum::Receipt:StepByStep:ResultUrl2:SuccessUrl2:SuccessUrl2Method:FailUrl2:FailUrl2Method:Token:<Пароль#1>: ``` -------------------------------- ### Robokassa RU Example Request with Additional Redirects Source: https://docs.robokassa.ru/ru/notifications-and-redirects This is an example of a request to Robokassa that includes additional redirect URLs for both success (SuccessUrl2) and failure (FailUrl2), along with their respective methods (GET). ```http https://auth.robokassa.ru/Merchant/Index.aspx?MerchantLogin=robo-demo&OutSum=1&invoiceID=&Receipt=%257B%2522items%2522%253A%255B%257B%2522name%2522%253A%2522%255Cu0422%255Cu0435%255Cu0441%255Cu0442%255Cu043e%255Cu0432%255Cu044b%255Cu0439%2B%255Cu0442%255Cu043e%255Cu0432%255Cu0430%255Cu0440%2522%252C%2522quantity%2522%253A1%252C%2522cost%2522%253A1%252C%2522tax%2522%253A%2522vat0%2522%252C%2522payment_object%2522%253A%2522commodity%2522%257D%255D%257D&SuccessUrl2=https%3A%2F%2Frobokassa.com%2F&SuccessUrl2Method=GET&FailUrl2=https%3A%2F%2Fwww.google.com%2F&FailUrl2Method=GET&SignatureValue=b789721670badc454e3b1a3a1e349fab ``` -------------------------------- ### Initiate Refund JWT Example Source: https://docs.robokassa.ru/ru/refund-api This is an example of a JWT string used to initiate a refund. It should be sent in the HTTP POST body. The `Password3` key from the store settings is used for signing. ```text eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJPcEtleSI6IjAwMDVGODkxLThDQ0QtNDM0Qi04NDU1LTgxNkFGRkZEQkYzNy0wVk9pc1dpa0ZGIiwiUmVmdW5kU3VtIjoxLCJJbnZvaWNlSXRlbXMiOlt7Ik5hbWUiOiLQotC10YHRgtC-0LLRi9C5INGC0L7QstCw0YAtMSIsIlF1YW50aXR5IjoxLCJDb3N0IjoxLCJUYXgiOiJ2YXQyMCIsIlBheW1lbnRNZXRob2QiOiJmdWxsX3BheW1lbnQiLCJQYXltZW50T2JqZWN0IjoiY29tbW9kaXR5In1dfQ.8TLNBdYYyl218qhdssAhs7ldiDIFeLZWh9Pf0UuN3wg ``` -------------------------------- ### Start Payment with Robokassa.StartPayment Source: https://docs.robokassa.ru/ru/iframe Initiate a payment by attaching this to a button's click handler. It requires essential parameters like MerchantLogin, OutSum, and SignatureValue. Optional parameters like InvId, Description, and Culture can also be provided. ```html ``` -------------------------------- ### Check Refund Status Request Example Source: https://docs.robokassa.ru/ru/refund-api This is an example URL to check the status of a refund operation. Replace `` with the actual ID obtained from the refund initiation response. ```http https://services.robokassa.ru/RefundService/Refund/GetState?id=cf15fd52-d2d1-4fc4-b9c0-25310e3bdded ``` -------------------------------- ### ResultUrl2 Signature String Example Source: https://docs.robokassa.ru/ru/notifications-and-redirects An example of the string that would be used to generate the signature for a ResultUrl2 notification. ```text robokassa:10:1234829:https%3A%2F%2Ftest.test%2Frobokassa:password1 ``` -------------------------------- ### Example JWT Header (Base64Url Encoded) Source: https://docs.robokassa.ru/ru/invoice-api An example of a JWT header after being converted to Base64Url format. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJNRDUifQ ``` -------------------------------- ### Signature Calculation Example Source: https://docs.robokassa.ru/ru/saving Demonstrates how to calculate the SignatureValue for a payment request using a saved card. The 'Token' parameter is included in the signature calculation. ```Text robo-demo:1::%7B%22items%22%3A%5B%7B%22name%22%3A%22%D0%A2%D0%B5%D1%85%D0%BD%D0%B8%D1%87%D0%B5%D1%81%D0%BA%D0%B0%D1%8F%20%D0%B4%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%B0%D1%86%D0%B8%D1%8F%22%2C%22quantity%22%3A1%2C%22sum%22%3A1.00%2C%22tax%22%3A%22none%22%7D%5D%7D:E1253728-48A9-488D-A045-9954C442AF5C-qNavrXC6Y4:pass1 ``` -------------------------------- ### Robokassa Graph Widget Example Source: https://docs.robokassa.ru/ru/buynowpaylater This example shows how to embed the Robokassa graph widget to display payment schedule details for a specific payment method. Ensure the script is loaded and the widget is initialized on DOMContentLoaded. ```html ``` ```javascript ``` -------------------------------- ### Robokassa RU Example Signature String Source: https://docs.robokassa.ru/ru/notifications-and-redirects This is an example of the string that would be used to calculate the signature for a Robokassa RU transaction when employing additional redirect URLs. It demonstrates the concatenation of various parameters. ```text robo-demo:1::%7B%22items%22%3A%5B%7B%22name%22%3A%22%5Cu0422%5Cu0435%5Cu0441%5Cu0442%5Cu043e%5Cu0432%5Cu044b%5Cu0439+%5Cu0442%5Cu043e%5Cu0432%5Cu0430%5Cu0440%22%2C%22quantity%22%3A1%2C%22cost%22%3A1%2C%22tax%22%3A%22vat0%22%2C%22payment_object%22%3A%22commodity%22%7D%5D%7D:https%3A%2F%2Frobokassa.com%2F:GET:https%3A%2F%2Fwww.google.com%2F:GET:password1 ``` -------------------------------- ### Example Invoice Item for Fiscalization Source: https://docs.robokassa.ru/ru/invoice-api Demonstrates the structure for a single item within the 'InvoiceItems' array, used for fiscalization purposes. This includes details like name, quantity, cost, tax, payment method, and payment object. ```json [ { "Name": "Услуга", "Quantity": 1, "Cost": 100, "Tax": "vat20", "PaymentMethod": "full_payment", "PaymentObject": "service" } ] ``` -------------------------------- ### Robokassa.pay.startOp(options) Source: https://docs.robokassa.ru/ru/buynowpaylater Initiates a payment operation and returns a payment link. For SBP, the link is displayed as a QR code. The container for the QR code is created and sized by the user. ```APIDOC ## `Robokassa.pay.startOp(options)` ### Description Initiates a payment operation and returns a payment link. For SBP, the link is displayed as a QR code. The container for the QR code is created and sized by the user. ### Method Signature `Robokassa.pay.startOp(options)` ### Parameters #### `options` Object - **merchantLogin** (string) - Required - Identifier of the store. - **outSum** (number) - Required - The amount to pay in rubles, using a dot as a separator (e.g., `123.45`). - **invId** (long) - Optional - Unique invoice number in the store. - **receipt** (string) - Optional - The receipt data, serialized into a JSON string. - **signature** (string) - Required - Control sum. Formed based on the provided parameters. - **email** (string) - Required - Customer's email address. - **onpaymentlink** (function) - Optional - Callback function invoked upon receiving the payment link (QR, redirect, or deeplink). - **paymentMethod** (string) - Required - Payment method for obtaining the payment link. Must be strictly `"SBP"`. - **qrContainerId** (string) - Optional - ID of the HTML element where the QR code will be displayed. If not provided or found, the QR code will not be displayed. - **qrContainerSize** (number) - Optional - Size of the QR code container in pixels. ### Signature Formulas - Without `invId` and `receipt`: `MD5(merchantLogin:outSum::Password#1)` - With `invId`: `MD5(merchantLogin:outSum:invId:Password#1)` - With `receipt`: `MD5(merchantLogin:outSum::receipt:Password#1)` - With `receipt` and `invId`: `MD5(merchantLogin:outSum:invId:receipt:Password#1)` ### Example Usage ```javascript Robokassa.pay.startOp({ merchantLogin: "your_merchant_login", outSum: 100.50, invId: 12345, receipt: JSON.stringify({ items: [ { name: "Product Name", price: 100.50, quantity: 1, sum: 100.50, tax: "vat20" } ] }), signature: "your_generated_signature", email: "customer@example.com", paymentMethod: "SBP", qrContainerId: "qr-code-container", qrContainerSize: 200 }); ``` ``` -------------------------------- ### HTTP GET Request for SMS Source: https://docs.robokassa.ru/ru/sms-notifications An example of a complete HTTP GET request to send an SMS notification. Ensure all parameters, including the signature, are correctly formatted and encoded. ```HTTP https://services.robokassa.ru/SMS/?login=demo_merchant&phone=79999999999&message=All%20work%20fine!&signature=6f0ed2dbb08da5a50124a3ee0581a7f6 ``` -------------------------------- ### Robokassa.pay.startOp Source: https://docs.robokassa.ru/ru/sbp-qr-payment Initiates a payment operation for SBP, returning a payment link and optionally displaying a QR code. It can also trigger a callback upon receiving the payment link. ```APIDOC ## Robokassa.pay.startOp ### Description This method initiates a payment operation, generates a payment link, and can display a QR code if a container ID is provided. It also supports a callback for when the payment link is received. ### Method JavaScript function call ### Endpoint N/A (JavaScript method) ### Parameters #### Options Object - **merchantLogin** (string) - Required - The merchant's login ID. - **outSum** (number) - Required - The amount to be paid. Format is a number with a decimal point (e.g., 123.45). - **signature** (string) - Required - The request checksum. - **email** (string) - Required - The customer's email address. - **paymentMethod** (string) - Required - Must be set to "SBP". - **invId** (number) - Optional - The invoice ID from the store. - **receipt** (string) - Optional - Fiscal data in JSON format. - **onpaymentlink** (function) - Optional - A callback function executed when the payment link is received. - **qrContainerId** (string) - Optional - The ID of the HTML container where the QR code should be rendered. - **qrContainerSize** (number) - Optional - The size of the QR code in pixels. - **shp** (string) - Optional - Additional custom parameters. ### Request Example ```javascript Robokassa.pay.startOp({ paymentMethod: 'SBP', email: 'test@test.ru', merchantLogin: 'robokassa_demo', outSum: 1, receipt: '{"sno":"osn","items":[{"name":"Название товара 1","quantity":1,"sum":1,"payment_method":"full_payment","payment_object":"commodity","tax":"vat10"}]}', signature: '8946cb761d5c517d9cf124139d0cee56', shp_test: "gd", shp_test2: "gd2", onpaymentlink: url => console.log(url), // Example callback qrContainerId: 'robokassa-qr-container', qrContainerSize: 360 }); ``` ### Response - The method returns a payment link. If `qrContainerId` is provided and valid, a QR code is rendered within that container. The `onpaymentlink` callback receives the payment URL. ``` -------------------------------- ### Example Invoice Payload (Base64Url Encoded) Source: https://docs.robokassa.ru/ru/invoice-api An example of the invoice payload after being converted to Base64Url format. ```text ewogICAiTWVyY2hhbnRMb2dpbiI6InJvYm8tZGVtby10ZXN0IiwKICAgIkludm9pY2VUeXBlIjoiT25lVGltZSIsCiAgICJDdWx0dXJlIjoicnUiLAogICAiSW52SWQiOjgwMCwKICAgIk91dFN1bSI6MSwKICAgIkRlc2NyaXB0aW9uIjoiYXMiLAogICAiTWVyY2hhbnRDb21tZW50cyI6Im5vIGNvbW1lbnQiLAogICAiSW52b2ljZUl0ZW1zIjpbCiAgICAgIHsKICAgICAgICAgIk5hbWUiOiLQotC10YHRgjEiLAogICAgICAgICAiUXVhbnRpdHkiOjEsCiAgICAgICAgICJDb3N0IjowLjUsCiAgICAgICAgICJUYXgiOiJ2YXQyMCIsCiAgICAgICAgICJQYXltZW50TWV0aG9kIjoiZnVsbF9wYXltZW50IiwKICAgICAgICAgIlBheW1lbnRPYmplY3QiOiJjb21tb2RpdHkiCiAgICAgIH0sCiAgICAgIHsKICAgICAgICAgIk5hbWUiOiLQotC10YHRgjIiLAogICAgICAgICAiUXVhbnRpdHkiOjEsCiAgICAgICAgICJDb3N0IjowLjUsCiAgICAgICAgICJUYXgiOiJ2YXQwIiwKICAgICAgICAgIlBheW1lbnRNZXRob2QiOiJmdWxsX3ByZXBheW1lbnQiLAogICAgICAgICAiUGF5bWVudE9iamVjdCI6ImNvbW1vZGl0eSIsCiAgICAgICAgICAiTm9tZW5jbGF0dXJlQ29kZSI6IklZVkFUQ1VSJ1hFXiR4JUMl5UJlVElDTl5SWCUmRVJDJlRJUlhNJlVSRi1VSVRSWEUmWlglUl5DVElSXlhVRSVaTjFtOUUrMcKmPzVPPzbCpj8xNjgiCiAgICAgIH0KICAgXQp9 ``` -------------------------------- ### Robokassa.pay.startOp Method Signature Source: https://docs.robokassa.ru/ru/sbp-qr-payment The basic signature for calling the startOp method with options. ```javascript Robokassa.pay.startOp(options); ``` -------------------------------- ### Encoded JWS Notification Example Source: https://docs.robokassa.ru/ru/notifications-and-redirects An example of a payment notification sent via ResultUrl2 in its encoded JWS format. ```text eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJoZWFkZXIiOnsidHlwZSI6IlBheW1lbnRTdGF0ZU5vdGlmaWNhdGlvbiIsInZlcnNpb24iOiIxLjAuMCIsInRpbWVzdGFtcCI6IjE2OTA0NTQ5ODAifSwiZGF0YSI6eyJzaG9wIjoicm9iby1kZW1vLXRlc3QiLCJvcEtleSI6IjE0RDJCNTIxLTRFQUItNDkyQS05RDkxLTAwRDEyRkYyNEQ1Ny0xTnZIRU5Md2dwIiwiaW52SWQiOiIxMjM0ODI5IiwicGF5bWVudE1ldGhvZCI6IkJhbmtDYXJkIiwiaW5jU3VtIjoiMTAuMDAiLCJzdGF0ZSI6Ik9LIn19.DaanjJ4A2yaGOppIVEj929MGNWU4jHcjAh4_DnFRJzkqvESbVpN5trGg8OlaftyQEldxeQaTF9ykrS7O1BmhPow0ZRv4GwjJQSwHzCGJUOcyVw507PMnRSAIT4oXq_PtKjqjuHQL_bxQxyGxZORoKhzsDwBYl_nMXsY-R_SCXPfvYRDPeJRRlC-HwQscOzyGN1cBHStuh5-w8qHytpaysVlif_XYK1-Lfa3ZsFjNz-2LENGL4CRmKMA2KhUfhNfNWXSA4J2KykfWznAvaY37T__QQHhDyHuIjsUtstG5Jf2aK2CuJY-i9mBTRkXD0U3Y5Lh7lnJQrkXAMBySRvYigQ ``` -------------------------------- ### Initiate Fund Holding (Pre-authorization) Source: https://docs.robokassa.ru/ru/holding This operation reserves funds on the buyer's card, to be charged later. It requires the `StepByStep` parameter to be set to `true`. ```APIDOC ## POST /Merchant/Index.aspx ### Description Initiates a fund holding (pre-authorization) operation. Funds are reserved on the buyer's card and can be charged later. ### Method POST ### Endpoint https://auth.robokassa.ru/Merchant/Index.aspx ### Parameters #### Request Body - **MerchantLogin** (string) - Required - Your merchant login. - **InvoiceID** (string) - Required - Unique identifier for the transaction. - **OutSum** (string) - Required - The amount to be held. - **Receipt** (string) - Required - JSON string representing the items purchased. - **StepByStep** (string) - Required - Set to `true` to enable step-by-step payment (holding). - **SignatureValue** (string) - Required - The signature calculated based on transaction details and password. ### Request Example ```html
``` ``` -------------------------------- ### Full HTML Structure for Robokassa iFrame Widget Source: https://docs.robokassa.ru/ru/iframe This example shows the complete HTML structure required to integrate the Robokassa iFrame widget. It includes the necessary div containers, the robokassa_iframe.js script, and the button to trigger the payment rendering within a specific block. ```html
Это первый блок
Это второй блок
``` -------------------------------- ### JWT Header Example Source: https://docs.robokassa.ru/ru/refund-api This JSON object represents the header of a JWT, specifying the algorithm and type. ```json { "alg": "HS256", "typ": "JWT" } ``` -------------------------------- ### Initialize Payment in Test Mode (PHP) Source: https://docs.robokassa.ru/ru/testing-mode This PHP snippet demonstrates how to construct a payment form URL for Robokassa's test mode. Ensure you replace placeholder values with your store's specific test credentials and parameters. The `IsTest=1` parameter is crucial for activating the test environment. ```php "; ``` -------------------------------- ### Include Robokassa Script Source: https://docs.robokassa.ru/ru/sbp-qr-payment Include the Robokassa iframe badge script to make the Robokassa.pay.startOp method globally available. ```html ``` -------------------------------- ### Robokassa Payment Gateway URL Source: https://docs.robokassa.ru/pay-interface The base URL for Robokassa payment requests using HTTP GET or POST. ```text https://auth.robokassa.ru/Merchant/Index.aspx ``` -------------------------------- ### SMS Service URL Source: https://docs.robokassa.ru/ru/sms-notifications The base URL for making SMS service requests via HTTP GET or POST. ```URL https://services.robokassa.ru/SMS/ ``` -------------------------------- ### Initialize Robokassa Graphs Source: https://docs.robokassa.ru/ru/buynowpaylater Initialize Robokassa graphs after the DOM is fully loaded. This script should be called once. ```javascript document.addEventListener('DOMContentLoaded', () => { window.initRobokassaGraphs(); }); ```