### Example Request using cURL Source: https://developers.tochka.com/docs/pay-gateway/api/get-tokenization-result This example shows how to make a request to the tokenization result endpoint using cURL. Ensure you replace placeholder values and include the correct Authorization header. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/sbp/qrc/:qrcId/tokenization/result?qrcIdType=NSPK' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` -------------------------------- ### 200 OK Response Example Source: https://developers.tochka.com/docs/pay-gateway/api/activate-cash-register-qr-code This is an example of a successful response (200 OK) when activating a cash register QR code. It includes the activation UID, a self link, and metadata. ```json { "Data": { "activationUid": "83746290376583029856473829018735" }, "Links": { "self": "https://enter.tochka.com/uapi/pay" }, "Meta": { "totalPages": 0 } } ``` -------------------------------- ### API Refund Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/get-refund Example of how to make a refund request using cURL. Ensure to replace placeholder tokens with actual credentials and IDs. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67/refunds/8H7GSEE7018GC67' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` -------------------------------- ### Send Capture Notification using Go Source: https://developers.tochka.com/docs/pay-gateway/api/capture-notification Example of sending a capture notification using Go. ```go package main import ( "bytes" "fmt" "io/ioutil" "net/http" ) func main() { url := "https://enter.tochka.com/uapi/pay/merchant-notifications-url/capture" jsonBody := []byte(`{ "version": "1.0", "siteUid": "tochka-site-00", "paymentUid": "977639EE70494C67", "invoiceUid": "invoice-12345", "event": "capture-updated", "createdAt": "2025-01-01T01:23:45+03:00", "payloadType": "capture", "payload": { "captureUid": "some-capture-uid", "createdDateTime": "2025-01-01T01:23:45+03:00", "amount": { "currency": "RUB", "amount": "123.45" }, "status": { "value": "COMPLETED", "changedDateTime": "2025-01-01T01:23:45+03:00" } }, "callbackUrl": "https://test.tochkapay.com/notification", "comment": "Payment captured successfully." }`) req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody)) if err != nil { fmt.Printf("Error creating request: %s\n", err) return } req.Header.Set("Content-Type", "application/json") client := &http.Client{} res, err := client.Do(req) if err != nil { fmt.Printf("Error sending request: %s\n", err) return } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { fmt.Printf("Error reading response body: %s\n", err) return } fmt.Printf("Response Status: %s\n", res.Status) fmt.Printf("Response Body: %s\n", string(body)) } ``` -------------------------------- ### Example Capture Notification Request Source: https://developers.tochka.com/docs/pay-gateway/api/capture-notification This is an example of the JSON body for a capture status update notification. ```json { "version": "1.0", "siteUid": "tochka-site-00", "paymentUid": "977639EE70494C67", "invoiceUid": "invoice-12345", "event": "capture-updated", "createdAt": "2025-01-01T01:23:45+03:00", "payloadType": "capture", "payload": { "captureUid": "some-capture-uid", "createdDateTime": "2025-01-01T01:23:45+03:00", "amount": { "currency": "RUB", "amount": "123.45" }, "status": { "value": "COMPLETED", "changedDateTime": "2025-01-01T01:23:45+03:00" } }, "callbackUrl": "https://test.tochkapay.com/notification", "comment": "Payment captured successfully." } ``` -------------------------------- ### Send Capture Notification using PHP Source: https://developers.tochka.com/docs/pay-gateway/api/capture-notification Example of sending a capture notification using PHP. ```php '1.0', 'siteUid' => 'tochka-site-00', 'paymentUid' => '977639EE70494C67', 'invoiceUid' => 'invoice-12345', 'event' => 'capture-updated', 'createdAt' => '2025-01-01T01:23:45+03:00', 'payloadType' => 'capture', 'payload' => [ 'captureUid' => 'some-capture-uid', 'createdDateTime' => '2025-01-01T01:23:45+03:00', 'amount' => [ 'currency' => 'RUB', 'amount' => '123.45' ], 'status' => [ 'value' => 'COMPLETED', 'changedDateTime' => '2025-01-01T01:23:45+03:00' ] ], 'callbackUrl' => 'https://test.tochkapay.com/notification', 'comment' => 'Payment captured successfully.' ]; $options = [ 'http' => [ 'method' => 'POST', 'header' => 'Content-type: application/json', 'content' => json_encode($data) ] ]; $context = stream_context_create($options); $result = file_get_contents('https://enter.tochka.com/uapi/pay/merchant-notifications-url/capture', false, $context); if ($result === false) { // Handle error } else { // Process result echo $result; } ?> ``` -------------------------------- ### Send Capture Notification using Java Source: https://developers.tochka.com/docs/pay-gateway/api/capture-notification Example of sending a capture notification using Java. ```java import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.URL; import java.nio.charset.StandardCharsets; public class CaptureNotification { public static void main(String[] args) throws Exception { String urlString = "https://enter.tochka.com/uapi/pay/merchant-notifications-url/capture"; String jsonBody = "{\"version\": \"1.0\", \"siteUid\": \"tochka-site-00\", \"paymentUid\": \"977639EE70494C67\", \"invoiceUid\": \"invoice-12345\", \"event\": \"capture-updated\", \"createdAt\": \"2025-01-01T01:23:45+03:00\", \"payloadType\": \"capture\", \"payload\": { \"captureUid\": \"some-capture-uid\", \"createdDateTime\": \"2025-01-01T01:23:45+03:00\", \"amount\": { \"currency\": \"RUB\", \"amount\": \"123.45\" }, \"status\": { \"value\": \"COMPLETED\", \"changedDateTime\": \"2025-01-01T01:23:45+03:00\" } }, \"callbackUrl\": \"https://test.tochkapay.com/notification\", \"comment\": \"Payment captured successfully.\"}"; URL url = new URL(urlString); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestMethod("POST"); connection.setRequestProperty("Content-Type", "application/json"); connection.setDoOutput(true); try (OutputStream os = connection.getOutputStream()) { byte[] input = jsonBody.getBytes(StandardCharsets.UTF_8); os.write(input, 0, input.length); } int responseCode = connection.getResponseCode(); System.out.println("Response Code: " + responseCode); // Read response if needed // try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream(), StandardCharsets.UTF_8))) { // String responseLine = null; // StringBuilder response = new StringBuilder(); // while ((responseLine = br.readLine()) != null) { // response.append(responseLine); // } // System.out.println(response.toString()); // } } } ``` -------------------------------- ### Send Capture Notification using Python Source: https://developers.tochka.com/docs/pay-gateway/api/capture-notification Example of sending a capture notification using Python. ```python import requests import json data = { "version": "1.0", "siteUid": "tochka-site-00", "paymentUid": "977639EE70494C67", "invoiceUid": "invoice-12345", "event": "capture-updated", "createdAt": "2025-01-01T01:23:45+03:00", "payloadType": "capture", "payload": { "captureUid": "some-capture-uid", "createdDateTime": "2025-01-01T01:23:45+03:00", "amount": { "currency": "RUB", "amount": "123.45" }, "status": { "value": "COMPLETED", "changedDateTime": "2025-01-01T01:23:45+03:00" } }, "callbackUrl": "https://test.tochkapay.com/notification", "comment": "Payment captured successfully." } headers = { 'Content-Type': 'application/json' } response = requests.post( 'https://enter.tochka.com/uapi/pay/merchant-notifications-url/capture', data=json.dumps(data), headers=headers ) if response.status_code == 200: # Process response print(response.json()) else: # Handle error print(f"Error: {response.status_code}") ``` -------------------------------- ### Example cURL Request for Refunds Source: https://developers.tochka.com/docs/pay-gateway/api/get-refunds Demonstrates how to make a request to the refunds endpoint using cURL, including necessary headers for authentication and content type. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67/refunds' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` -------------------------------- ### Send Capture Notification using cURL Source: https://developers.tochka.com/docs/pay-gateway/api/capture-notification Example of sending a capture notification using cURL. ```curl curl -X POST \ https://enter.tochka.com/uapi/pay/merchant-notifications-url/capture \ -H 'Content-Type: application/json' \ -d '{ \ "version": "1.0", \ "siteUid": "tochka-site-00", \ "paymentUid": "977639EE70494C67", \ "invoiceUid": "invoice-12345", \ "event": "capture-updated", \ "createdAt": "2025-01-01T01:23:45+03:00", \ "payloadType": "capture", \ "payload": { \ "captureUid": "some-capture-uid", \ "createdDateTime": "2025-01-01T01:23:45+03:00", \ "amount": { \ "currency": "RUB", \ "amount": "123.45" \ }, \ "status": { \ "value": "COMPLETED", \ "changedDateTime": "2025-01-01T01:23:45+03:00" \ } \ }, \ "callbackUrl": "https://test.tochkapay.com/notification", \ "comment": "Payment captured successfully." }' ``` -------------------------------- ### QR Code Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/get-qr-code Use this cURL command to request a QR code. Ensure you replace ':qrcId' with the actual QR code ID and provide a valid authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/sbp/qrc/:qrcId?qrcIdType=NSPK&mediaType=image%2Fpng' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` -------------------------------- ### Example Payment Notification Request (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/payment-notification This snippet shows a sample cURL request to the payment notification endpoint. It includes all necessary fields for a payment update event. ```curl curl -L 'https://enter.tochka.com/uapi/pay/merchant-notifications-url/payment' \ -H 'Content-Type: application/json' \ --data-raw '{ \ "version": "1.0", \ "siteUid": "tochka-site-00", \ "invoiceUid": "invoice-12345", \ "event": "payment-updated", \ "createdAt": "2025-01-01T01:23:45+03:00", \ "payloadType": "payment", \ "payload": { \ "paymentUid": "977639EE70494C67", \ "createdDateTime": "2025-01-01T01:23:45+03:00", \ "orderUid": "12EKN0170494C67", \ "amount": { \ "currency": "RUB", \ "amount": "123.45" \ }, \ "refundedAmount": { \ "currency": "RUB", \ "amount": "123.45" \ }, \ "paymentMethod": { \ "type": "CARD", \ "maskedPan": "41111111******11", \ "expirationDate": "12/28", \ "holderName": "CARD HOLDER", \ "rrn": "003235873473", \ "authCode": "347328", \ "tokenizationCredentials": { \ "trn": "872635123", \ "token": "KAFJA8612bJAASD" \ }, \ "threeDsFlowType": "THREE_DS_V1", \ "captureMode": "AUTO", \ "capturedAmount": { \ "currency": "RUB", \ "amount": "123.45" \ } \ }, \ "status": { \ "value": "COMPLETED", \ "changedDateTime": "2025-01-01T01:23:45+03:00" \ }, \ "customer": { \ "account": "E268443E43D93DAB7EBEF303BBE9642F", \ "email": "pay@tochka.com", \ "phone": "79123456789", \ "firstName": "Ivan", \ "middleName": "Ivanovich", \ "lastName": "Ivanov", \ "simpleAddress": "Verhnyaya Radishchevskaya ulica, dom 2/1", \ "address": { \ "country": "Russia", \ "region": "Moscow", \ "city": "Moscow city", \ "details": "Verhnyaya Radishchevskaya ulica, dom 2/1" \ } \ }, \ "requirements": { \ "type": "string", \ "paReq": "BC58+5698AE46DE4==", \ "acsUrl": "https://example.tochkapayment.ru/acs/" \ }, \ "callbackUrl": "https://test.tochkapay.com/notification", \ "comment": "string", \ "isTest": true, \ "metadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}" \ } \ }' ``` -------------------------------- ### Get Refunds Source: https://developers.tochka.com/docs/pay-gateway/api/get-refunds This endpoint allows you to retrieve refund information. It details the structure of the request and the expected response, including error handling. ```APIDOC ## GET /refunds ### Description Retrieves refund information for a given payment. ### Method GET ### Endpoint /refunds ### Parameters #### Query Parameters - **site_id** (string) - Required - The identifier of the site. - **payment_id** (string) - Required - The identifier of the payment for which to retrieve refunds. ### Request Example ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67/refunds' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` ### Response #### Success Response (200) - **code** (string) - The HTTP status code of the response. - **id** (string) - A unique identifier for the transaction. - **message** (string) - A brief description of the response. - **Errors** (array) - An array of error objects, if any occurred. - **errorCode** (string) - A code indicating the type of error. - **message** (string) - A description of the error. - **url** (string) - A URL for more information about the error. #### Response Example ```json { "code": "400", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Что-то пошло не так", "Errors": [ { "errorCode": "HTTPBadRequest", "message": "Something going wrong", "url": "http://enter.tochka.com/open-banking/docs" } ] } ``` ``` -------------------------------- ### Example Refund Status Update Notification Request (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/refund-notification This snippet shows a sample cURL request to the refund status update notification endpoint. It includes all required and optional parameters for a complete notification payload. ```bash curl -L 'https://enter.tochka.com/uapi/pay/merchant-notifications-url/refund' \ -H 'Content-Type: application/json' \ -d '{ "version": "1.0", "siteUid": "tochka-site-00", "paymentUid": "977639EE70494C67", "invoiceUid": "invoice-12345", "event": "refund-updated", "createdAt": "2025-01-01T01:23:45+03:00", "payloadType": "refund", "payload": { "refundUid": "8H7GSEE7018GC67", "createdDateTime": "2025-01-01T01:23:45+03:00", "amount": { "currency": "RUB", "amount": "123.45" }, "status": { "value": "COMPLETED", "changedDateTime": "2025-01-01T01:23:45+03:00" }, "callbackUrl": "https://test.tochkapay.com/notification", "comment": "Возврат за услугу", "metadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}", "refundMethodResult": { "type": "CARD", "rrn": "003235873473", "authCode": "347328", "isReversal": true } } }' ``` -------------------------------- ### API Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/get-payments-by-qrc-id This cURL command demonstrates how to request payment information by QR code ID from the Tochka Pay API. Ensure you replace ':qrcId' with the actual QR code ID and 'Authorization' header with a valid Bearer token. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/sbp/qrc/:qrcId/payments?qrcIdType=NSPK' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` -------------------------------- ### Get SBP QR Code Source: https://developers.tochka.com/docs/pay-gateway/api/get-qr-code Retrieves the content for a previously registered SBP Functional Link. You can specify the desired image format and dimensions for the QR code. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/sbp/qrc/{qrcId} ### Description Get the content of a previously registered SBP Functional Link. ### Method GET ### Endpoint /uapi/pay/{apiVersion}/sites/{siteUid}/sbp/qrc/{qrcId} ### Parameters #### Path Parameters - **siteUid** (string) - Required - ID Сайта. Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$` - **qrcId** (string) - Required - Идентификатор зарегистрированной Функциональной ссылки СБП. Value must match regular expression `^[0-9a-zA-Z-]{1,64}$` - **apiVersion** (string) - Required - Версия API. Possible values: [`v1.0`] #### Query Parameters - **qrcIdType** (string) - Required - Тип идентификатора. Possible values: [`NSPK`, `MERCHANT`] - **mediaType** (string) - Optional - Формат изображения QR-кода. Possible values: [`image/png`, `image/svg+xml`] - **width** (integer) - Optional - Ширина изображения QR-кода. Possible values: `>= 200` and `<= 1000`. Default value: `300` - **height** (integer) - Optional - Высота изображения QR-кода. Possible values: `>= 200` and `<= 1000`. Default value: `300` #### Header Parameters - **Authorization** (string) - Required - Токен для аутентификации запросов ### Response #### Success Response (200) (Response structure not provided in the source text) #### Response Example (Response example not provided in the source text) ``` -------------------------------- ### Get Payment by Cash Register QR Activation UID Source: https://developers.tochka.com/docs/pay-gateway/api/get-payment-by-cash-register-qrc-activation-uid Retrieves the payment details for a given SBP cash register QR code activation. This endpoint requires path parameters for site, QR code, and activation identifiers, along with the API version. A query parameter specifies the type of QR code ID, and an Authorization header is mandatory for authentication. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/sbp/qrc/cash-register-qrc/{qrcId}/activations/{activationUid}/payment ### Description Retrieve payment details for a specific activation of a SBP cash register QR code. ### Method GET ### Endpoint /uapi/pay/{apiVersion}/sites/{siteUid}/sbp/qrc/cash-register-qrc/{qrcId}/activations/{activationUid}/payment ### Parameters #### Path Parameters - **siteUid** (string) - Required - ID Сайта. Possible values: Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$`. Example: `tochka-site-00` - **qrcId** (string) - Required - Идентификатор зарегистрированной Кассовой ссылки СБП. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$` - **activationUid** (string) - Required - Уникальный идентификатор активации Кассовой ссылки СБП в информационной системе ТСП. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$` - **apiVersion** (string) - Required - Версия API. Possible values: [`v1.0`] #### Query Parameters - **qrcIdType** (string) - Required - Тип идентификатора. Possible values: [`NSPK`, `MERCHANT`]. Example: `NSPK` #### Header Parameters - **Authorization** (string) - Required - Токен для аутентификации запросов. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...` ### Response #### Success Response (200) (No response schema provided in the source) #### Response Example (No response example provided in the source) ``` -------------------------------- ### Declined Operation Status Example Source: https://developers.tochka.com/docs/pay-gateway/api-references This snippet shows the general structure of a declined operation status, including value, timestamp, and reason details. It is used to understand the response format for failed transactions. ```json "status": { "value": "DECLINED", "changedDateTime": "2099-01-01T12:34:56Z", "reasonSource": <Источник причины отклонения операции>, "reasonCode": <Коды причины отклонения операции>, "reasonMessage": "Какое-либо пояснение причины отклонения", ... } ``` -------------------------------- ### Example JSON Response for General Error Source: https://developers.tochka.com/docs/pay-gateway/api/deactivate-cash-register-qr-code This JSON structure represents a common error response, including a high-level error code, a unique ID for auditing, a brief message, and a detailed list of errors. ```json { "code": "400", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Что-то пошло не так", "Errors": [ { "errorCode": "HTTPBadRequest", "message": "Something going wrong", "url": "http://enter.tochka.com/open-banking/docs" } ] } ``` -------------------------------- ### Prepare Request Body for Signing Source: https://developers.tochka.com/docs/pay-gateway/request-signature-and-authorization This snippet shows a sample request body content. The actual content should be stored in a file (e.g., request.txt) for signing. ```text hello, world ``` -------------------------------- ### Create Static QR Code with Simulated Payment Source: https://developers.tochka.com/docs/pay-gateway/testing This snippet demonstrates the successful creation of a static QR code followed by a simulated successful payment. ```json .... "qrcType": "STATIC", "paymentPurpose": "{\"createQrc\":\"OK_PAYMENT_ACCEPTED\"}" .... ``` -------------------------------- ### Create Dynamic QR Code with Simulated Payment and Refund Source: https://developers.tochka.com/docs/pay-gateway/testing Test the successful creation of a dynamic QR code with simulated successful payment and a simulated successful refund. ```json ... "qrcType": "DYNAMIC", "paymentPurpose": "{\"createQrc\":\"OK_PAYMENT_ACCEPTED\",\"refund\":\"OK_ACCEPTED\"}" ... ``` -------------------------------- ### Get Capture Status Source: https://developers.tochka.com/docs/pay-gateway/api/get-capture Retrieves the status of a specified payment capture. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/captures/{captureUid} ### Description Get the status of the specified payment capture. ### Method GET ### Endpoint https://enter.tochka.com/uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/captures/{captureUid} ### Parameters #### Path Parameters - **siteUid** (string) - required - ID of the site. Possible values: Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$`. Example: `tochka-site-00` - **paymentUid** (string) - required - Unique identifier of the payment in the TSP information system. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$`. Example: `977639EE70494C67` - **captureUid** (string) - required - Identifier of the payment capture in the TSP information system. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$`. Example: `8H7GSEE7018GC67` - **apiVersion** (string) - required - API version. Possible values: [`v1.0`] #### Header Parameters - **Authorization** (string) - required - Token for authenticating requests. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...` ``` -------------------------------- ### Get Refunds Status Source: https://developers.tochka.com/docs/pay-gateway/api/get-refunds Retrieves the status of all refunds for a specific payment. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/refunds ### Description Get the statuses of all refunds for a given payment. ### Method GET ### Endpoint /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/refunds ### Parameters #### Path Parameters - **siteUid** (string) - Required - ID of the Site. Possible values: Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$`. Example: `tochka-site-00` - **paymentUid** (string) - Required - Unique identifier of the payment in the merchant's information system. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$`. Example: `977639EE70494C67` - **apiVersion** (string) - Required - API Version. Possible values: [`v1.0`] #### Header Parameters - **Authorization** (string) - Required - Token for request authentication. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...` ``` -------------------------------- ### Account Linking Payment Scenario Source: https://developers.tochka.com/docs/pay-gateway/testing Simulates a successful payment with account linking by generating a dynamic QR code. ```json .... "qrcType": "DYNAMIC", "paymentToken": { "tokenizationPurpose": "Тестирование сценария оплаты с привязкой счета" }, "paymentPurpose": "{\"createQrc\":\"OK_PAYMENT_AND_SUBSCRIPTION_ACCEPTED\"}", .... ``` -------------------------------- ### Get Confirmation Status Source: https://developers.tochka.com/docs/pay-gateway/api/podtverzhdenie Retrieves the status of a specified payment confirmation. ```APIDOC ## GET /payments/confirmations/{confirmation_id}/status ### Description Retrieves the status of a specified payment confirmation. ### Method GET ### Endpoint `/payments/confirmations/{confirmation_id}/status` ### Parameters #### Path Parameters - **confirmation_id** (string) - Required - The ID of the confirmation to retrieve the status for. ``` -------------------------------- ### Get Refund Status Source: https://developers.tochka.com/docs/pay-gateway/api/get-refund Retrieves the status of a specified refund for a payment. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/refunds/{refundUid} ### Description Get the status of the specified refund. ### Method GET ### Endpoint /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/refunds/{refundUid} ### Parameters #### Path Parameters - **siteUid** (string) - Required - ID of the site. Possible values: Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$`. Example: `tochka-site-00` - **paymentUid** (string) - Required - Unique identifier of the payment in the merchant's information system. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$`. Example: `977639EE70494C67` - **refundUid** (string) - Required - Identifier of the refund in the merchant's information system. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$`. Example: `8H7GSEE7018GC67` - **apiVersion** (string) - Required - API version. Possible values: [`v1.0`] #### Header Parameters - **Authorization** (string) - Required - Token for request authentication. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...` ``` -------------------------------- ### Get Captures Source: https://developers.tochka.com/docs/pay-gateway/api/get-captures Retrieves a list of payment capture attempts for a specific payment. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/captures ### Description Get a list of payment confirmation attempts. ### Method GET ### Endpoint /uapi/pay/{apiVersion}/sites/{siteUid}/payments/{paymentUid}/captures ### Parameters #### Path Parameters - **siteUid** (string) - required - ID Сайта. Possible values: Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$`. Example: `tochka-site-00` - **paymentUid** (string) - required - Уникальный идентификатор платежа в информационной системе ТСП. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$`. Example: `977639EE70494C67` - **apiVersion** (string) - required - Версия API. Possible values: [`v1.0`] #### Header Parameters - **Authorization** (string) - required - Токен для аутентификации запросов. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...` ``` -------------------------------- ### Error Responses Source: https://developers.tochka.com/docs/pay-gateway/api/get-cash-register-qr-code-status Details on possible error responses from the API, including their schemas and examples. ```APIDOC ## Error Responses ### Not Found * **Content-Type**: `application/json` **Schema** - **code** (string, required): High-level text code for error classification. Max length: 40 characters. Example: `400` - **id** (string, required): Unique identifier for the error, for auditing purposes. Max length: 40 characters. Example: `c397b21a-d998-4c4d-9471-e60eaf816b87` - **message** (string, required): Brief error message. Max length: 600 characters. Example: `Что-то пошло не так` - **Errors** (array, required): Description of validation errors for a specific field. - **errorCode** (string, required): Low-level text description of the error. Max length: 200 characters. Example: `HTTPBadRequest` - **message** (string, required): Error description. Truncated if it exceeds the maximum value. Max length: 603 characters. Example: `Something going wrong` - **url** (string, required): URL for troubleshooting. Max length: 2083 characters. Must match regex `^https?://[-a-zA-Z0-9¡-+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9¡-+&@#/%=~_|]`. Example: `http://enter.tochka.com/open-banking/docs` **Example Response** ```json { "code": "400", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Что-то пошло не так", "Errors": [ { "errorCode": "HTTPBadRequest", "message": "Something going wrong", "url": "http://enter.tochka.com/open-banking/docs" } ] } ``` ### Locked * **Content-Type**: `application/json` **Schema** - **code** (string, required): High-level text code for error classification. Max length: 40 characters. Example: `400` - **id** (string, required): Unique identifier for the error, for auditing purposes. Max length: 40 characters. Example: `c397b21a-d998-4c4d-9471-e60eaf816b87` - **message** (string, required): Brief error message. Max length: 600 characters. Example: `Что-то пошло не так` - **Errors** (array, required): Description of validation errors for a specific field. - **errorCode** (string, required): Low-level text description of the error. Max length: 200 characters. Example: `HTTPBadRequest` - **message** (string, required): Error description. Truncated if it exceeds the maximum value. Max length: 603 characters. Example: `Something going wrong` - **url** (string, required): URL for troubleshooting. Max length: 2083 characters. Must match regex `^https?://[-a-zA-Z0-9¡-+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9¡-+&@#/%=~_|]`. Example: `http://enter.tochka.com/open-banking/docs` **Example Response** ```json { "code": "400", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Что-то пошло не так", "Errors": [ { "errorCode": "HTTPBadRequest", "message": "Something going wrong", "url": "http://enter.tochka.com/open-banking/docs" } ] } ``` ### Internal Server Error * **Content-Type**: `application/json` **Schema** - **code** (string, required): High-level text code for error classification. Max length: 40 characters. Example: `400` - **id** (string, required): Unique identifier for the error, for auditing purposes. Max length: 40 characters. Example: `c397b21a-d998-4c4d-9471-e60eaf816b87` - **message** (string, required): Brief error message. Max length: 600 characters. Example: `Что-то пошло не так` - **Errors** (array, required): Description of validation errors for a specific field. - **errorCode** (string, required): Low-level text description of the error. Max length: 200 characters. Example: `HTTPBadRequest` - **message** (string, required): Error description. Truncated if it exceeds the maximum value. Max length: 603 characters. Example: `Something going wrong` - **url** (string, required): URL for troubleshooting. Max length: 2083 characters. Must match regex `^https?://[-a-zA-Z0-9¡-+&@#/%?=~_|!:,.;]*[-a-zA-Z0-9¡-+&@#/%=~_|]`. Example: `http://enter.tochka.com/open-banking/docs` **Example Response** ```json { "code": "400", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Что-то пошло не так", "Errors": [ { "errorCode": "HTTPBadRequest", "message": "Something going wrong", "url": "http://enter.tochka.com/open-banking/docs" } ] } ``` ``` -------------------------------- ### Payment by Link Scenario (Token Rejection) Source: https://developers.tochka.com/docs/pay-gateway/testing Simulates a payment rejection by token when using the `SBP_TOKEN` payment method. ```json .... "paymentMethod": { "type":"SBP_TOKEN", "token": "AS1000670LSS7DN18SJQDNP4B05KLJL2", }, "comment": "{\"payWithToken\":\"OK_REJECTED\"}" .... ``` -------------------------------- ### Account Linking Without Payment Scenario Source: https://developers.tochka.com/docs/pay-gateway/testing Tests the scenario of linking an account without payment, specifically simulating a rejection of subscription activation. ```json .... "qrcType": "TOKEN", "paymentToken": { "tokenizationPurpose": "{\"createQrc\":\"OK_SUBSCRIPTION_REJECTED\"}" }, .... ``` -------------------------------- ### Create Payment Source: https://developers.tochka.com/docs/pay-gateway/api/create-payment Initiates a new payment transaction. ```APIDOC ## POST /payments ### Description Creates a payment transaction. ### Method POST ### Endpoint /payments ### Responses #### Success Response (200) OK #### Error Responses - **400** - HTTPBadRequest - **401** - Unauthorized - **403** - Forbidden - **404** - Not Found - **423** - Locked - **500** - Internal Server Error - **501** - Not Implemented - **503** - Service Unavailable ``` -------------------------------- ### Locked Error Response (JSON) Source: https://developers.tochka.com/docs/pay-gateway/api/get-refunds Example of a 'Locked' error response, often indicating a resource is temporarily unavailable or locked. ```json { "code": "400", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Что-то пошло не так" } ``` -------------------------------- ### Get SBP Functional Link Payments Source: https://developers.tochka.com/docs/pay-gateway/api/funkcionalnye-ssylki-sbp Retrieves payment information associated with a previously registered SBP Functional Link. ```APIDOC ## GET /sbp/functional-links/{link_id}/payments ### Description Retrieves payment information associated with a previously registered SBP Functional Link. ### Method GET ### Endpoint /sbp/functional-links/{link_id}/payments ### Parameters #### Path Parameters - **link_id** (string) - Required - The unique identifier of the functional link. ``` -------------------------------- ### Get Tokenization Result Source: https://developers.tochka.com/docs/pay-gateway/api/get-tokenization-result Retrieves the result of a bank account linking operation using a previously registered SBP Functional Link. ```APIDOC ## GET /uapi/pay/{apiVersion}/sites/{siteUid}/sbp/qrc/{qrcId}/tokenization/result ### Description Get the result of a bank account linking operation using a previously registered SBP Functional Link. ### Method GET ### Endpoint /uapi/pay/{apiVersion}/sites/{siteUid}/sbp/qrc/{qrcId}/tokenization/result ### Parameters #### Path Parameters - **siteUid** (string) - Required - ID Сайта. Possible values: Value must match regular expression `^[0-9a-zA-Z-_]{1,64}$`. Example: `tochka-site-00` - **qrcId** (string) - Required - Идентификатор зарегистрированной Функциональной ссылки СБП. Possible values: Value must match regular expression `^[0-9a-zA-Z-]{1,64}$` - **apiVersion** (string) - Required - Версия API. Possible values: [`v1.0`] #### Query Parameters - **qrcIdType** (string) - Required - Тип идентификатора. Possible values: [`NSPK`, `MERCHANT`]. Example: `NSPK` #### Header Parameters - **Authorization** (string) - Required - Токен для аутентификации запросов. Example: `Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...` ### Response #### Success Response (200) - **field1** (type) - Description #### Response Example { "example": "response body" } ``` -------------------------------- ### Configure Test Scenarios for SBP Payments Source: https://developers.tochka.com/docs/pay-gateway/testing Test scenarios for SBP transactions are passed in specific fields depending on the method and QR code type. For 'Create Payment' with SBP token, use the 'comment' field with the 'payWithToken' scenario. ```json "comment" — в запросе при оплате по СБП-токену, принимает поле сценария `payWithToken` ```