### cURL Request Example for Get Accounts List Source: https://developers.tochka.com/docs/tochka-api/api/get-accounts-list-sbp-v-1-0-account-legal-id-get This example shows how to make a GET request to the SBP API to retrieve an account list using cURL. Ensure you replace '' with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/account/LF0000000001' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### cURL Request to Start Refund via SBP API Source: https://developers.tochka.com/docs/tochka-api/api/start-refund-sbp-v-1-0-refund-post This example demonstrates how to initiate a refund using cURL. Ensure you replace `` with your actual authorization token and verify the payload details match your requirements. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/refund' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "Data": { "bankCode": "044525104", "accountCode": "40817810802000000008", "amount": "10", "currency": "RUB", "qrcId": "AS10007GLJ1216F4905A1MTT3CP7GK3N", "purpose": "Оплата по счету № 1 от 01.01.2021. Без НДС", "refTransactionId": "48232c9a-ce82-1593-3cb6-5c85a1ffef8f", "trxId": "A1A2S3D5F6G7H8J9K0C4S5C6D7V5D1K2" } }' ``` -------------------------------- ### Get Customer Info SBP API Request Example (cURL) Source: https://developers.tochka.com/docs/tochka-api/api/get-customer-info-sbp-v-1-0-customer-customer-code-bank-code-get Example of how to call the Get Customer Info SBP API using cURL. Ensure you replace `` with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/customer/300000092/044525104' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Get Subscription List Request Example (cURL) Source: https://developers.tochka.com/docs/tochka-api/api/get-subscription-list-acquiring-v-1-0-subscriptions-get This cURL command demonstrates how to request a list of subscriptions from the acquiring API. It includes the necessary endpoint URL, customer code, and authorization headers. Ensure you replace `` with your actual access token. ```curl curl -L 'https://enter.tochka.com/uapi/acquiring/v1.0/subscriptions?customerCode=300000092' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### cURL Request Example Source: https://developers.tochka.com/docs/tochka-api/api/get-legal-entity-sbp-v-1-0-legal-entity-legal-id-get This example demonstrates how to make a GET request to the legal entity endpoint using cURL. Ensure you replace with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/legal-entity/LF0000000001' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Get Invoice File Request Examples Source: https://developers.tochka.com/docs/tochka-api/api/get-invoice-invoice-v-1-0-bills-customer-code-document-id-file-get Examples of how to request an invoice file using cURL. Ensure you replace '' with your actual authorization token and adjust the URL and headers as needed for your specific request. ```curl curl -L 'https://enter.tochka.com/uapi/invoice/v1.0/bills/300000092/1cf95c4f-e794-4407-bac4-0829f19bd2be/file' \ -H 'Accept: application/pdf' \ -H 'Authorization: Bearer ' ``` ```php ', ]); $response = curl_exec($curl); if (curl_errno($curl)) { echo 'Error:' . curl_error($curl); } curl_close($curl); ?> ``` ```python import requests url = "https://enter.tochka.com/uapi/invoice/v1.0/bills/300000092/1cf95c4f-e794-4407-bac4-0829f19bd2be/file" headers = { "Accept": "application/pdf", "Authorization": "Bearer " } response = requests.get(url, headers=headers) print(response.content) ``` ```java import java.io.IOException; import java.net.URI; import java.net.http.HttpClient; import java.net.http.HttpRequest; import java.net.http.HttpResponse; public class GetInvoiceFile { public static void main(String[] args) throws IOException, InterruptedException { HttpClient client = HttpClient.newHttpClient(); HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://enter.tochka.com/uapi/invoice/v1.0/bills/300000092/1cf95c4f-e794-4407-bac4-0829f19bd2be/file")) .header("Accept", "application/pdf") .header("Authorization", "Bearer ") .build(); HttpResponse response = client.send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); } } ``` ```go package main import ( "fmt" "io/ioutil" "net/http" "strings" ) func main() { url := "https://enter.tochka.com/uapi/invoice/v1.0/bills/300000092/1cf95c4f-e794-4407-bac4-0829f19bd2be/file" payload := strings.NewReader("") req, _ := http.NewRequest("GET", url, payload) req.Header.Add("Accept", "application/pdf") req.Header.Add("Authorization", "Bearer ") client := &http.Client{} res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() body, err := ioutil.ReadAll(res.Body) if err != nil { panic(err) } fmt.Println(string(body)) } ``` -------------------------------- ### Request Example using cURL Source: https://developers.tochka.com/docs/tochka-api/api/get-all-consents-list-consent-v-1-0-consents-get This cURL command demonstrates how to make a request to the Get All Consents List API endpoint. Ensure you replace `` with your actual access token and provide the correct `customer-code`. ```curl curl -L 'https://enter.tochka.com/uapi/consent/v1.0/consents' \ -H 'Accept: application/json' \ -H 'customer-code: 300000092' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Get QR Code Request Example (cURL) Source: https://developers.tochka.com/docs/tochka-api/api/get-qr-code-sbp-v-1-0-qr-code-qrc-id-get This cURL command demonstrates how to make a GET request to retrieve a QR code. Ensure you replace `` with a valid authorization token and the QR code ID with the actual ID. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/qr-code/AS000000000000000000000000000001' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Successful Subscription Charge Response Example Source: https://developers.tochka.com/docs/tochka-api/api/charge-subscription-acquiring-v-1-0-subscriptions-operation-id-charge-post Example of a successful response when charging a subscription. This indicates the operation was processed. ```json { "code": "200", "id": "c397b21a-d998-4c4d-9471-e60eaf816b87", "message": "Operation successful", "Errors": [] } ``` -------------------------------- ### cURL Request Example Source: https://developers.tochka.com/docs/tochka-api/api/create-subscription-with-receipt-acquiring-v-1-0-subscriptions-with-receipt-post This example demonstrates how to make a POST request to create a subscription with receipt acquiring using cURL. Ensure you replace `` with your actual access token. ```curl curl -L 'https://enter.tochka.com/uapi/acquiring/v1.0/subscriptions_with_receipt' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' \ --data-raw '{ \ "Data": { \ "customerCode": "300000092", \ "amount": "1234.00", \ "purpose": "Перевод за оказанные услуги", \ "redirectUrl": "https://example.com", \ "failRedirectUrl": "https://example.com/fail", \ "saveCard": true, \ "consumerId": "fedac807-078d-45ac-a43b-5c01c57edbf8", \ "merchantId": "200000000001056", \ "recurring": true, \ "Options": { \ "trancheCount": 12, \ "period": "Month", \ "daysInPeriod": 14 \ }, \ "paymentLinkId": "string", \ "taxSystemCode": "osn", \ "Client": { \ "name": "Иванов Иван Иванович", \ "email": "ivanov@mail.com", \ "phone": "+7999999999" \ }, \ "Items": [ \ { \ "vatType": "none", \ "name": "string", \ "amount": "1234.00", \ "quantity": 1, \ "paymentMethod": "full_payment", \ "paymentObject": "service", \ "measure": "шт.", \ "Supplier": { \ "phone": "+7999999999", \ "name": "ООО Альтер", \ "taxCode": "660000000000" \ } \ } \ ], \ "Supplier": { \ "phone": "+7999999999", \ "name": "ООО Альтер", \ "taxCode": "660000000000" \ } \ } \ }' ``` -------------------------------- ### Get Refund API Request Example (curl) Source: https://developers.tochka.com/docs/pay-gateway/api/get-refund This example shows how to make a GET request to the Get Refund API endpoint using curl. Ensure you include the correct Authorization header. ```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...' ``` -------------------------------- ### Get Payment API Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/get-payment Example of how to make a GET request to the Get Payment API using cURL. Ensure you replace placeholders with your actual site ID and payment ID, and use a valid authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' ``` -------------------------------- ### Prepare Request Body for Signing Source: https://developers.tochka.com/docs/pay-gateway/request-signature-and-authorization This example shows the content of a request body that will be signed. Ensure the content matches exactly what will be sent in the API request. ```text hello, world ``` -------------------------------- ### Create Subscription Request Example Source: https://developers.tochka.com/docs/tochka-api/api/create-subscription-acquiring-v-1-0-subscriptions-post This example demonstrates how to create a subscription using the Acquiring API v1.0. It requires specific headers including Content-Type, Accept, and Authorization. The request body contains detailed customer and subscription options. ```curl curl -L 'https://enter.tochka.com/uapi/acquiring/v1.0/subscriptions' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "Data": { "customerCode": "300000092", "amount": "1234.00", "purpose": "Перевод за оказанные услуги", "redirectUrl": "https://example.com", "failRedirectUrl": "https://example.com/fail", "saveCard": true, "consumerId": "fedac807-078d-45ac-a43b-5c01c57edbf8", "merchantId": "200000000001056", "recurring": true, "Options": { "trancheCount": 12, "period": "Month", "daysInPeriod": 14 }, "paymentLinkId": "string" } }' ``` -------------------------------- ### Get SBP Payments Request Example Source: https://developers.tochka.com/docs/tochka-api/api/get-payments-sbp-v-1-0-get-sbp-payments-get This example demonstrates how to make a GET request to the SBP payments endpoint using cURL. It includes query parameters for customer code and date, and requires an Authorization header with a bearer token. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/get-sbp-payments?customerCode=300000092&fromDate=2020-12-20' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` ```php "https://enter.tochka.com/uapi/sbp/v1.0/get-sbp-payments?customerCode=300000092&fromDate=2020-12-20", CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", CURLOPT_MAXREDIRS => 10, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_HTTPHEADER => [ "Accept: application/json", "Authorization: Bearer " ], ]); $response = curl_exec($curl); $err = curl_error($curl); curl_close($curl); if ($err) { echo "cURL Error #:". $err; } else { echo $response; } ``` ```python import requests url = "https://enter.tochka.com/uapi/sbp/v1.0/get-sbp-payments?customerCode=300000092&fromDate=2020-12-20" headers = { "Accept": "application/json", "Authorization": "Bearer " } response = requests.get(url, headers=headers) print(response.text) ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, ""); Request request = new Request.Builder() .url("https://enter.tochka.com/uapi/sbp/v1.0/get-sbp-payments?customerCode=300000092&fromDate=2020-12-20") .method("GET", null) .addHeader("Accept", "application/json") .addHeader("Authorization", "Bearer ") .build(); Response response = client.newCall(request).execute(); ``` ```go package main import ( "fmt" "net/http" ) func main() { client := &http.Client{} req, err := http.NewRequest("GET", "https://enter.tochka.com/uapi/sbp/v1.0/get-sbp-payments?customerCode=300000092&fromDate=2020-12-20", nil) if err != nil { panic(err) } req.Header.Add("Accept", "application/json") req.Header.Add("Authorization", "Bearer ") res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() fmt.Println(res) } ``` -------------------------------- ### Subscription Charge Request Example (cURL) Source: https://developers.tochka.com/docs/tochka-api/api/charge-subscription-acquiring-v-1-0-subscriptions-operation-id-charge-post Example of how to charge a subscription using cURL. Ensure you replace `` with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/acquiring/v1.0/subscriptions/48232c9a-ce82-1593-3cb6-5c85a1ffef8f/charge' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "Data": { "amount": "1234.00" } }' ``` -------------------------------- ### API Request Example - cURL Source: https://developers.tochka.com/docs/tochka-api/api/get-balance-info-open-banking-v-1-0-accounts-account-id-balances-get This example demonstrates how to request balance information using cURL. Ensure you replace `` with your valid access token and provide the correct account and sub-account identifiers. ```curl curl -L 'https://enter.tochka.com/uapi/open-banking/v1.0/accounts/40817810802000000008/044525104/balances' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Get Guarantee Status Response Example Source: https://developers.tochka.com/docs/tochka-guarantee/api/get-guarantee-status-guarantee-v-1-0-status-guarantee-id-get This JSON object represents a successful response from the Get Guarantee Status API, detailing all fields associated with a guarantee. ```json { "Data": { "guaranteeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "status": "CREATED", "guaranteeType": "FULFILLMENT", "guaranteeSum": "string", "commission": "string", "discount": "string", "maxDiscount": "string", "exceedingCommission": "string", "maxExceedingCommission": "string", "startDate": "2024-07-29", "endDate": "2024-07-29", "createdAt": "2024-07-29T15:51:28.071Z", "updatedAt": "2024-07-29T15:51:28.071Z", "lotNumber": "string", "releaseType": "digital", "guaranteeNum": "string", "purchaseType": 1, "StatusDetails": { "RequiredDocumentTypes": [ "GUARANTEE_PROJECT" ], "RequiredSignatureDocuments": [ { "documentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "createdAt": "2024-07-29T15:51:28.071Z", "name": "string", "documentType": "GUARANTEE_PROJECT", "fileHash": "string" } ], "InvalidFields": [ { "Location": [ "string" ], "message": "string" } ], "ShippingData": { "shippingAddress": "string", "phone": "string", "name": "string" } }, "Documents": [ { "documentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "createdAt": "2024-07-29T15:51:28.071Z", "name": "string", ``` -------------------------------- ### Example API Request using cURL Source: https://developers.tochka.com/docs/tochka-api/api/register-merchant-sbp-v-1-0-merchant-legal-entity-legal-id-post This example demonstrates how to register a merchant's legal entity for SBP using a cURL command. Ensure you replace '' with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/merchant/legal-entity/LF0000000001' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' \ -d '{ "Data": { "address": "УЛИЦА ТАТАРСКАЯ Б. ДОМ 11", "city": "Москва", "countryCode": "RU", "countrySubDivisionCode": "45", "zipCode": "115184", "brandName": "Кофейня у Артема", "capabilities": "001", "contactPhoneNumber": "79991234567", "mcc": "4121", "scenario": "C2B", "salesMode": "REMOTE" } }' ``` -------------------------------- ### Get Payment Status Request (cURL) Source: https://developers.tochka.com/docs/tochka-api/api/get-payment-status-payment-v-1-0-status-request-id-get Example of how to make a GET request to the payment status endpoint using cURL. Ensure you replace '' with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/payment/v1.0/status/openapi-b96d770e-769f-49ce-9630-890e00d47720' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Create Refund Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/create-refund This example demonstrates how to initiate a refund request using cURL. Ensure to include necessary headers like Content-Type, Accept, Signature, and Authorization. The request body contains refund details such as amount, currency, and callback URL. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67/refunds' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Signature: Wc6UyGaSVfx7qPxHH...cqhVxPaauEe8FsUQQ+/9de+Kvl1Y9Q==' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' \ -d '{ "Data": { "refundUid": "string", "amount": { "currency": "RUB", "amount": "123.45" }, "callbackUrl": "https://test.tochkapay.com/notification", "comment": "Возврат за услугу", "metadata": "{\"key1\":\"value1\",\"key2\":\"value2\"}" } }' ``` -------------------------------- ### Get Payment for Sign List API Request Example (cURL) Source: https://developers.tochka.com/docs/tochka-api/api/get-payment-for-sign-list-payment-v-1-0-for-sign-get Use this cURL command to make a request to the Get Payment for Sign List API. Ensure you replace `` with your actual authorization token. ```curl curl -L 'https://enter.tochka.com/uapi/payment/v1.0/for-sign?customerCode=300000092' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Create Static QR Code with Simulated Payment Source: https://developers.tochka.com/docs/pay-gateway/testing This snippet demonstrates how to create a static QR code and then simulate a successful payment. It's useful for testing the payment acceptance flow for static QR codes. ```json .... "qrcType": "STATIC", "paymentPurpose": "{\"createQrc\": \"OK_PAYMENT_ACCEPTED\"}" .... ``` -------------------------------- ### Get Statements List Request - cURL Source: https://developers.tochka.com/docs/tochka-api/api/get-statements-list-open-banking-v-1-0-statements-get This example demonstrates how to make a request to the Get Statements List endpoint using cURL. Ensure you replace `` with your valid authorization token and that your account has the 'ReadStatements' permission. ```curl curl -L 'https://enter.tochka.com/uapi/open-banking/v1.0/statements' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Request Example using cURL Source: https://developers.tochka.com/docs/tochka-api/api/get-qr-codes-list-sbp-v-1-0-qr-code-legal-entity-legal-id-get This cURL command demonstrates how to request a QR code list for a specific legal entity. Ensure you replace `` with your valid authorization token and adjust the URL if necessary. ```curl curl -L 'https://enter.tochka.com/uapi/sbp/v1.0/qr-code/legal-entity/LF0000000001' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Set Discount Request Example Source: https://developers.tochka.com/docs/tochka-guarantee/api/set-discount-guarantee-v-1-0-set-discount-post This section provides examples of how to make a request to the Set Discount Guarantee API. It shows the structure of the request body, including the guarantee ID and discount value, in various common programming languages and formats. ```curl curl -L 'https://enter.tochka.com/uapi/guarantee/v1.0/set_discount' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{ "Data": { "guaranteeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "discount": "string" } }' ``` ```php 'https://enter.tochka.com/uapi/guarantee/v1.0/set_discount', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS =>'{ "Data": { "guaranteeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "discount": "string" } }', CURLOPT_HTTPHEADER => [ 'Content-Type: application/json', 'Accept: application/json' ], ]); $response = curl_exec($curl); if (curl_errno($curl)) { echo 'Error:' . curl_error($curl); } curl_close($curl); echo $response; ?> ``` ```python import requests import json url = "https://enter.tochka.com/uapi/guarantee/v1.0/set_discount" payload = json.dumps({ "Data": { "guaranteeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "discount": "string" } }) headers = { 'Content-Type': 'application/json', 'Accept': 'application/json' } response = requests.request("POST", url, headers=headers, data=payload) print(response.text) ``` ```java OkHttpClient client = new OkHttpClient().newBuilder() .build(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, "{\n \"Data\": {\n \"guaranteeId\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"discount\": \"string\"\n }\n}"); Request request = new Request.Builder() .url("https://enter.tochka.com/uapi/guarantee/v1.0/set_discount") .method("POST", body) .addHeader("Content-Type", "application/json") .addHeader("Accept", "application/json") .build(); Response response = client.newCall(request).execute(); ``` ```go package main import ( "fmt" "bytes" "net/http" ) func main() { payload := []byte(`{ "Data": { "guaranteeId": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "discount": "string" } }`) req, _ := http.NewRequest("POST", "https://enter.tochka.com/uapi/guarantee/v1.0/set_discount", bytes.NewBuffer(payload)) req.Header.Set("Content-Type", "application/json") req.Header.Set("Accept", "application/json") client := &http.Client{} res, _ := client.Do(req) defer res.Body.Close() var data map[string]interface{} _ = json.NewDecoder(res.Body).Decode(&data) fmt.Printf("%+v\n", data) } ``` -------------------------------- ### Successful Response Example Source: https://developers.tochka.com/docs/tochka-api/api/get-payment-registry-acquiring-v-1-0-registry-get This JSON object represents a successful response from the Get Payment Registry Acquiring API. It includes registry data, payment details, links, and metadata. ```json { "Data": { "Registry": [ { "paymentType": "card", "totalAmount": 18548.39, "paymentId": "A22031016256670100000533E625FCB3", "payments": [ { "purpose": "Футболка женская молочная", "status": "CREATED", "amount": "1234.00", "operationId": "48232c9a-ce82-1593-3cb6-5c85a1ffef8f", "paymentLink": "https://merch.example.com/order/?uuid=16ea4c54-bf1d-4e6a-a1ef-53ad55666e43", "time": "2022-10-18T08:28:59+00:00", "number": "123456", "commission": 18548.39, "enrollmentAmount": 18548.39 } ] } ] }, "Links": { "self": "https://enter.tochka.com/uapi" }, "Meta": { "totalPages": 1 } } ``` -------------------------------- ### Approve Guarantee Request Examples Source: https://developers.tochka.com/docs/tochka-guarantee/api/approve-guarantee-guarantee-v-1-0-approve-guarantee-id-post Examples of how to make a POST request to approve a guarantee. These snippets demonstrate the endpoint and required headers for interacting with the API. ```curl curl -L -X POST 'https://enter.tochka.com/uapi/guarantee/v1.0/approve/:guaranteeId' \ -H 'Accept: application/json' \ -H 'Content-Type: application/json' ``` ```php ``` ```python import requests url = "https://enter.tochka.com/uapi/guarantee/v1.0/approve/:guaranteeId" headers = { "Accept": "application/json", "Content-Type": "application/json" } response = requests.post(url, headers=headers) print(response.text) ``` ```java import okhttp3.*; import java.io.IOException; public class ApproveGuarantee { public static void main(String[] args) throws IOException { OkHttpClient client = new OkHttpClient(); MediaType mediaType = MediaType.parse("application/json"); RequestBody body = RequestBody.create(mediaType, ""); // No request body needed for this endpoint Request request = new Request.Builder() .url("https://enter.tochka.com/uapi/guarantee/v1.0/approve/:guaranteeId") .post(body) .addHeader("Accept", "application/json") .addHeader("Content-Type", "application/json") .build(); Response response = client.newCall(request).execute(); System.out.println(response.body().string()); } } ``` ```go package main import ( "fmt" "net/http" "strings" ) func main() { payload := strings.NewReader("") // No request body needed for this endpoint req, _ := http.NewRequest("POST", "https://enter.tochka.com/uapi/guarantee/v1.0/approve/:guaranteeId", payload) req.Header.Add("Accept", "application/json") req.Header.Add("Content-Type", "application/json") client := &http.Client{} res, err := client.Do(req) if err != nil { panic(err) } defer res.Body.Close() body, err := io.ReadAll(res.Body) if err != nil { panic(err) } fmt.Println(string(body)) } ``` -------------------------------- ### Create Capture Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/create-capture This cURL command demonstrates how to make a request to create a capture. Ensure you include the correct 'Signature' header. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67/captures' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Signature: Wc6UyGaSVfx7qPxHH...cqhVxPaauEe8FsUQQ+/9de+Kvl1Y9Q==' \ ``` -------------------------------- ### Request Example Source: https://developers.tochka.com/docs/tochka-api/api/get-all-child-consents-consent-v-1-0-consents-consent-id-child-get This snippet shows how to make a request to the Get All Child Consents API endpoint using cURL. Ensure you replace the placeholder token with your actual access token. ```curl curl -L 'https://enter.tochka.com/uapi/consent/v1.0/consents/:consentId/child' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer ' ``` -------------------------------- ### Get Refunds API Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/get-refunds This cURL command demonstrates how to request a list of refunds for a specific payment. Ensure your Authorization header contains a valid Bearer token. ```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...' ``` -------------------------------- ### Complete Payment Request Example (cURL) Source: https://developers.tochka.com/docs/pay-gateway/api/complete-payment This cURL command demonstrates how to send a request to complete a payment. Ensure you replace the placeholder token and provide the correct `paRes` value. ```curl curl -L 'https://enter.tochka.com/uapi/pay/v1.0/sites/tochka-site-00/payments/977639EE70494C67/complete' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -H 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6...' \ -d '{ "Data": { "type": "THREE_DS", "paRes": "eJxVjDsOwjAQBe+S0SWKiXHdwMhWmCbXIpZWa+O..." } }' ``` -------------------------------- ### Create Guarantee Request Example Source: https://developers.tochka.com/docs/tochka-guarantee/api/create-guarantee-guarantee-v-1-0-create-post This example demonstrates a complete request payload for creating a guarantee. It includes detailed sections for guarantee data, client data, and tender data. ```curl curl -L 'https://enter.tochka.com/uapi/guarantee/v1.0/create' \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -d '{ \ "Data": { \ "GuaranteeForm": { \ "GuaranteeData": { \ "startDate": "2024-07-29", \ "endDate": "2024-07-29", \ "guaranteeType": "FULFILLMENT", \ "guaranteeSum": 0 \ }, \ "ClientData": { \ "inn": "string", \ "kpp": "string", \ "shortName": "string", \ "fullName": "string", \ "ogrn": "string", \ "jurAddress": "string", \ "factAddress": "string", \ "oktmo": "string", \ "regDate": "2024-07-29", \ "ContactInfo": { \ "name": "string", \ "email": "string", \ "phone": "string", \ "website": "string" \ }, \ "IpInfo": { \ "snils": "string" \ }, \ "UlInfo": { \ "directorDocumentName": "string", \ "directorDocumentNumber": "string", \ "directorDocumentDate": "2024-07-29", \ "directorExpireDate": "2024-07-29" \ }, \ "Heads": [ \ { \ "Passport": { \ "surname": "string", \ "name": "string", \ "lastname": "string", \ "series": "string", \ "number": "string", \ "gender": "Male", \ "birthDate": "2024-07-29", \ "authority": "string", \ "authorityCode": "string", \ "dateBegin": "2024-07-29", \ "birthPlace": "string", \ "registrationAddress": "string" \ }, \ "type": "EIO", \ "partValue": 0, \ "inn": "string", \ "ContactInfo": { \ "email": "string", \ "phone": "string", \ "website": "string" \ } \ } \ ] \ }, \ "TenderData": { \ "lotNumber": "string", \ "lotTitle": "string", \ "purchaseLink": "string", \ "contractNumber": "string", \ "initMaxPrice": 0, \ "okpd2": "string", \ "TenderCustomer": { \ "inn": "string", \ "kpp": "string", \ "shortName": "string", \ "fullName": "string", \ "ogrn": "string", \ "jurAddress": "string", \ "factAddress": "string", \ "oktmo": "string", \ "okopf": "string", \ "ContactInfo": { \ "name": "string", \ "email": "string", \ "phone": "string", \ "website": "string" \ } \ }, \ "ikz": "string", \ "purchaseType": 1 \ } \ }, \ "extKey": "3fa85f64-5717-4562-b3fc-2c963f66afa6" \ } \ }' ```