FiscalCloud API (v1)

Download OpenAPI specification:Download

Introduction

This guide will help you access the FiscalCloud system programming interface. The FiscalCloud API consists of a series of REST endpoints for interacting with the cash register equipment and control. Communication is carried out through HTTP requests to the respective endpoints.

Authentication

To make requests to the FiscalCloud API, you need to add the following data in the Headers section of the request:

  • Api-Key - the API key assigned to the user.
  • Api-DeviceId - the identifier of the cash register and control equipment (only for endpoints where it is requested)
  • Api-PointOfSaleId - the point of sale identifier (only for endpoints where it is requested). It is OPTIONAL if there is only one point of sale.
  • Api-Timestamp - the current universal time (UTC zone) in Unix timestamp format in milliseconds, e.g., for the date/time 31.05.2023 15:30:00 the value will be 1685536200000. The time must not differ from the correct time by more than +/- 10 minutes.
  • Api-Signature - the HMAC-SHA256 signature, in hexadecimal form (lowercase, without hyphens), using the secret API key assigned to the user, applied to the following data, concatenated into a string:
    • the value of the Api-DeviceId header (if present)
    • the value of the Api-PointOfSaleId header (if present)
    • the value of the Api-Timestamp header
    • the HTTP method, in uppercase, e.g.: GET, POST
    • the endpoint to which the request is made, including URI parameters, but excluding the server address, e.g.: /api/v1/cashoperations?StartIndex=30
    • the request body (where applicable - for POST, PUT type queries)

Endpoint Differences

The first section "Integrated operations" describes high-level operations:

  • Sale: Process a sale transaction, returning the resulting receipt.
  • Return: Handle a return operation, generating the appropriate receipt.
  • Close Day: Execute end-of-day reporting and closure ("Settlement" on the bank terminal and "Z-report" on the fiscal device).
  • Intermediate Totals: Generate an intermediate totals report ("PrintTotals" on the bank terminal and "X-report" on the fiscal device).

These endpoints simplify integration by automatically managing underlying receipts and incorporate advanced features:

  • Automatic Bank Terminal Integration: If a payment in the request includes the UseBankTerminal flag set to true, the system seamlessly integrates with the configured bank terminal for payment processing. If more than one bank terminal is configured, then it is mandatory to specify the BankTerminal in the payment details.
  • Automatic Fiscal/Alternative Receipt Switching: If the use of alternative receipts ("Bon de plata") is enabled in the fiscal device, the Sale operation dynamically selects between fiscal receipts and alternative receipts based on Tax Authority server availability.

The remaining sections describe lower-level endpoints that provide basic operations for managing receipts and other aspects of the system.

Examples

C#

Example in C# language.

using System.Net.Http.Json;
using System.Security.Cryptography;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;

namespace FiscalCloud.Server.API.ComplexExamples;

public class CSharpExample
{
    private readonly HttpClient _httpClient = new();
    private readonly string apiKey = "2nWjc9v5Jr5c4XJCqQVosYb67BwxhwnZwSsNuA0LbyPvXYveQFzKAqMGOj8Doyz2";
    private readonly string apiSecret = "w6IcKa2UsJe63gqwTuaidvQOZclmaJvlyXHOwgDplU5K3hZWGCUSmVj1rI5n8xU5";
    private readonly string deviceId = "0875b8a5-0668-41a3-a3fa-8eeccf66d289";

    public CSharpExample()
    {
        _httpClient.BaseAddress = new Uri("http://localhost:50700/api/v1/");
    }

    public async Task SaleExample()
    {
        var saleRequest = new
        {
            ReceiptMode = "FiscalReceiptOnly",
            SendToEmail = true,
            EmailAddress = "test@mail.com",
            SendToPhone = true,
            PhoneNumber = "079000001",
            Items = new[]
            {
                new
                {
                    Name = "Piine Praga (Franzeluta)",
                    Quantity = 2.000m,
                    Price = 8.10m,
                    ModifierMode = "ByPercent",
                    ModifierValue = -15.00m,
                    TaxGroupCode =  "B"
                },
                new
                {
                    Name = "Gura Cainarului 1.5l Necarbogazoasa",
                    Quantity = 1.000m,
                    Price = 12.00m,
                    ModifierMode = "ByAmount",
                    ModifierValue = -1.00m,
                    TaxGroupCode =  "A"
                }
            },
            Payments = new[]
            {
                new
                {
                    TypeCode = 1,
                    Amount = 15.00m,
                    UseBankTerminal = true,
                },
                new
                {
                    TypeCode = 0,
                    Amount = 10.00m,
                    UseBankTerminal = false,
                }
            },
            AmountModifications = new[]
            {
                new
                {
                    Mode = "ByPercent",
                    Value = -25.00m
                }
            }
        };

        var response = await SendAsync(HttpMethod.Post, "operations/sale", saleRequest, apiKey, apiSecret);
        Console.WriteLine(response.ToString());
    }

    public async Task CreateFiscalReceiptExample()
    {
        var receipt = new
        {
            SendToEmail = true,
            EmailAddress = "test@mail.com",
            SendToPhone = true,
            PhoneNumber = "079000001",
            Items = new[]
            {
                new
                {
                    Name = "Piine Praga (Franzeluta)",
                    Quantity = 2.000m,
                    Price = 8.10m,
                    ModifierMode = "ByPercent",
                    ModifierValue = -15.00m,
                    TaxGroupCode =  "B"
                },
                new
                {
                    Name = "Gura Cainarului 1.5l Necarbogazoasa",
                    Quantity = 1.000m,
                    Price = 12.00m,
                    ModifierMode = "ByAmount",
                    ModifierValue = -1.00m,
                    TaxGroupCode =  "A"
                }
            },
            Payments = new[]
            {
                new
                {
                    TypeCode = 1,
                    Amount = 15.00m
                },
                new
                {
                    TypeCode = 0,
                    Amount = 10.00m
                }
            },
            AmountModifications = new[]
            {
                new
                {
                    Mode = "ByPercent",
                    Value = -25.00m
                }
            }
        };

        var response = await SendAsync(HttpMethod.Post, "receipts", receipt, apiKey, apiSecret);
        Console.WriteLine(response.ToString());
    }

    public async Task CloseDayExample()
    {
        var closeDayRequest = new { };

        var response = await SendAsync(HttpMethod.Post, "operations/closeday", closeDayRequest, apiKey, apiSecret);
        Console.WriteLine(response.ToString());
    }

    public async Task IntermediateTotalsExample()
    {
        var intermediateTotalsRequest = new { };

        var response = await SendAsync(HttpMethod.Post, "operations/intermediatetotals", intermediateTotalsRequest, apiKey, apiSecret);
        Console.WriteLine(response.ToString());
    }

    private async Task<HttpResponseMessage> SendRequestAsync<TRequest>(HttpMethod httpMethod, string requestUri, TRequest? requestBody, string apiKey, string apiSecret)
    {
        var jsonBody = requestBody is not null ? JsonSerializer.Serialize(requestBody) : null;

        HttpRequestMessage httpRequest = new(httpMethod, requestUri);
        if (jsonBody is not null)
            httpRequest.Content = new StringContent(jsonBody, Encoding.UTF8, "application/json");

        var timestamp = DateTimeOffset.UtcNow.ToUnixTimeMilliseconds().ToString();
        var pathAndQuery = new Uri(_httpClient.BaseAddress!, httpRequest.RequestUri!).PathAndQuery;
        var signature = CalculateHmacSHA256Signature(deviceId, pointOfSaleId: string.Empty, timestamp,
            httpMethod.Method.ToUpperInvariant(), pathAndQuery, jsonBody, apiSecret);

        httpRequest.Headers.Add("Api-Key", apiKey);
        httpRequest.Headers.Add("Api-Timestamp", timestamp);
        httpRequest.Headers.Add("Api-Signature", signature);
        httpRequest.Headers.Add("Api-DeviceId", deviceId);

        var httpResponse = await _httpClient.SendAsync(httpRequest);
        return httpResponse;
    }

    private async Task<JsonObject> SendAsync<TRequest>(HttpMethod httpMethod, string requestUri, TRequest? requestBody, string apiKey, string apiSecret)
    {
        var httpResponse = await SendRequestAsync(httpMethod, requestUri, requestBody, apiKey, apiSecret);
        if (!httpResponse.IsSuccessStatusCode && httpResponse.StatusCode != System.Net.HttpStatusCode.UnprocessableEntity)
            httpResponse.EnsureSuccessStatusCode();
        return await httpResponse.Content.ReadFromJsonAsync<JsonObject>()
            ?? throw new ApplicationException("Invalid server response. Please try again.");
    }

    private static string CalculateHmacSHA256Signature(string? deviceId, string? pointOfSaleId, string timestamp,
        string method, string pathAndQuery, string? requestBody, string secretKey)
    {
        string dataToSign = $"{deviceId}{pointOfSaleId}{timestamp}{method}{pathAndQuery}{requestBody}";
        byte[] keyBytes = Encoding.ASCII.GetBytes(secretKey);
        using var hmac = new HMACSHA256(keyBytes);
        byte[] hashBytes = hmac.ComputeHash(Encoding.UTF8.GetBytes(dataToSign));
        return BitConverter.ToString(hashBytes).Replace("-", "").ToLower();
    }

}
1C:Enterprise

Example in 1C:Enterprise language.



&НаКлиенте
Процедура ВыполнитьПродажу(Команда)
    
    ПараметрыСоединения = ПолучитьПараметрыСоединения();
    
    Товары = Новый Массив;
    
    Товар = Новый Структура;
    Товар.Вставить("Name", "Piine Praga (Franzeluta)");
    Товар.Вставить("Quantity", 2);
    Товар.Вставить("Price", 8.1);
    Товар.Вставить("ModifierMode", "ByPercent");
    Товар.Вставить("ModifierValue", -15);
    Товар.Вставить("TaxGroupCode", "B");
    Товары.Добавить(Товар);
    
    Товар = Новый Структура;
    Товар.Вставить("Name", "Gura Cainarului 1.5l Necarbogazoasa");
    Товар.Вставить("Quantity", 1);
    Товар.Вставить("Price", 12);
    Товар.Вставить("ModifierMode", "ByAmount");
    Товар.Вставить("ModifierValue", -1);
    Товар.Вставить("TaxGroupCode", "A");
    Товары.Добавить(Товар);
    
    Оплаты = Новый Массив;
    Оплаты.Добавить(Новый Структура("TypeCode, Amount, UseBankTerminal", 1, 15, Истина));
    Оплаты.Добавить(Новый Структура("TypeCode, Amount", 0, 10));
    
    ИзмененияСуммы = Новый Массив;
    ИзмененияСуммы.Добавить(Новый Структура("Mode, Value", "ByPercent", -25));
    
    СодержимоеЗапроса = Новый Структура;
    СодержимоеЗапроса.Вставить("ReceiptMode", "FiscalReceiptOnly");
    СодержимоеЗапроса.Вставить("SendToEmail", Истина);
    СодержимоеЗапроса.Вставить("EmailAddress", "test@mail.com");
    СодержимоеЗапроса.Вставить("Items", Товары);
    СодержимоеЗапроса.Вставить("Payments", Оплаты);
    СодержимоеЗапроса.Вставить("AmountModifications", ИзмененияСуммы);
    
    СтруктураОтвета = ВыполнитьЗапрос("operations/sale", СодержимоеЗапроса, "POST", ПараметрыСоединения);
    
    Если Не СтруктураОтвета.Success Тогда
        Сообщить(СтруктураОтвета.Message);
        Возврат;
    КонецЕсли;
    
    // Handle SaleResponse: e.g., if СтруктураОтвета.Data.ReceiptType = "FiscalReceipt" then access FiscalReceipt
    Сообщить("Продажа выполнена успешно. Тип: " + СтруктураОтвета.Data.ReceiptType);
    
КонецПроцедуры

&НаКлиенте
Процедура СоздатьФискальныйЧек(Команда)
    
    ПараметрыСоединения = ПолучитьПараметрыСоединения();
    
    Товары = Новый Массив;
    
    Товар = Новый Структура;
    Товар.Вставить("Name", "Piine Praga (Franzeluta)");
    Товар.Вставить("Quantity", 2);
    Товар.Вставить("Price", 8.1);
    Товар.Вставить("ModifierMode", "ByPercent");
    Товар.Вставить("ModifierValue", -15);
    Товар.Вставить("TaxGroupCode", "B");
    Товары.Добавить(Товар);
    
    Товар = Новый Структура;
    Товар.Вставить("Name", "Gura Cainarului 1.5l Necarbogazoasa");
    Товар.Вставить("Quantity", 1);
    Товар.Вставить("Price", 12);
    Товар.Вставить("ModifierMode", "ByAmount");
    Товар.Вставить("ModifierValue", -1);
    Товар.Вставить("TaxGroupCode", "A");
    Товары.Добавить(Товар);
    
    Оплаты = Новый Массив;
    Оплаты.Добавить(Новый Структура("TypeCode, Amount", 1, 15));
    Оплаты.Добавить(Новый Структура("TypeCode, Amount", 0, 10));
    
    ИзмененияСуммы = Новый Массив;
    ИзмененияСуммы.Добавить(Новый Структура("Mode, Value", "ByPercent", -25));
    
    СодержимоеЗапроса = Новый Структура;
    СодержимоеЗапроса.Вставить("SendToEmail", Истина);
    СодержимоеЗапроса.Вставить("EmailAddress", "test@mail.com");
    СодержимоеЗапроса.Вставить("Items", Товары);
    СодержимоеЗапроса.Вставить("Payments", Оплаты);
    СодержимоеЗапроса.Вставить("AmountModifications", ИзмененияСуммы);
    
    СтруктураОтвета = ВыполнитьЗапрос("receipts", СодержимоеЗапроса, "POST", ПараметрыСоединения);  
    
    Если Не СтруктураОтвета.Success Тогда
        Сообщить(СтруктураОтвета.Message);
        Возврат;
    КонецЕсли;
    
КонецПроцедуры

&НаКлиенте
Процедура ВыполнитьЗакрытиеДня(Команда)
    
    ПараметрыСоединения = ПолучитьПараметрыСоединения();
    
    СодержимоеЗапроса = Новый Структура;
    
    СтруктураОтвета = ВыполнитьЗапрос("operations/closeday", СодержимоеЗапроса, "POST", ПараметрыСоединения);
    
    Если Не СтруктураОтвета.Success Тогда
        Сообщить(СтруктураОтвета.Message);
        Возврат;
    КонецЕсли;
    
    Сообщить("Закрытие дня выполнено успешно.");
    
КонецПроцедуры

&НаКлиенте
Процедура ВыполнитьПромежуточныеИтоги(Команда)
    
    ПараметрыСоединения = ПолучитьПараметрыСоединения();
    
    СодержимоеЗапроса = Новый Структура;
    
    СтруктураОтвета = ВыполнитьЗапрос("operations/intermediatetotals", СодержимоеЗапроса, "POST", ПараметрыСоединения);
    
    Если Не СтруктураОтвета.Success Тогда
        Сообщить(СтруктураОтвета.Message);
        Возврат;
    КонецЕсли;
    
    Сообщить("Промежуточные итоги выполнены успешно.");
    
КонецПроцедуры

&НаКлиенте
Функция ПолучитьПараметрыСоединения()
    
    ПараметрыСоединения = Новый Структура;
    ПараметрыСоединения.Вставить("Сервер", "localhost");
    ПараметрыСоединения.Вставить("Порт", 50700);
    ПараметрыСоединения.Вставить("SSL", Ложь);
    ПараметрыСоединения.Вставить("КлючAPI", "2nWjc9v5Jr5c4XJCqQVosYb67BwxhwnZwSsNuA0LbyPvXYveQFzKAqMGOj8Doyz2");
    ПараметрыСоединения.Вставить("ПарольAPI", "w6IcKa2UsJe63gqwTuaidvQOZclmaJvlyXHOwgDplU5K3hZWGCUSmVj1rI5n8xU5");
    ПараметрыСоединения.Вставить("ИдентификаторУстройства", "0875b8a5-0668-41a3-a3fa-8eeccf66d289");
    
    Возврат ПараметрыСоединения;
    
КонецФункции

#Область СлужебныеМетоды

&НаКлиенте
Функция ВыполнитьЗапрос(Операция, ПараметрыСоединенияЗапроса = Неопределено, Метод = "GET", ПараметрыСоединения) Экспорт
    
    Соединение = Новый HTTPСоединение(ПараметрыСоединения.Сервер, ПараметрыСоединения.Порт, , , , 60, 
        ?(ПараметрыСоединения.SSL, Новый ЗащищенноеСоединениеOpenSSL, Неопределено));
        
    Запрос = Новый HTTPЗапрос("/api/v1/" + Операция);
    
    ТелоЗапроса = "";
    Если ВРег(Метод) = "POST" Тогда
        Если ТипЗнч(ПараметрыСоединенияЗапроса) = Тип("Структура") Тогда
            Запрос.Заголовки.Вставить("Content-Type", "application/json");
            ТелоЗапроса = СериализоватьВJSON(ПараметрыСоединенияЗапроса);
            Запрос.УстановитьТелоИзСтроки(ТелоЗапроса);
        Иначе
            ВызватьИсключение НСтр("ru = 'Неподдерживаемый тип параметров запроса'");
        КонецЕсли;
    ИначеЕсли ПараметрыСоединенияЗапроса <> Неопределено И ПараметрыСоединенияЗапроса.Количество() > 0 Тогда 
        URLПараметрыСоединенияЗапроса = СоединитьПараметрыСоединенияВСтроку(ПараметрыСоединенияЗапроса);
        Запрос.АдресРесурса = Запрос.АдресРесурса + "?" + URLПараметрыСоединенияЗапроса;
    КонецЕсли;
    
    ОтметкаВремени = XMLСтрока((УниверсальноеВремя(ТекущаяДатаСеанса()) - '19700101') * 1000);
    МассивСтрок = Новый Массив;
    МассивСтрок.Добавить(ПараметрыСоединения.ИдентификаторУстройства);
    МассивСтрок.Добавить(ОтметкаВремени);
    МассивСтрок.Добавить(ВРег(Метод));
    МассивСтрок.Добавить(Запрос.АдресРесурса);
    МассивСтрок.Добавить(ТелоЗапроса);
    ДанныеДляПодписи = СтрСоединить(МассивСтрок, "");
    Подпись = HMACSHA256(ПолучитьДвоичныеДанныеИзСтроки(ПараметрыСоединения.ПарольAPI), ПолучитьДвоичныеДанныеИзСтроки(ДанныеДляПодписи));
    
    Запрос.Заголовки.Вставить("Api-Key", ПараметрыСоединения.КлючAPI);
    Запрос.Заголовки.Вставить("Api-Timestamp", ОтметкаВремени);
    Запрос.Заголовки.Вставить("Api-Signature", НРег(ПолучитьHexСтрокуИзДвоичныхДанных(Подпись)));
    Запрос.Заголовки.Вставить("Api-DeviceId", ПараметрыСоединения.ИдентификаторУстройства);
    
    СообщениеОшибки = "";
    Попытка
        Ответ = Соединение.ВызватьHTTPМетод(Метод, Запрос);
        ТелоОтвета = Ответ.ПолучитьТелоКакСтроку();	
    Исключение
        Ошибка = ИнформацияОбОшибке();
        ПричинаОшибки = Ошибка.Причина;
        Если ПричинаОшибки <> Неопределено Тогда
            СообщениеОшибки = ПричинаОшибки.Описание;
        Иначе
            СообщениеОшибки = ОписаниеОшибки();
        КонецЕсли;
    КонецПопытки;
        
    Если Не ПустаяСтрока(СообщениеОшибки) Тогда
        СтруктураОтвета = Новый Структура;
        СтруктураОтвета.Вставить("Success", Ложь);	
        СтруктураОтвета.Вставить("Message", СообщениеОшибки);
        Возврат СтруктураОтвета;		
    КонецЕсли;
    
    ТипСодержимого = Ответ.Заголовки["Content-Type"];
    Если ТипЗнч(ТипСодержимого) = Тип("Строка") И СтрНачинаетсяС(ТипСодержимого, "application/json") Тогда
        СтруктураОтвета = ДесериализоватьИзJSON(ТелоОтвета);
    ИначеЕсли Ответ.КодСостояния >= 200 И Ответ.КодСостояния <= 299 Тогда
        СтруктураОтвета = Новый Структура("Success, Message, Data", Истина, "", Ответ.ПолучитьТелоКакДвоичныеДанные());
    Иначе
        СтруктураОтвета = Новый Структура("Success, Message", Ложь, ТелоОтвета);
    КонецЕсли;
    
    Возврат СтруктураОтвета;
    
КонецФункции

&НаКлиенте
Функция СериализоватьВJSON(СериализуемыйОбъект)
    
    ЗаписьJSON = Новый ЗаписьJSON; 
    ЗаписьJSON.УстановитьСтроку();
    ЗаписатьJSON(ЗаписьJSON, СериализуемыйОбъект); 
    СтрокаJSON = ЗаписьJSON.Закрыть();
    
    Возврат СтрокаJSON; 

КонецФункции 

&НаКлиенте
Функция ДесериализоватьИзJSON(СтрокаJSON)
    
    ЧтениеJSON = Новый ЧтениеJSON(); 
    ЧтениеJSON.УстановитьСтроку(СтрокаJSON); 
    ДесериализованныйОбъект = ПрочитатьJSON(ЧтениеJSON); 
    ЧтениеJSON.Закрыть();  
    
    Возврат ДесериализованныйОбъект;
    
КонецФункции

&НаКлиенте
Функция СоединитьПараметрыСоединенияВСтроку(ПараметрыСоединенияЗапроса, Соединитель = "&")
    
    Счетчик = 1;
    ТелоЗапроса = "";
    Для каждого КлючИЗначение Из ПараметрыСоединенияЗапроса Цикл
        ТелоЗапроса = ТелоЗапроса + ?(Счетчик > 1, Соединитель, "") + КлючИЗначение.Ключ + "=" + КлючИЗначение.Значение;	
        Счетчик = Счетчик + 1;
    КонецЦикла; 
    
    Возврат ТелоЗапроса;
    
КонецФункции

#КонецОбласти  

#Область Криптография

&НаСервере
Функция HMACSHA256(Знач Ключ, Знач Данные) Экспорт
    
    Возврат HMAC(Ключ, Данные, ХешФункция.SHA256, 64);
    
КонецФункции

&НаСервере
Функция Хеш(ДвоичныеДанные, Тип)
    
    Хеширование = Новый ХешированиеДанных(Тип);
    Хеширование.Добавить(ДвоичныеДанные);
    
    Возврат Хеширование.ХешСумма;
        
КонецФункции

&НаСервере
Функция HMAC(Знач Ключ, Знач Данные, Тип, РазмерБлока)
    
    Если Ключ.Размер() > РазмерБлока Тогда
        Ключ = Хеш(Ключ, Тип);
    КонецЕсли;
    
    Если Ключ.Размер() <= РазмерБлока Тогда
        Ключ = ПолучитьHexСтрокуИзДвоичныхДанных(Ключ);
        Ключ = Лев(Ключ + ПовторитьСтроку("00", РазмерБлока), РазмерБлока * 2);
    КонецЕсли;
    
    Ключ = ПолучитьБуферДвоичныхДанныхИзДвоичныхДанных(ПолучитьДвоичныеДанныеИзHexСтроки(Ключ));
    
    ipad = ПолучитьБуферДвоичныхДанныхИзHexСтроки(ПовторитьСтроку("36", РазмерБлока));
    opad = ПолучитьБуферДвоичныхДанныхИзHexСтроки(ПовторитьСтроку("5c", РазмерБлока));
    
    ipad.ЗаписатьПобитовоеИсключительноеИли(0, Ключ);
    ikeypad = ПолучитьДвоичныеДанныеИзБуфераДвоичныхДанных(ipad);
    
    opad.ЗаписатьПобитовоеИсключительноеИли(0, Ключ);
    okeypad = ПолучитьДвоичныеДанныеИзБуфераДвоичныхДанных(opad);
    
    Возврат Хеш(СклеитьДвоичныеДанные(okeypad, Хеш(СклеитьДвоичныеДанные(ikeypad, Данные), Тип)), Тип);
    
КонецФункции

&НаСервере
Функция СклеитьДвоичныеДанные(ДвоичныеДанные1, ДвоичныеДанные2)
    
    МассивДвоичныхДанных = Новый Массив;
    МассивДвоичныхДанных.Добавить(ДвоичныеДанные1);
    МассивДвоичныхДанных.Добавить(ДвоичныеДанные2);
    
    Возврат СоединитьДвоичныеДанные(МассивДвоичныхДанных);
    
КонецФункции

&НаСервере
Функция ПовторитьСтроку(Строка, Количество)
    
    Части = Новый Массив(Количество);
    Для к = 1 По Количество Цикл
        Части.Добавить(Строка);
    КонецЦикла;
    
    Возврат СтрСоединить(Части, "");
    
КонецФункции

#КонецОбласти

01. Integrated operations (fiscal module + transaction on bank terminal if needed)

Sale (fiscal or alternative receipt)

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

print
boolean

Prints the receipt (or, if PrintOnServer = false - obtains the print form in the response)

sendToEmail
boolean

Sends the receipt in electronic form to the email address.

emailAddress
string or null

Email address to which the receipt will be sent in electronic form.

sendToPhone
boolean

Sends the receipt in electronic form via SMS.

phoneNumber
string or null

Phone number to which the receipt will be sent in electronic form.

additionalHeaderText
string or null

Additional header.

additionalFooterText
string or null

Additional footer.

Array of objects (SaleRequestItem)

Products or services in the receipt.

Array of objects (SaleRequestPayment)

Payments made.

Array of objects (SaleRequestAmountModification)

Amount modifiers applied to the entire receipt.

receiptMode
string
Enum: "FiscalReceiptOnly" "AlternativeReceiptOnly" "FiscalThenAlternativeReceipt"

Receipt generation mode for sale: FiscalReceiptOnly (fiscal receipt only), AlternativeReceiptOnly (alternative receipt only), FiscalThenAlternativeReceipt (fiscal receipt, with fallback to alternative if it fails).

alternativeReceiptSeriesAndNumber
string or null

Series and number of the alternative receipt (optional). If not specified, it will be automatically generated from the predefined range.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "print": true,
  • "sendToEmail": false,
  • "emailAddress": "test@test.md",
  • "sendToPhone": false,
  • "phoneNumber": "079123456",
  • "additionalHeaderText": "",
  • "additionalFooterText": "Bonusuri acumulate: 34",
  • "items": [
    ],
  • "payments": [
    ],
  • "amountModifications": [
    ],
  • "receiptMode": "FiscalReceiptOnly",
  • "alternativeReceiptSeriesAndNumber": "ABC00000001"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Return

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

originalReceiptId
string <uuid>

Identifier of the original receipt for which the return is made.

issueCashOperationWhenNecessary
boolean or null

Indicates whether to issue the cash withdrawal operation when necessary (optional). Default - true.

Array of objects (ReturnRequestItem)

Products or services being returned (with pre-calculated values from the original receipt, proportional to the returned quantity).

Array of objects (ReturnRequestPayment)

Payments for the return, including payment type, amount, and bank terminal details if applicable.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "originalReceiptId": "d9e7e95e-c18a-4b9f-86b9-efd1124b492c",
  • "issueCashOperationWhenNecessary": true,
  • "items": [
    ],
  • "payments": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Day closing

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json

Request body is OPTIONAL

id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Intermediate totals

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json

Request body is OPTIONAL

id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

02. Fiscal receipts

Creating the fiscal receipt

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

print
boolean

Prints the receipt (or, if PrintOnServer = false - obtains the print form in the response)

sendToEmail
boolean

Sends the receipt in electronic form to the email address.

emailAddress
string or null

Email address to which the receipt will be sent in electronic form.

sendToPhone
boolean

Sends the receipt in electronic form via SMS.

phoneNumber
string or null

Phone number to which the receipt will be sent in electronic form.

additionalHeaderText
string or null

Additional header.

additionalFooterText
string or null

Additional footer.

Array of objects (CreateReceiptRequestItem)

Products or services in the receipt.

Array of objects (CreateReceiptRequestPayment)

Payments made.

Array of objects (CreateReceiptRequestAmountModification)

Amount modifiers applied to the entire receipt.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "print": true,
  • "sendToEmail": false,
  • "emailAddress": "test@test.md",
  • "sendToPhone": false,
  • "phoneNumber": "079123456",
  • "additionalHeaderText": "",
  • "additionalFooterText": "Bonusuri acumulate: 34",
  • "items": [
    ],
  • "payments": [
    ],
  • "amountModifications": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

List of fiscal receipts

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining fiscal receipts

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the fiscal receipt

Authorizations:
(ApiKeyApiSecret)
path Parameters
receiptId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The fiscal receipt identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the duplicate

Authorizations:
(ApiKeyApiSecret)
path Parameters
receiptId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The fiscal receipt identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Request Body schema: application/json
required
printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command.

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

The type of the operation's print form (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

print
boolean

Prints the receipt (or, if PrintOnServer = false - obtains the print form in the response)

sendToEmail
boolean

Sends the receipt in electronic form to the email address.

emailAddress
string or null

Email address to which the receipt will be sent in electronic form.

sendToPhone
boolean

Sends the receipt in electronic form via SMS.

phoneNumber
string or null

Phone number to which the receipt will be sent in electronic form.

Responses

Request samples

Content type
application/json
{
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "print": true,
  • "sendToEmail": true,
  • "emailAddress": "test@test.md",
  • "sendToPhone": true,
  • "phoneNumber": "079123456"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

03. Non-fiscal receipts (text)

Creating the non-fiscal receipt

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

print
boolean

Prints the receipt (or, if PrintOnServer = false - obtains the print form in the response)

sendToEmail
boolean

Sends the receipt in electronic form to the email address.

emailAddress
string or null

Email address to which the receipt will be sent in electronic form.

text
string

Content of the non-fiscal receipt.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "print": true,
  • "sendToEmail": true,
  • "emailAddress": "test@test.md",
  • "text": ""
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

04. Return

Creating the return

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

originalReceiptId
string <uuid>

Identifier of the original receipt for which the return is made.

issueCashOperationWhenNecessary
boolean or null

Indicates whether to issue the cash withdrawal operation when necessary (optional). Default - true.

Array of objects (CreateReturnReceiptRequestItem)

Products or services being returned (with pre-calculated values from the original receipt).

Array of objects (CreateReturnReceiptRequestPayment)

Payments for the return.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "originalReceiptId": "d9e7e95e-c18a-4b9f-86b9-efd1124b492c",
  • "issueCashOperationWhenNecessary": true,
  • "items": [
    ],
  • "payments": [
    ]
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

List of returns

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining returns

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the return

Authorizations:
(ApiKeyApiSecret)
path Parameters
receiptId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The fiscal receipt identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

05. Alternative receipts ("Bon de plată")

Creating the alternative receipt

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

print
boolean

Prints the receipt (or, if PrintOnServer = false - obtains the print form in the response)

sendToEmail
boolean

Sends the receipt in electronic form to the email address.

emailAddress
string or null

Email address to which the receipt will be sent in electronic form.

sendToPhone
boolean

Sends the receipt in electronic form via SMS.

phoneNumber
string or null

Phone number to which the receipt will be sent in electronic form.

additionalHeaderText
string or null

Additional header.

additionalFooterText
string or null

Additional footer.

Array of objects (CreateAlternativeReceiptRequestItem)

Products or services in the receipt.

Array of objects (CreateAlternativeReceiptRequestPayment)

Payments made.

Array of objects (CreateAlternativeReceiptRequestAmountModification)

Amount modifiers applied to the entire receipt.

seriesAndNumber
string or null

Series and number of the payment receipt (optional). If not specified, it will be obtained from the pre-established ranges.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "print": true,
  • "sendToEmail": false,
  • "emailAddress": "test@test.md",
  • "sendToPhone": false,
  • "phoneNumber": "079123456",
  • "additionalHeaderText": "",
  • "additionalFooterText": "Bonusuri acumulate: 34",
  • "items": [
    ],
  • "payments": [
    ],
  • "amountModifications": [
    ],
  • "seriesAndNumber": "ABC00000001"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

List of alternative receipts

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining alternative receipts

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the alternative receipt

Authorizations:
(ApiKeyApiSecret)
path Parameters
receiptId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The fiscal receipt identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the duplicate

Authorizations:
(ApiKeyApiSecret)
path Parameters
receiptId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The fiscal receipt identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Request Body schema: application/json
required
printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command.

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

The type of the operation's print form (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

print
boolean

Prints the receipt (or, if PrintOnServer = false - obtains the print form in the response)

sendToEmail
boolean

Sends the receipt in electronic form to the email address.

emailAddress
string or null

Email address to which the receipt will be sent in electronic form.

sendToPhone
boolean

Sends the receipt in electronic form via SMS.

phoneNumber
string or null

Phone number to which the receipt will be sent in electronic form.

Responses

Request samples

Content type
application/json
{
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "print": true,
  • "sendToEmail": true,
  • "emailAddress": "test@test.md",
  • "sendToPhone": true,
  • "phoneNumber": "079123456"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

06. Reports

Creating the report

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

type
string
Enum: "ZReport" "XReport"

Report type.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "type": "ZReport"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

List of reports

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining reports

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the report

Authorizations:
(ApiKeyApiSecret)
path Parameters
reportId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The report identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the duplicate

Authorizations:
(ApiKeyApiSecret)
path Parameters
reportId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The report identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Request Body schema: application/json
required
printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command.

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

The type of the operation's print form (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

Responses

Request samples

Content type
application/json
{
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

07. Cash operations

Creating the cash operation

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
id
string or null <uuid>

Operation identifier (optional). If set, on repeated call with the same ID, a new receipt will not be created, but the existing one will be returned.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command. Default value - true

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

amount
number <double>

Operation amount. Positive value - cash entry, negative value - cash withdrawal.

Responses

Request samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    },
  • "amount": 18.87
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

List of cash operations

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining cash operations

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the cash operation

Authorizations:
(ApiKeyApiSecret)
path Parameters
cashOperationId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The cash operation identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Obtaining the duplicate

Authorizations:
(ApiKeyApiSecret)
path Parameters
cashOperationId
required
string <uuid>
Example: e5fc5521-a8d2-46a0-a697-fdfa3072dc09

The cash operation identifier.

header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Request Body schema: application/json
required
printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command.

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

The type of the operation's print form (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

Responses

Request samples

Content type
application/json
{
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

08. Periodic reports

Generating the periodic report

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
object

Periodic report settings.

printOnServer
boolean

Prints on the server side. Otherwise, the print form will be returned to the caller in the response to the current command.

printFormMediaType
string or null
Enum: "Json" "Html" "Pdf" "Image"

Type of the print form of the operation (optional - only for PrintOnServer = false). Default - Json.

object or null

Print form settings in PDF format (optional - only for PrintOnServer = false and PrintFormMediaType = Pdf).

object or null

Print form settings in Png image format (optional - only for PrintOnServer = false and PrintFormMediaType = Image).

Responses

Request samples

Content type
application/json
{
  • "reportSettings": {
    },
  • "printOnServer": true,
  • "printFormMediaType": "Json",
  • "pdfPrintFormSettings": {
    },
  • "imagePrintFormSettings": {
    }
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Printing the periodic report

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Request Body schema: application/json
required
detailed
boolean
filterType
string
Enum: "ByDate" "ByZReportNumber"

Mode for filtering the periodic report data.

firstZReportNumber
string or null
lastZReportNumber
string or null
startDate
string or null <date-time>
endDate
string or null <date-time>

Responses

Request samples

Content type
application/json
{
  • "detailed": true,
  • "filterType": "ByDate",
  • "firstZReportNumber": "string",
  • "lastZReportNumber": "string",
  • "startDate": "2019-08-24T14:15:22Z",
  • "endDate": "2019-08-24T14:15:22Z"
}

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string"
}

09. Equipment

List of available equipment.

Authorizations:
(ApiKeyApiSecret)
query Parameters
startIndex
integer <int32>

Initial index of the data portion (optional)

count
integer <int32>
Example: count=10

Number of elements in the data portion (optional)

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

Check if less than 24 hours have passed since the first receipt.

The "success" field will have the value "false" if more than 24 hours have passed.

Authorizations:
(ApiKeyApiSecret)
header Parameters
Api-DeviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Api-PointOfSaleId
required
string <uuid>
Example: feca3a50-34a7-4dc9-84ac-d4bffc76a922

The point of sale identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string"
}

Obtaining the equipment.

Authorizations:
(ApiKeyApiSecret)
path Parameters
deviceId
required
string <uuid>
Example: 0875b8a5-0668-41a3-a3fa-8eeccf66d289

The device identifier.

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string",
  • "data": {
    }
}

10. Miscellaneous

Opening the cash drawer.

Authorizations:
(ApiKeyApiSecret)

Responses

Response samples

Content type
application/json
{
  • "success": true,
  • "message": "string",
  • "fullExceptionMessage": "string",
  • "errorType": "string"
}