### 1C: Installing the Extension Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/moduli/new-article/1s-upravlenie-torgovley Steps to install the extension within 1C: Trading Management 11. This involves navigating to specific menu items and uploading a file. ```1c 1. Перейти в пункт меню НСИ и администрирование → Печатные формы, отчеты и обработки * Расширения * В открывшемся окне, нажать «**Добавить из файла** » * Выбираем ранее скачанный файл * После установки расширения, необходимо **перезагрузить** 1С нажав на ссылку ``` -------------------------------- ### 1C: Initial Extension Setup Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/moduli/new-article/1s-upravlenie-torgovley Configuration steps for the 1C extension to enable API integration and payment link generation. Requires filling in essential organizational and API details. ```1c 1. Необходимо перейти в раздел «Настройки интеграции API» 2. Нажать кнопку «Создать» Обязательно Необходимо заполнить все поля 1. Ответственный за платежи - пользователь от имени которого будут создаваться документы «Эквайринговая операция». 2. Организация - организация по которой буду формироваться ссылки на оплату. 3. Договор эквайринга по умолчанию - необходим для корректного заполнения документа «Эквайринговая операция». 4. Эквайринговый терминал по умолчанию - необходим для корректного заполнения документа «Эквайринговая операция». 5. API Токен (из переданных вам интеграционных данных) 6. Uuid link (из переданных вам интеграционных данных) 7. Выберите доступные пользователю виды оплаты 8. Система налогообложения - необходима для корректного формирования кассовых чеков 9. Признак способа расчетов - необходим для корректного формирования кассовых чеков ``` -------------------------------- ### Interkassa API Request Example (JSON) Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api This is an example of a JSON request payload for the Interkassa API. It includes details such as device, client ID, password, request ID, lines of items with quantity, price, payment attribute, tax ID, and description. It also specifies non-cash payment details, tax mode, phone or email, place of transaction, and a flag for a full response. ```json { "Device": "auto", "ClientId": "<идентификатор клиента>", "Password": 1, "RequestId": "<уникальный идентификатор запроса>", "Lines": [ { "Qty": 2500, "Price": 10000, "PayAttribute": 4, "TaxId": 1, "Description": "Булочка с маком" }, { "Qty": 500, "Price": 200000, "PayAttribute": 4, "TaxId": 2, "Description": "Икра чёрная, баклажанная" } ], "NonCash": [ 125000, 0, 0 ], "TaxMode": 1, "PhoneOrEmail": "user@example.com", "Place": "www.example.com", "FullResponse": false } ``` -------------------------------- ### Interkassa API Response Example (JSON) Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api This JSON structure represents a typical response from the Interkassa API when 'FullResponse' is set to false. It includes the RequestId, ClientId, Path, a Response object indicating success or error, FiscalDocNumber, DocNumber, Date and Time, GrandTotal, FiscalSign, DocumentType, and details for QR code generation, fiscal and device serial numbers, and device registration number. ```json { "RequestId": "D35", "ClientId": "", "Path": "/fr/api/v2/Complex", "Response": { "Error": 0 }, "FiscalDocNumber": 31, "DocNumber": 5, "Date": { "Date": { "Day": 15, "Month": 7, "Year": 23 }, "Time": { "Hour": 14, "Minute": 38, "Second": 27 } }, "GrandTotal": 125000, "FiscalSign": 1879546968, "DocumentType": 0, "QR": "t=20170715T1438&s=1250.00&fn=9999078900006825&i=31&fp=1879546968&n=1", "FNSerialNumber": "9999078900006825", "DeviceSerialNumber": "00000000381001017439", "DeviceRegistrationNumber": "3949620073015105" } ``` -------------------------------- ### Get Payment Status Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya Retrieve the current status of an order and fiscal receipt data. This endpoint requires the order ID. ```APIDOC ## POST /{orderId}/status ### Description Retrieve the current status of an order and fiscal receipt data. This endpoint requires the order ID. ### Method POST ### Endpoint https://pay.interkassa.online/api/v1/ecom/payments/{orderId}/status ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order. ### Request Example (No request body is typically needed for a status check, but depends on specific implementation.) ### Response #### Success Response (200) (Response structure for status will vary, typically includes payment status and fiscal data.) #### Response Example ```json { "status": "paid", "fiscalData": { ... } } ``` ``` -------------------------------- ### Generate Payment Link with Python (requests) Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This Python code snippet demonstrates how to initiate a payment by sending a POST request to the Interkassa Online API. It includes setting up headers with an API token, constructing the payment payload with order details, and handling the response. Ensure you replace placeholders with your actual API token and market UUID. ```python import requests import json api_token = 'ВАШ_API_ТОКЕН' url = 'https://pay.interkassa.online/api/v1/ecom/payments/' headers = { 'Content-Type': 'application/json', 'api-token': api_token } payload = { "marketId": "ВАШ_Market_UUid", "orderId": "00128825", "amount": 101000, "receipt": { "lines": [ { "description": "поперсы", "price": 101000, "qty": 1000, "payattribute": 4, "lineattribute": 1, "taxid": 7 } ] }, "paymentMethods": [ {"paymentType": "card"}, {"paymentType": "sbp"} ] } response = requests.post(url, headers=headers, data=json.dumps(payload)) print(response.status_code) print(response.json()) ``` -------------------------------- ### Initiate Refund Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This API endpoint initiates a refund for a previously completed payment. ```APIDOC ## POST /api/v1/ecom/payments/{orderId}/cancel ### Description Initiates a refund for a successful payment. ### Method POST ### Endpoint `https://pay.interkassa.online/api/v1/ecom/payments/{orderId}/cancel` ### Parameters #### Path Parameters - **orderId** (String) - Required - The unique identifier of the order for which the refund is being processed. #### Request Body - **marketId** (String) - Required - The unique identifier of the shop. - **amount** (Integer) - Required - The refund amount in kopecks (cents). ### Response #### Success Response (201 Created) - **status** (String) - Indicates the success of the operation (e.g., "success"). - **message** (String) - A confirmation message (e.g., "OK"). #### Response Example ```json { "status": "success", "message": "OK" } ``` ``` -------------------------------- ### 1C: Extension Workflow Process Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/moduli/new-article/1s-upravlenie-torgovley Outlines the automated workflow of the 1C extension, from link generation and client payment to automatic status updates and document creation. ```1c 1. Формируется ссылка на оплату из документа «Заказ покупателя» 2. Ссылка отправляется клиенту 3. Клиент производит оплату 4. После успешной оплаты, статус в 1С обновляется автоматически. 5. Создается документ «Эквайринговая операция» на основании «Заказа клиента» ``` -------------------------------- ### Server Errors Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Detailed explanations for common server-side errors. ```APIDOC ## Server Errors ### Description This section provides detailed explanations for various server errors. ### Error reading request The server could not read the request body sent by the client. Please check if the request length is correctly specified in the header. ### JSON parsing error The server could not correctly convert the JSON into its internal data structures. Please check the correctness of the transmitted JSON and ensure that the field types comply with the requirements specified in the documentation. ### No suitable devices found (according to the selected strategy) The server attempted to find a suitable device for `TryCount` attempts. You need to change the strategy conditions or increase the `TryCount` value. ### JSON response parsing error The device returned a response that does not contain valid JSON. Upon receiving this error, the server will put the device into an inactive state. ### Device is busy A device was selected that received another request before this one. After waiting for `WaitForFree` seconds, the server will return a 'Device is busy' error. ``` -------------------------------- ### Generate Payment Link with JavaScript (Fetch API) Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This JavaScript code snippet illustrates how to generate a payment link using the Fetch API in a web browser or Node.js environment. It demonstrates making a POST request to the Interkassa Online API with the necessary headers and JSON payload, and includes basic error handling. Remember to replace placeholder values for your API token and market UUID. ```javascript const apiToken = 'ВАШ_API_ТОКЕН'; const url = 'https://pay.interkassa.online/api/v1/ecom/payments/'; const payload = { marketId: "ВАШ_Market_UUid", orderId: "00128825", amount: 101000, receipt: { lines: [ { description: "поперсы", price: 101000, qty: 1000, payattribute: 4, lineattribute: 1, taxid: 7 } ] }, paymentMethods: [ {paymentType: "card"}, {paymentType: "sbp"} ] }; fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json', 'api-token': apiToken }, body: JSON.stringify(payload) }) .then(response => { console.log('Status:', response.status); return response.json(); }) .then(data => console.log(data)) .catch(error => console.error('Error:', error)); ``` -------------------------------- ### Table 3: Taxation Regimes Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Lists the different taxation regimes supported, with their corresponding numerical values. This includes 'General' (1), 'Simplified (income)' (2), 'Simplified (income minus expense)' (4), 'Unified Agricultural Tax' (16), and 'Patent System' (32). ```text Value | Type of taxation system ---|--- 1 | General 2 | Simplified (income) 4 | Simplified (income minus expense) 16 | Unified agricultural tax 32 | Patent system of taxation ``` -------------------------------- ### 1C: Generating Payment Links Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/moduli/new-article/1s-upravlenie-torgovley Instructions on how to generate a payment link from a customer order within the 1C extension. ```1c Для генерации ссылки на оплату, необходимо в заказе перейти на вкладку «**Ссылка** » * Нажать кнопку «**Создать ссылку** » * Если ссылка успешно сформировалась, вы можете скопировать ее по кнопке справа от ссылки ``` -------------------------------- ### Create Payment Link Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This method allows you to create a unique payment link for a client, generating an order and a payment URL. ```APIDOC ## POST /api/v1/ecom/payments/ ### Description Creates an order in the system and generates a payment link for it. ### Method POST ### Endpoint /api/v1/ecom/payments/ ### Authentication Requires authentication via an API token passed in the `api-token` header. - **Header**: `api-token` - **Value**: `` ### Request Body - **marketId** (String) - Required - Unique identifier of the store. - **orderId** (String) - Required - Unique identifier of the order in the client's system. - **amount** (Integer) - Required - Order amount in kopecks. Must match the sum of items in the receipt. - **receipt** (Object) - Required - Object containing data for the fiscal receipt. - **lines** (Array of Objects) - Required - Array of line items in the receipt. Cannot be empty. - **description** (String) - Required - Name of the product or service. - **price** (Integer) - Required - Price per unit of the product in kopecks. - **qty** (Integer) - Required - Quantity of the product in grams. Must be greater than 0. - **taxid** (Integer) - Required - VAT rate code. - **payattribute** (Integer) - Required - Payment item calculation property. - **lineattribute** (Integer) - Required - Line item calculation property. - **taxmode** (Integer) - Optional - Tax system code. - **paymentMethods** (Array of Objects) - Required - Array of objects describing available payment methods. - **paymentType** (String) - Required - Type of payment method (e.g., "card", "sbp"). - **notificationUrl** (String) - Optional - URL for sending payment status notifications. If not specified, the URL from store settings is used. - **returnUrl** (String) - Optional - URL to redirect the client after successful payment. If not specified, the URL from store settings is used. - **buyerId** (String) - Optional - Identifier of the buyer in the client's system. ### Request Example ```json { "marketId": "ddb6597e-5222-4f1a-b41f-b5c2ba10ebb8", "orderId": "00128825", "amount": 101000, "receipt": { "lines": [ { "description": "поперсы", "price": 101000, "qty": 1000, "payattribute": 4, "lineattribute": 1, "taxid": 7 } ], "taxmode": 1 }, "paymentMethods": [ {"paymentType": "card"}, {"paymentType": "sbp"}, {"paymentType": "bnpl"}, {"paymentType": "international"} ] } ``` ### Response #### Success Response (201 CREATED) - **orderId** (String) - The ID of the created order. - **amount** (Integer) - The amount of the order in kopecks. - **paymentUrl** (String) - The unique URL for payment. #### Response Example ```json { "orderId": "00128825", "amount": 101000, "paymentUrl": "https://pay.interkassa.online/orders/link/91eae1731394" } ``` #### Error Response (401 Unauthorized) Returned if the API token is missing or invalid. ``` -------------------------------- ### Initiate Refund Request Body Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya The request body for initiating a refund. It requires the 'marketId' and the 'amount' to be refunded in kopecks. ```JSON { "marketId": "ВАШ_Market_UUid", "amount": __ } ``` -------------------------------- ### Table 2: Taxes Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Provides a mapping of tax codes to their corresponding values or descriptions. Codes range from 1 (VAT 20%) to 10 (VAT 7/107), including options for no tax and different VAT fractions. ```text Code | Value ---|--- 1 | VAT 20% 2 | VAT 10% 3 | VAT 0% 4 | No tax 5 | VAT 20/120 6 | VAT 10/110 7 | VAT 5% 8 | VAT 7% 9 | VAT 5/105 10 | VAT 7/107 ``` -------------------------------- ### Generate Payment Link with PHP (cURL) Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This PHP code snippet shows how to create a payment link using the Interkassa Online API via cURL. It details setting up the POST request with JSON payload, headers including the API token, and retrieving the HTTP status code and response body. Remember to substitute the placeholder API token and market UUID. ```php 'ВАШ_Market_UUid', 'orderId' => '00128825', 'amount' => 101000, 'receipt' => [ 'lines' => [ [ 'description' => 'поперсы', 'price' => 101000, 'qty' => 1000, 'payattribute' => 4, 'lineattribute' => 1, 'taxid' => 7, ], ], ], 'paymentMethods' => [ ['paymentType' => 'card'], ['paymentType' => 'sbp'], ], ]; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload)); curl_setopt($ch, CURLOPT_HTTPHEADER, [ 'Content-Type: application/json', 'api-token: ' . $apiToken, ]); $response = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); echo 'HTTP Code: ' . $httpCode . "\n"; echo $response; ?> ``` -------------------------------- ### Table 1: Document Types Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Reference table mapping numerical codes to different types of documents. This includes 'Receipt' (0), 'Expenditure' (1), 'Receipt Return' (2), and 'Expenditure Return' (3). ```text Parameter | Document Type ---|--- 0 | Receipt 1 | Expenditure 2 | Receipt Return 3 | Expenditure Return ``` -------------------------------- ### Payments API Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/swager Endpoints for managing payments, including creation, status retrieval, and refunds. ```APIDOC ## POST /payments/ ### Description Creates a payment link for processing transactions. ### Method POST ### Endpoint /payments/ ### Parameters #### Request Body - **orderId** (string) - Required - Unique identifier for the order. - **amount** (number) - Required - The amount to be paid. - **currency** (string) - Required - The currency code (e.g., "USD", "EUR"). - **description** (string) - Optional - A description of the payment. ### Request Example ```json { "orderId": "ORD-12345", "amount": 100.50, "currency": "USD", "description": "Payment for order #12345" } ``` ### Response #### Success Response (200) - **payment_id** (string) - Unique identifier for the created payment. - **payment_url** (string) - The URL to redirect the user for payment. #### Response Example ```json { "payment_id": "pay_abc123", "payment_url": "https://pay.interkassa.online/checkout/pay_abc123" } ``` ``` ```APIDOC ## POST /payments/{orderId}/status ### Description Retrieves the current status of a payment associated with a specific order. ### Method POST ### Endpoint /payments/{orderId}/status ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order. ### Response #### Success Response (200) - **orderId** (string) - The order identifier. - **status** (string) - The current status of the payment (e.g., "pending", "completed", "failed"). #### Response Example ```json { "orderId": "ORD-12345", "status": "completed" } ``` ``` ```APIDOC ## POST /payments/{orderId}/cancel ### Description Registers a refund for a completed payment associated with a specific order. ### Method POST ### Endpoint /payments/{orderId}/cancel ### Parameters #### Path Parameters - **orderId** (string) - Required - The unique identifier of the order for which to register a refund. #### Request Body - **refund_amount** (number) - Required - The amount to be refunded. ### Request Example ```json { "refund_amount": 50.25 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the refund registration. #### Response Example ```json { "message": "Refund registered successfully for order ORD-12345" } ``` ``` -------------------------------- ### Create Payment Link Request (JSON) Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This JSON object represents a request to create a payment link. It includes essential details like market ID, order ID, amount, receipt information, and available payment methods. ```json { "marketId": "ddb6597e-5222-4f1a-b41f-b5c2ba10ebb8", "orderId": "00128825", "amount": 101000, "receipt": { "lines": [ { "description": "поперсы", "price": 101000, "qty": 1000, "payattribute": 4, "lineattribute": 1, "taxid": 7 } ], "taxmode": 1 }, "paymentMethods": [ {"paymentType": "card"}, {"paymentType": "sbp"}, {"paymentType": "bnpl"}, {"paymentType": "international"} ] } ``` -------------------------------- ### POST /fr/api/v2/Complex Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api This endpoint is used to process complex operations with a device rented in the 'cloud' service. It requires aTOKEN for enterprise identification. ```APIDOC ## POST /fr/api/v2/Complex ### Description This endpoint facilitates complex operations with a device connected to the cloud service. It requires a TOKEN for enterprise identification and handles automatic shift management. ### Method POST ### Endpoint https://kkt.interkassa.online/fr/api/v2/Complex ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **TOKEN** (string) - Required - The enterprise identifier token. - **data** (object) - Required - The complex operation data. - **Command** (string) - Required - The command to execute. - **Fiscalization** (object) - Optional - Fiscalization details. - **Type** (string) - Required - Type of fiscalization. - **Number** (string) - Optional - Fiscalization number. - **Correction** (object) - Optional - Correction details for check correction. - **Type** (uint8) - Required - Type of correction. - **Number** (uint32) - Required - Number of correction. - **Date** (object) - Required - Date of correction. - **Day** (uint8) - Required - Day of the month. - **Month** (uint8) - Required - Month of the year. - **Year** (uint8) - Required - Year (last two digits). - **Amount** (Money) - Required - Amount of correction. ### Request Example ```json { "TOKEN": "YOUR_ENTERPRISE_TOKEN", "data": { "Command": "ComplexCommand", "Fiscalization": { "Type": "FiscalReceipt", "Number": "12345" }, "Correction": { "Type": 1, "Number": 1234567890, "Date": { "Day": 28, "Month": 2, "Year": 17 }, "Amount": 50000 } } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the status of the operation (e.g., 'success', 'error'). - **message** (string) - A message describing the result of the operation. - **data** (object) - The response data from the command execution. #### Response Example ```json { "status": "success", "message": "Operation completed successfully.", "data": {} } ``` ``` -------------------------------- ### Инструкции по управлению Cookie в браузерах Source: https://gramaxe.interkassa.online/Wiki/yuridicheskie-dokumenty/politika-ispolzovaniya-faylov-cookie Предоставляет пошаговые инструкции для управления файлами cookie в популярных веб-браузерах, таких как Chrome, Opera, Firefox, Microsoft Edge и Internet Explorer. ```Chrome Настройки → Конфиденциальность и безопасность → Файлы cookie и другие данные сайтов (chrome://settings/cookies) ``` ```Opera Настройки → Конфиденциальность и безопасность → Файлы cookie и другие данные сайтов ``` ```Mozilla Firefox Настройки → Приватность и защита → Куки (about:preferences#privacy) ``` ```Microsoft Edge Параметры → Файлы cookie и разрешения сайтов → Управление файлами cookie (edge://settings/cookies) ``` ```Internet Explorer Сервис → Свойства браузера → Конфиденциальность → Параметры → Дополнительно ``` -------------------------------- ### Provider Data: Phone, Name, INN, Excise, CountryOfOrigin, NumberOfCustomsDeclaration, CGNRaw, AdditionalRequisite Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Details about a supplier or provider, including contact information (phone, name, INN), excise details, country of origin, customs declaration number, commodity code (CGNRaw), and additional requisites as defined by the FNS of Russia. ```go package main import "fmt" // Money represents a monetary value. type Money float64 // ProviderData contains information about the provider (tag 1224). type ProviderData struct { Phone string // Provider's phone number (tag 1171) Name string // Provider's name (tag 1225) INN string // Provider's INN (tag 1226) Excise Money // Excise duty (tag 1229) CountryOfOrigin string // Country code of origin (tag 1230) NumberOfCustomsDeclaration string // Customs declaration number (tag 1231) CGNRaw string // Commodity code (HEX string) (tag 1162) AdditionalRequisite string // Additional requisite (tag 1191) } func main() { provider := ProviderData{ Phone: "79334445566", Name: "Tech Supplies Inc.", INN: "7702111222", Excise: 150.75, CountryOfOrigin: "RU", NumberOfCustomsDeclaration: "CN1234567890", CGNRaw: "0a1b2c3d", AdditionalRequisite: "SomeExtraInfo", } fmt.Printf("Provider Name: %s\n", provider.Name) fmt.Printf("Provider INN: %s\n", provider.INN) fmt.Printf("Excise: %.2f\n", provider.Excise) } ``` -------------------------------- ### Cloud Service Error Codes Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Table 7 lists the specific error codes and their descriptions for the cloud service. ```APIDOC ## Cloud Service Error Codes ### Description This section provides a detailed mapping of error codes to their descriptions for the cloud service. ### Table 7: Cloud Service Errors | Code | Description | |---|---| | 1 | Request reading error | | 2 | JSON parsing error | | 3 | `Device` field is missing | | 4 | `Duration` or `QueueLen` field is missing | | 5 | No suitable devices found (according to the selected strategy) | | 6 | Error sending request to device | | 7 | The `Device="auto"` field is only allowed in batch commands | | 8 | Incorrect device name (serial number) or address | | 9 | Incorrect device address | | 10 | Incorrect device name (serial number) | | 12 | Device activation error | | 13 | Device already exists | | 14 | Device not activated | | 15 | Incorrectly formed device password | | 16 | JSON response parsing error | | 17 | `RequestId` field is missing | | 18 | Device is busy | | 19 | Server cache error | | 20 | Asynchronous request queue error | | 21 | The `Callback` field is only allowed in `Batch` and `Complex` commands | | 24 | Request is being processed | ``` -------------------------------- ### Create Payment Link Success Response (JSON) Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya This JSON object shows a successful response after creating a payment link. It contains the order ID and the unique payment URL generated for the client. ```json { "orderId": "00128825", "amount": 101000, "paymentUrl": "https://pay.interkassa.online/orders/link/91eae1731394" } ``` -------------------------------- ### Response Fields: Error, ErrorMessages, Change, Date, DeviceRegistrationNumber, DeviceSerialNumber, FNSerialNumber, FiscalDocNumber, FiscalSign, GrandTotal, QR Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Defines the structure of the response from a device when processing a command. Includes error codes and messages, change amount, timestamps, device and fiscal unit identifiers, fiscal document numbers and signs, grand total, and a QR code. ```python from datetime import datetime class DeviceInfo: def __init__(self, name: str): self.name = name # Serial number of the device class Response: def __init__(self, error: int, error_messages: list[str], change: float, date: datetime, device_registration_number: str, device_serial_number: str, fn_serial_number: str, fiscal_doc_number: int, fiscal_sign: int, grand_total: float, qr: str ): self.error = error # Error code (tag 0) self.error_messages = error_messages # List of error messages self.change = change # Change amount (Money) self.date = date # Date and time of document formation (datetime) self.device_registration_number = device_registration_number # Device registration number (string) self.device_serial_number = device_serial_number # Device serial number (string) self.fn_serial_number = fn_serial_number # Fiscal drive serial number (string) self.fiscal_doc_number = fiscal_doc_number # Fiscal document number (uint32) self.fiscal_sign = fiscal_sign # Fiscal document sign (uint32) self.grand_total = grand_total # Grand total of the check (Money) self.qr = qr # QR code of the check (string) # Example usage: response = Response( error=0, error_messages=[], change=50.50, date=datetime.now(), device_registration_number="REG123", device_serial_number="SN789", fn_serial_number="FNABCDE", fiscal_doc_number=1001, fiscal_sign=1234567890, grand_total=1000.00, qr="http://example.com/qr" ) print(f"Response Error: {response.error}") print(f"Grand Total: {response.grand_total}") ``` -------------------------------- ### Interkassa Provider Data Structure Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Outlines the ProviderData structure for supplier information. It includes supplier phone numbers, customer name, and customer INN. ```plaintext ProviderData (Данные поставщика, тег 1224): Phones (array, тег 1171): Телефоны поставщика. CustomerName (string, тег 1227): Покупатель (клиент). CustomerINN (string, тег 1228): ИНН покупателя (клиента). ``` -------------------------------- ### Interkassa Cloud API DateTime Format Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Illustrates the combined JSON structure for representing both date and time in the Interkassa Cloud API, nesting the Date and Time objects. ```json { "Date": { "Day": 28, "Month": 2, "Year": 17 }, "Time": { "Hour": 13, "Minute": 49, "Second": 32 } } ``` -------------------------------- ### Successful Refund Response Source: https://gramaxe.interkassa.online/Wiki/onlayn-platezhi/api/obschaya-informaciya A successful response (201 CREATED) when initiating a refund. It confirms the refund request has been processed. ```JSON { "status": "success", "message": "OK" } ``` -------------------------------- ### Interkassa Cashier Information Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Details the fields for cashier information, including their name and INN. ```plaintext Person (string, тег 1021): Кассир. PersonINN (string, тег 1203): ИНН кассира. ``` -------------------------------- ### Interkassa User Requisite Structure Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Defines the UserRequisite structure for additional user-specific data in a check. It includes a title and value for custom attributes. ```plaintext UserRequisite (Структура с дополнительным реквизитом пользователя, тег 1084): Title (string, тег 1085): Заголовок дополнительного реквизита пользователя. Value (string, тег 1086): Значение дополнительного реквизита пользователя. ``` -------------------------------- ### Interkassa Line Items Structure Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api Describes the Lines array, representing line items in a transaction. Each item includes quantity, price, payment attribute, tax ID, and description. ```plaintext Lines (Массив товарных позиций, обязательное): Qty (Quantity, обязательное): Количество в тысячных долях. Price (Money, обязательное): Цена в копейках. PayAttribute (uint8): Признак способа расчёта. TaxId (uint8, обязательное): Код налога. Description (string, обязательное): Наименование товарной позиции. ``` -------------------------------- ### Payment Processing API Source: https://gramaxe.interkassa.online/Wiki/oblachaya-kassa/api/cloud-api This section details the parameters required for processing payments through the Interkassa API. It covers various fields related to the transaction, customer, and tax information. ```APIDOC ## POST /api/payment ### Description This endpoint processes online payments using various parameters including group, device, request ID, client ID, document type, payment amounts (cash, non-cash, advance, credit, consideration), tax mode, customer contact information, and optional details like place of settlement and maximum documents per shift. ### Method POST ### Endpoint /api/payment ### Parameters #### Request Body - **Group** (string): Merchant identifier. Obtainable from your personal account. - **Device** (string, required): Must be set to `auto`. - **RequestId** (string, required): Unique identifier for the request. - **ClientId** (string): Identifier for the client. Useful if you have multiple websites and the `RequestId` might be the same. - **DocumentType** (uint8, required): Type of receipt (refer to Table 1). - **Cash** (Money): Amount paid in cash. Can be omitted if zero. - **NonCash** (3 × Money, required): An array of 3 elements representing amounts paid by different payment types (e.g., Visa, MasterCard, Mir). If no breakdown is needed, use `[1000, 0, 0]`. - **AdvancePayment** (Money): Amount paid as advance payment. Can be omitted if zero. - **Credit** (Money): Amount paid on credit. Can be omitted if zero. - **Consideration** (Money): Amount paid as consideration. Can be omitted if zero. - **TaxMode** (uint8): Tax system applied in the receipt (refer to Table 3). Specify the system if multiple modes were selected during device registration. Can be omitted if only one system was chosen. - **PhoneOrEmail** (string): Buyer's phone number or email address. Phone format: "7XXXXXXXXXX" or "7-XXX-XXX-XX-XX". - **Place** (string): Place of settlement. If not set during cash register registration, it must be provided in each receipt. - **MaxDocumentsInTurn** (uint16): Maximum number of documents in a single shift. - **FullResponse** (bool): Boolean flag to receive a full response. `true` for a complete response across all commands (similar to `Batch` command response), `false` for a shortened response. - **PaymentAgentModes** (uint8, tag 1057): Agent mode for the document (refer to Table 5). This is a bitmask and applies to all document entries if specified. **UserRequisite** (Structure for additional user requisites, tag 1084): Can be included in the receipt based on the business sector's specifics. - **Title** (string, required, tag 1085): Title of the additional user requisite. - **Value** (string, required, tag 1086): Value of the additional user requisite. - **Person** (string, tag 1021): Cashier's name. - **PersonINN** (string, tag 1203): Cashier's INN (Taxpayer Identification Number). **TransferOperatorData** (Transfer Operator Data): - **Phones** (array, tag 1075): Transfer operator's phone numbers in "7XXXXXXXXXX" format. - **Name** (string, tag 1026): Name of the transfer operator. - **Address** (string, tag 1005): Address of the transfer operator. - **INN** (string, tag 1016): INN of the transfer operator. **GetPaymentOperatorData** (Payment Receiving Operator Data): - **Phones** (array, tag 1074): Payment receiving operator's phone numbers in "7XXXXXXXXXX" or "7-XXX-XXX-XX-XX" format. **AgentData** (Payment Agent Data): - **Operation** (string, tag 1044): Payment agent's operation. - **Phones** (array, tag 1073): Payment agent's phone numbers in "7XXXXXXXXXX" or "7-XXX-XXX-XX-XX" format. **ProviderData** (Provider Data, tag 1224): - **Phones** (array, tag 1171): Provider's phone numbers in "7XXXXXXXXXX" or "7-XXX-XXX-XX-XX" format. - **CustomerName** (string, tag 1227): Buyer (client) name. - **CustomerINN** (string, tag 1228): Buyer (client) INN. **Lines** (Array of line items, required): - **Qty** (Quantity, required): Quantity in thousandths. For example, 2.5 kg is represented as `2500` (2.5 * 1000). - **Price** (Money, required): Price in kopecks. - **PayAttribute** (uint8): Payment calculation method indicator (refer to Table 4). - **TaxId** (uint8, required): Tax code (1-6) (refer to Table 2). For example, "VAT 20%". - **Description** (string, required): Description of the line item. Cannot be empty. ### Request Example ```json { "Group": "example_group_id", "Device": "auto", "RequestId": "unique_request_123", "DocumentType": 1, "NonCash": [1000, 0, 0], "Lines": [ { "Qty": 1000, "Price": 50000, "TaxId": 1, "Description": "Example Product" } ] } ``` ### Response #### Success Response (200) - **Status** (string): Indicates the success of the operation (e.g., "OK"). - **Message** (string): A confirmation message. #### Response Example ```json { "Status": "OK", "Message": "Payment processed successfully." } ``` ```