Documentation API.Faktura.uz

Introduction

Api.Faktura.uz – is integration gateway to Faktura.uz electronic document exchange system. API service is based on RESTful API. The service supports JSON and XML data exchange formats.

How to use the API

Authorization and Authentication

Authorization and user authentication is the most important point when accessing remote services. In our system, authorization is built around tokens.

A token can be considered as a key issued for a certain period of time to access a service that identifies the client.

The service receives a request from the client, receives a token to recognize the clients and in case of unsuccessful authentication, the request will be rejected by the corresponding response. (See the examples below).

Receiving a token

Parameters of access to Api.Faktura.uz are configured in the user settings in the Faktura.uz system. This screenshot shows Username (ClientID) and Password (Secret key).

The generation of a new token occurs every time the client requests a token from the service. To get a token, send HTTP POST a request to the URL "/Token" with your login and password.

Example of a request to receive a token:

(Replace `myUsername` and `myPassword`) with your respective parameters.
POST https://Api.Faktura.uz/Token HTTP/1.1
    Host: api.faktura.uz
Content-Length: 59

grant_type=password&username=myUsername&password=myPassword

An example of a response to a successfully generated token. The response from the service comes in JSON format

HTTP/1.1 200 OK
    Content-Type: application/json;charset=UTF-8
Cache-Control: no-cache
Pragma: no-cache

Expires: -1
Server: Microsoft-IIS/10.0
Set-Cookie: .AspNet.Cookies=uFKMjXOIxjteQnIpS9dNys7ITT9WCGK07crPAwEvgfwG-NHArh5zLIfTWLi9HGTsfiZNHUay6-KmF4jlcq1q_a3gq4nU7qXsQLHlEcQgYUKTHpmWj3Nsm-DD5lxu8yvKj74HS3-PxElpbIvpVFIBUfp7RQhyYE8ZOpjGO7uECKURqzGUYNiHKTZshhjTWEbmdUw68vxZvjW_5I91nwXv4dqknDABErXK9Re5F_HCdeI1CKX2CMXWqxgNsIwMt2Ya20EbMgVOl7aCMDaoiMsVvHnv_iG4CGFtnicaaadKuo5r3_6nY7gGsAd1jHUr0VFfiwkRp5Z9NXjsfG_bFsoL-ZgMw_r9fK6hN4_RIemI-kQKqXKMQMa62V_TH7sBuhvB; path=/; HttpOnly
X-SourceFiles: =?UTF-8?B?RDpcUHJvamVjdHNcQXBpRmFrdHVyYVxmYWt0dXJhLmFwaVxUb2tlbg==?=
X-Powered-By: ASP.NET
Date: Thu, 02 Mar 2017 09:09:20 GMT
Content-Length: 577

{"access_token":"EPWt3rAI64lBDDiSTCN6eoklNAMSdETqtU8ALIrO1wRgrZYTyUGVS8Xtx9tpJWTGKBxQ9R2cXPSEQzSo2WqWBuqaBTj8zF44HP9BoS64w57ZqAKIdxWZPaO-kQsCgwPKUbDSI4oMp64BbL-m1A5pP0FEcVSTb3NDpN-S6bGPpV6Wn6IBPDrXvE3xVOI634s_1iWsL5IldmO4-lyoDcW3aRcMZgnMDZUgh7GOPiiSXHDkB6zFEBKcjXS3qCnQ0j02AselU8N7x2i9rtCePidMORl7E7xlTdWzQ4B9EKsmOourQyHcSBiEx5s5cGzN_DV07GUlD8v7Xpbtn_On0dJBHN37akkEo4g1Iot86MQ746Lr815vfE_2PVKn8upIGfjeRA5DWacIUiVT42nGWEQq4g","token_type":"bearer","expires_in":1209599,"userName":"myUsername",".issued":"Thu, 02 Mar 2017 09:09:20 GMT",".expires":"Thu, 16 Mar 2017 09:09:20 GMT"}

Pay attention to the highlighted headers of the answer:
Content-Type: application/json; The response from the API is sent in JSON format.

The object representation of the body of the answer is:

{
    ".expires" : "Thu, 16 Mar 2017 09:09:20 GMT",
    ".issued" : "Thu, 02 Mar 2017 09:09:20 GMT"
    "access_token" : "EPWt3rAI64lBDDiSTCN6eoklNAMSdETqtU8ALIrO1wRgrZYTyUGVS8Xtx9tpJWTGKBxQ9R2cXPSEQzSo2WqWBuqaBTj8zF44HP9BoS64w57ZqAKIdxWZPaO-kQsCgwPKUbDSI4oMp64BbL-m1A5pP0FEcVSTb3NDpN-S6bGPpV6Wn6IBPDrXvE3xVOI634s_1iWsL5IldmO4-lyoDcW3aRcMZgnMDZUgh7GOPiiSXHDkB6zFEBKcjXS3qCnQ0j02AselU8N7x2i9rtCePidMORl7E7xlTdWzQ4B9EKsmOourQyHcSBiEx5s5cGzN_DV07GUlD8v7Xpbtn_On0dJBHN37akkEo4g1Iot86MQ746Lr815vfE_2PVKn8upIGfjeRA5DWacIUiVT42nGWEQq4g",
    "expires_in" : 1209599,
    "token_type" : "bearer",
    "userName" : "myUsername"
}

The service created a new token for the client (a value from the "access_token" property) and informs the expiration date of this token (value from the ".expires" property).

An important point in subsequent requests to the API service is to add the following value to the header, which passes our token to the service for client authentication:

(Replace the token with your own one)
Authorization: Bearer EPWt3rAI64lBDDiSTCN6eoklNAMSdETqtU8ALIrO1wRgrZYTyUGVS8Xtx9tpJWTGKBxQ9R2cXPSEQzSo2WqWBuqaBTj8zF44HP9BoS64w57ZqAKIdxWZPaO-kQsCgwPKUbDSI4oMp64BbL-m1A5pP0FEcVSTb3NDpN-S6bGPpV6Wn6IBPDrXvE3xVOI634s_1iWsL5IldmO4-lyoDcW3aRcMZgnMDZUgh7GOPiiSXHDkB6zFEBKcjXS3qCnQ0j02AselU8N7x2i9rtCePidMORl7E7xlTdWzQ4B9EKsmOourQyHcSBiEx5s5cGzN_DV07GUlD8v7Xpbtn_On0dJBHN37akkEo4g1Iot86MQ746Lr815vfE_2PVKn8upIGfjeRA5DWacIUiVT42nGWEQq4g

Preparing the request

The preparation of the request has 3 points:

  1. Set a token
  2. Establish a data structure for communicating with the API service
  3. Prepare data for shipment

Consider the points on a real example. Choose the method Api/Document/ImportDocumentRegister" (importing documents into the system).

Point 1. Install the token. Add our token to the request header.

(Replace the token with your own one)
POST https://Api.Faktura.uz/ Api/Document/ImportDocumentRegister HTTP/1.1
Host: api.faktura.uz
Authorization: Bearer EPWt3rAI64lBDDiSTCN6eoklNAMSdETqtU8ALIrO1wRgrZYTyUGVS8Xtx9tpJWTGKBxQ9R2cXPSEQzSo2WqWBuqaBTj8zF44HP9BoS64w57ZqAKIdxWZPaO-kQsCgwPKUbDSI4oMp64BbL-m1A5pP0FEcVSTb3NDpN-S6bGPpV6Wn6IBPDrXvE3xVOI634s_1iWsL5IldmO4-lyoDcW3aRcMZgnMDZUgh7GOPiiSXHDkB6zFEBKcjXS3qCnQ0j02AselU8N7x2i9rtCePidMORl7E7xlTdWzQ4B9EKsmOourQyHcSBiEx5s5cGzN_DV07GUlD8v7Xpbtn_On0dJBHN37akkEo4g1Iot86MQ746Lr815vfE_2PVKn8upIGfjeRA5DWacIUiVT42nGWEQq4g

Point 2. Let's establish the type of data structure. Depending on the type you choose:

JSON – application/json
XML – application/xml

POST https://Api.Faktura.uz/ Api/Document/ImportDocumentRegister HTTP/1.1
Host: api.faktura.uz
Authorization: Bearer EPWt3rAI64lBDDiSTCN6eoklNAMSdETqtU8ALIrO1wRgrZYTyUGVS8Xtx9tpJWTGKBxQ9R2cXPSEQzSo2WqWBuqaBTj8zF44HP9BoS64w57ZqAKIdxWZPaO-kQsCgwPKUbDSI4oMp64BbL-m1A5pP0FEcVSTb3NDpN-S6bGPpV6Wn6IBPDrXvE3xVOI634s_1iWsL5IldmO4-lyoDcW3aRcMZgnMDZUgh7GOPiiSXHDkB6zFEBKcjXS3qCnQ0j02AselU8N7x2i9rtCePidMORl7E7xlTdWzQ4B9EKsmOourQyHcSBiEx5s5cGzN_DV07GUlD8v7Xpbtn_On0dJBHN37akkEo4g1Iot86MQ746Lr815vfE_2PVKn8upIGfjeRA5DWacIUiVT42nGWEQq4g
Content-Type: application/json; charset=utf-8
Accept: application/json
POST https://Api.Faktura.uz/ Api/Document/ImportDocumentRegister HTTP/1.1
Host: api.faktura.uz
Authorization: Bearer EPWt3rAI64lBDDiSTCN6eoklNAMSdETqtU8ALIrO1wRgrZYTyUGVS8Xtx9tpJWTGKBxQ9R2cXPSEQzSo2WqWBuqaBTj8zF44HP9BoS64w57ZqAKIdxWZPaO-kQsCgwPKUbDSI4oMp64BbL-m1A5pP0FEcVSTb3NDpN-S6bGPpV6Wn6IBPDrXvE3xVOI634s_1iWsL5IldmO4-lyoDcW3aRcMZgnMDZUgh7GOPiiSXHDkB6zFEBKcjXS3qCnQ0j02AselU8N7x2i9rtCePidMORl7E7xlTdWzQ4B9EKsmOourQyHcSBiEx5s5cGzN_DV07GUlD8v7Xpbtn_On0dJBHN37akkEo4g1Iot86MQ746Lr815vfE_2PVKn8upIGfjeRA5DWacIUiVT42nGWEQq4g
Content-Type: application/xml; charset=utf-8
Accept: application/xml

Point 3. Prepare the data for sending.

As an example, we prepare 1 data for three document types


    {
    "invoice_for_payments": [
    {
    "head": {
    "file_name": "invoice-for-payment_464722759__2017-02-20_FU_00000000001.xml",
    "program_version": "1.0.0",
    "format_version": "1.0.0",
    "sender": {
    "sender_info": {
    "INN": "000000000",
    "company_name": "ООО \"Тестовая компания\"",
    "address": {
    "postal_code": "100135",
    "city": "Ташкент",
    "city_district": "Чиланзар",
    "street": "1",
    "building": "2",
    "apartment": "52"
    },
    "phone": "+998 (97) 1212121",
    "email": "testuser@mailinator.com",
    "fax": "N/A",
    "website": "N/A",
    "bank_details": {
    "account_number": "20018000100112348001",
    "bank_name": "Чиланзарский филиал АИКБ «Ипак Йули»",
    "bank_code": "01067"
    }
    },
    "approver_and_signers": {
    "approver": {
    "position": "Индивидуальный предприниматель",
    "last_name": "Поздеев",
    "first_name": "Артем",
    "middle_name": "Иванович"
    },
    "signer_director": {
    "position": "Индивидуальный предприниматель",
    "last_name": "Поздеев",
    "first_name": "Артем",
    "middle_name": "Иванович"
    },
    "signer_accountant": {
    "position": "Главный бухгалтер",
    "last_name": "Не предусмотрен"
    },
    "signer_warehouse": {
    "last_name": "Сидоров",
    "first_name": "Александр",
    "middle_name": "Васильевич"
    }
    }
    },
    "receiver": {
    "receiver_info": {
    "INN": "123456789",
    "company_name": "SPACE ONLINE GENESIS",
    "address": {
    "postal_code": "100000",
    "city": "Ташкент",
    "city_district": "Ю.Абад",
    "street": "М.Ашрафи",
    "building": "35",
    "apartment": "12"
    },
    "phone": "1500000",
    "email": "info@faktura.uz",
    "fax": "1600000",
    "website": "N/A",
    "bank_details": {
    "account_number": "12345123451234512345",
    "bank_name": "АИКБ Ипак Йули",
    "bank_code": "00444",
    "activity_code": "12345"
    }
    },
    "approver_and_signers": {
    "approver": {
    "position": "Генеральный директор",
    "last_name": "Исмоилов",
    "first_name": "Бобир"
    },
    "signer": {
    "position": "Технический директор",
    "last_name": "Исмоилов",
    "first_name": "Бобир"
    }
    }
    },
    "sender_operator": {
    "INN": "121212121",
    "company_name": "Faktura.uz",
    "address": {
    "postal_code": "100135",
    "city": "Ташкент",
    "city_district": "Чиланзар",
    "street": "17",
    "building": "39",
    "apartment": "52"
    },
    "phone": "+998 (97) 7227833",
    "email": "pozdeev-artem@yandex.ru",
    "fax": "N/A",
    "website": "N/A"
    },
    "receiver_operator": {
    "INN": "121212121",
    "company_name": "Faktura.uz",
    "address": {
    "postal_code": "100000",
    "city": "Ташкент",
    "city_district": "Ю.Абад",
    "street": "М.Ашрафи",
    "building": "35",
    "apartment": "12"
    },
    "phone": "1500000",
    "email": "info@faktura.uz",
    "fax": "1600000",
    "website": "N/A"
    }
    },
    "document": {
    "document_version": "2017-02-20",
    "document_number": "2017-1",
    "document_date": "01.03.2017",
    "korrektirovoch_document_number": "N/A",
    "korrektirovoch_document_date": "N/A",
    "doverennost_number": "N/A",
    "doverennost_date": "N/A",
    "contract_number": "951951",
    "contract_date": "01.01.2017",
    "currency_code": "860",
    "currency_rate": "1",
    "currency_rate_date": "01.01.2017",
    "items": [
    {
    "vat": {
    "vat_rate": "0",
    "vat_value": "0"
    },
    "item_number": "1",
    "description": "Материал №1",
    "volume": "20",
    "unit_price": "15000",
    "subtotal": "300000",
    "measurement_unit": "кг",
    "excise": {
    "excise_rate": "0",
    "excise_value": "0"
    },
    "subtotal_with_taxes": "0"
    }
    ],
    "column_summary_values": {
    "column_subtotal": "300000",
    "column_subtotal_uzs": "300000",
    "column_excise_value": "0",
    "column_excise_value_uzs": "0",
    "column_vat_value": "0",
    "column_vat_value_uzs": "0",
    "column_subtotal_with_taxes": "0",
    "column_subtotal_with_taxes_uzs": "0"
    },
    "column_summary_values_in_words": {
    "column_subtotal_in_words": "Триста тысяч сум 00 тийин",
    "column_subtotal_uzs_in_words": "Триста тысяч сум 00 тийин"
    }
    },
    "expansion": ""
    }
    ],
    "invoices": [
    {
    "head": {
    "file_name": "invoice-for-payment_464722759__2017-02-20_FU_00000000001.xml",
    "program_version": "1.0.0",
    "format_version": "1.0.0",
    "sender": {
    "sender_info": {
    "INN": "000000000",
    "company_name": "ООО \"Тестовая компания\"",
    "address": {
    "postal_code": "100135",
    "city": "Ташкент",
    "city_district": "Чиланзар",
    "street": "1",
    "building": "2",
    "apartment": "52"
    },
    "phone": "+998 (97) 1212121",
    "email": "testuser@mailinator.com",
    "fax": "N/A",
    "website": "N/A",
    "bank_details": {
    "account_number": "20018000100112348001",
    "bank_name": "Чиланзарский филиал АИКБ «Ипак Йули»",
    "bank_code": "01067"
    }
    },
    "approver_and_signers": {
    "approver": {
    "position": "Индивидуальный предприниматель",
    "last_name": "Поздеев",
    "first_name": "Артем",
    "middle_name": "Иванович"
    },
    "signer_director": {
    "position": "Индивидуальный предприниматель",
    "last_name": "Поздеев",
    "first_name": "Артем",
    "middle_name": "Иванович"
    },
    "signer_accountant": {
    "position": "Главный бухгалтер",
    "last_name": "Не предусмотрен"
    },
    "signer_warehouse": {
    "last_name": "Сидоров",
    "first_name": "Александр",
    "middle_name": "Васильевич"
    }
    }
    },
    "receiver": {
    "receiver_info": {
    "INN": "123456789",
    "company_name": "SPACE ONLINE GENESIS",
    "address": {
    "postal_code": "100000",
    "city": "Ташкент",
    "city_district": "Ю.Абад",
    "street": "М.Ашрафи",
    "building": "35",
    "apartment": "12"
    },
    "phone": "1500000",
    "email": "info@faktura.uz",
    "fax": "1600000",
    "website": "N/A",
    "bank_details": {
    "account_number": "12345123451234512345",
    "bank_name": "АИКБ Ипак Йули",
    "bank_code": "00444",
    "activity_code": "12345"
    }
    },
    "approver_and_signers": {
    "approver": {
    "position": "Генеральный директор",
    "last_name": "Исмоилов",
    "first_name": "Бобир"
    },
    "signer": {
    "position": "Технический директор",
    "last_name": "Исмоилов",
    "first_name": "Бобир"
    }
    }
    },
    "sender_operator": {
    "INN": "121212121",
    "company_name": "Faktura.uz",
    "address": {
    "postal_code": "100135",
    "city": "Ташкент",
    "city_district": "Чиланзар",
    "street": "17",
    "building": "39",
    "apartment": "52"
    },
    "phone": "+998 (97) 7227833",
    "email": "pozdeev-artem@yandex.ru",
    "fax": "N/A",
    "website": "N/A"
    },
    "receiver_operator": {
    "INN": "121212121",
    "company_name": "Faktura.uz",
    "address": {
    "postal_code": "100000",
    "city": "Ташкент",
    "city_district": "Ю.Абад",
    "street": "М.Ашрафи",
    "building": "35",
    "apartment": "12"
    },
    "phone": "1500000",
    "email": "info@faktura.uz",
    "fax": "1600000",
    "website": "N/A"
    }
    },
    "document": {
    "document_version": "2017-02-20",
    "document_number": "2017-2",
    "document_date": "01.03.2017",
    "korrektirovoch_document_number": "N/A",
    "korrektirovoch_document_date": "N/A",
    "doverennost_number": "N/A",
    "doverennost_date": "N/A",
    "contract_number": "951951",
    "contract_date": "01.01.2017",
    "currency_code": "860",
    "currency_rate": "1",
    "currency_rate_date": "01.01.2017",
    "items": [
    {
    "vat": {
    "vat_rate": "0",
    "vat_value": "0"
    },
    "item_number": "1",
    "description": "Материал №1",
    "volume": "20",
    "unit_price": "15000",
    "subtotal": "300000",
    "measurement_unit": "кг",
    "excise": {
    "excise_rate": "0",
    "excise_value": "0"
    },
    "subtotal_with_taxes": "0"
    }
    ],
    "column_summary_values": {
    "column_subtotal": "300000",
    "column_subtotal_uzs": "300000",
    "column_excise_value": "0",
    "column_excise_value_uzs": "0",
    "column_vat_value": "0",
    "column_vat_value_uzs": "0",
    "column_subtotal_with_taxes": "0",
    "column_subtotal_with_taxes_uzs": "0"
    },
    "column_summary_values_in_words": {
    "column_subtotal_in_words": "Триста тысяч сум 00 тийин",
    "column_subtotal_uzs_in_words": "Триста тысяч сум 00 тийин"
    }
    },
    "expansion": ""
    }
    ],
    "acts_and_invoices": [
    {
    "head": {
    "file_name": "invoice-for-payment_464722759__2017-02-20_FU_00000000001.xml",
    "program_version": "1.0.0",
    "format_version": "1.0.0",
    "sender": {
    "sender_info": {
    "INN": "000000000",
    "company_name": "ООО \"Тестовая компания\"",
    "address": {
    "postal_code": "100135",
    "city": "Ташкент",
    "city_district": "Чиланзар",
    "street": "1",
    "building": "2",
    "apartment": "52"
    },
    "phone": "+998 (97) 1212121",
    "email": "testuser@mailinator.com",
    "fax": "N/A",
    "website": "N/A",
    "bank_details": {
    "account_number": "20018000100112348001",
    "bank_name": "Чиланзарский филиал АИКБ «Ипак Йули»",
    "bank_code": "01067"
    }
    },
    "approver_and_signers": {
    "approver": {
    "position": "Индивидуальный предприниматель",
    "last_name": "Поздеев",
    "first_name": "Артем",
    "middle_name": "Иванович"
    },
    "signer_director": {
    "position": "Индивидуальный предприниматель",
    "last_name": "Поздеев",
    "first_name": "Артем",
    "middle_name": "Иванович"
    },
    "signer_accountant": {
    "position": "Главный бухгалтер",
    "last_name": "Не предусмотрен"
    },
    "signer_warehouse": {
    "last_name": "Сидоров",
    "first_name": "Александр",
    "middle_name": "Васильевич"
    }
    }
    },
    "receiver": {
    "receiver_info": {
    "INN": "123456789",
    "company_name": "SPACE ONLINE GENESIS",
    "address": {
    "postal_code": "100000",
    "city": "Ташкент",
    "city_district": "Ю.Абад",
    "street": "М.Ашрафи",
    "building": "35",
    "apartment": "12"
    },
    "phone": "1500000",
    "email": "info@faktura.uz",
    "fax": "1600000",
    "website": "N/A",
    "bank_details": {
    "account_number": "12345123451234512345",
    "bank_name": "АИКБ Ипак Йули",
    "bank_code": "00444",
    "activity_code": "12345"
    }
    },
    "approver_and_signers": {
    "approver": {
    "position": "Генеральный директор",
    "last_name": "Исмоилов",
    "first_name": "Бобир"
    },
    "signer": {
    "position": "Технический директор",
    "last_name": "Исмоилов",
    "first_name": "Бобир"
    }
    }
    },
    "sender_operator": {
    "INN": "121212121",
    "company_name": "Faktura.uz",
    "address": {
    "postal_code": "100135",
    "city": "Ташкент",
    "city_district": "Чиланзар",
    "street": "17",
    "building": "39",
    "apartment": "52"
    },
    "phone": "+998 (97) 7227833",
    "email": "pozdeev-artem@yandex.ru",
    "fax": "N/A",
    "website": "N/A"
    },
    "receiver_operator": {
    "INN": "121212121",
    "company_name": "Faktura.uz",
    "address": {
    "postal_code": "100000",
    "city": "Ташкент",
    "city_district": "Ю.Абад",
    "street": "М.Ашрафи",
    "building": "35",
    "apartment": "12"
    },
    "phone": "1500000",
    "email": "info@faktura.uz",
    "fax": "1600000",
    "website": "N/A"
    }
    },
    "document": {
    "document_version": "2017-02-20",
    "document_number": "2017-3",
    "document_date": "01.03.2017",
    "korrektirovoch_document_number": "N/A",
    "korrektirovoch_document_date": "N/A",
    "doverennost_number": "N/A",
    "doverennost_date": "N/A",
    "contract_number": "951951",
    "contract_date": "01.01.2017",
    "currency_code": "860",
    "currency_rate": "1",
    "currency_rate_date": "01.01.2017",
    "items": [
    {
    "vat": {
    "vat_rate": "0",
    "vat_value": "0"
    },
    "item_number": "1",
    "description": "Материал №1",
    "volume": "20",
    "unit_price": "15000",
    "subtotal": "300000",
    "measurement_unit": "кг",
    "excise": {
    "excise_rate": "0",
    "excise_value": "0"
    },
    "subtotal_with_taxes": "0"
    }
    ],
    "column_summary_values": {
    "column_subtotal": "300000",
    "column_subtotal_uzs": "300000",
    "column_excise_value": "0",
    "column_excise_value_uzs": "0",
    "column_vat_value": "0",
    "column_vat_value_uzs": "0",
    "column_subtotal_with_taxes": "0",
    "column_subtotal_with_taxes_uzs": "0"
    },
    "column_summary_values_in_words": {
    "column_subtotal_in_words": "Триста тысяч сум 00 тийин",
    "column_subtotal_uzs_in_words": "Триста тысяч сум 00 тийин"
    }
    },
    "expansion": ""
    }
    ]
    }

    <document_container
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    >
    <invoice_for_payments>
    <invoice_for_payment>
    <head>
    <file_name>invoice-for-payment_464722759__2017-02-20_FU_00000000001.xml</file_name>
    <program_version>1.0.0</program_version>
    <format_version>1.0.0</format_version>
    <sender>
    <sender_info>
    <INN>000000000</INN>
    <company_name>ООО "Тестовая компания"</company_name>
    <address>
    <postal_code>100135</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Чиланзар</city_district>
    <street>1</street>
    <building>2</building>
    <wing/>
    <apartment>52</apartment>
    </address>
    <phone>+998 (97) 1212121</phone>
    <email>testuser@mailinator.com</email>
    <fax>N/A</fax>
    <website>N/A</website>
    <bank_details>
    <account_number>20018000100112348001</account_number>
    <special_account_number/>
    <bank_name>Чиланзарский филиал АИКБ «Ипак Йули»</bank_name>
    <bank_code>01067</bank_code>
    <activity_code/>
    </bank_details>
    </sender_info>
    <approver_and_signers>
    <approver>
    <position>Индивидуальный предприниматель</position>
    <last_name>Поздеев</last_name>
    <first_name>Артем</first_name>
    <middle_name>Иванович</middle_name>
    </approver>
    <signer_director>
    <position>Индивидуальный предприниматель</position>
    <last_name>Поздеев</last_name>
    <first_name>Артем</first_name>
    <middle_name>Иванович</middle_name>
    </signer_director>
    <signer_accountant>
    <position>Главный бухгалтер</position>
    <last_name>Не предусмотрен</last_name>
    <first_name/>
    <middle_name/>
    </signer_accountant>
    <signer_warehouse>
    <position/>
    <last_name>Сидоров</last_name>
    <first_name>Александр</first_name>
    <middle_name>Васильевич</middle_name>
    </signer_warehouse>
    </approver_and_signers>
    </sender>
    <receiver>
    <receiver_info>
    <INN>123456789</INN>
    <company_name>SPACE ONLINE GENESIS</company_name>
    <address>
    <postal_code>100000</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Ю.Абад</city_district>
    <street>М.Ашрафи</street>
    <building>35</building>
    <wing/>
    <apartment>12</apartment>
    </address>
    <phone>1500000</phone>
    <email>info@faktura.uz</email>
    <fax>1600000</fax>
    <website>N/A</website>
    <bank_details>
    <account_number>12345123451234512345</account_number>
    <special_account_number/>
    <bank_name>АИКБ Ипак Йули</bank_name>
    <bank_code>00444</bank_code>
    <activity_code>12345</activity_code>
    </bank_details>
    </receiver_info>
    <approver_and_signers>
    <approver>
    <position>Генеральный директор</position>
    <last_name>Исмоилов</last_name>
    <first_name>Бобир</first_name>
    <middle_name/>
    </approver>
    <signer>
    <position>Технический директор</position>
    <last_name>Исмоилов</last_name>
    <first_name>Бобир</first_name>
    <middle_name/>
    </signer>
    </approver_and_signers>
    </receiver>
    <sender_operator>
    <INN>121212121</INN>
    <company_name>Faktura.uz</company_name>
    <address>
    <postal_code>100135</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Чиланзар</city_district>
    <street>17</street>
    <building>39</building>
    <wing/>
    <apartment>52</apartment>
    </address>
    <phone>+998 (97) 7227833</phone>
    <email>pozdeev-artem@yandex.ru</email>
    <fax>N/A</fax>
    <website>N/A</website>
    </sender_operator>
    <receiver_operator>
    <INN>121212121</INN>
    <company_name>Faktura.uz</company_name>
    <address>
    <postal_code>100000</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Ю.Абад</city_district>
    <street>М.Ашрафи</street>
    <building>35</building>
    <wing/>
    <apartment>12</apartment>
    </address>
    <phone>1500000</phone>
    <email>info@faktura.uz</email>
    <fax>1600000</fax>
    <website>N/A</website>
    </receiver_operator>
    </head>
    <document>
    <document_version>2017-02-20</document_version>
    <document_number>2017-1</document_number>
    <document_date>01.03.2017</document_date>
    <korrektirovoch_document_number>N/A</korrektirovoch_document_number>
    <korrektirovoch_document_date>N/A</korrektirovoch_document_date>
    <doverennost_number>N/A</doverennost_number>
    <doverennost_date>N/A</doverennost_date>
    <contract_number>951951</contract_number>
    <contract_date>01.01.2017</contract_date>
    <currency_code>860</currency_code>
    <currency_rate>1</currency_rate>
    <currency_rate_date>01.01.2017</currency_rate_date>
    <items>
    <item>
    <vat>
    <vat_rate>0</vat_rate>
    <vat_value>0</vat_value>
    </vat>
    <item_number>1</item_number>
    <description>Материал №1</description>
    <volume>20</volume>
    <unit_price>15000</unit_price>
    <subtotal>300000</subtotal>
    <measurement_unit>кг</measurement_unit>
    <excise>
    <excise_rate>0</excise_rate>
    <excise_value>0</excise_value>
    </excise>
    <subtotal_with_taxes>0</subtotal_with_taxes>
    </item>
    </items>
    <column_summary_values>
    <column_subtotal>300000</column_subtotal>
    <column_subtotal_uzs>300000</column_subtotal_uzs>
    <column_excise_value>0</column_excise_value>
    <column_excise_value_uzs>0</column_excise_value_uzs>
    <column_vat_value>0</column_vat_value>
    <column_vat_value_uzs>0</column_vat_value_uzs>
    <column_subtotal_with_taxes>0</column_subtotal_with_taxes>
    <column_subtotal_with_taxes_uzs>0</column_subtotal_with_taxes_uzs>
    </column_summary_values>
    <column_summary_values_in_words>
    <column_subtotal_in_words>Триста тысяч сум 00 тийин</column_subtotal_in_words>
    <column_subtotal_uzs_in_words>Триста тысяч сум 00 тийин</column_subtotal_uzs_in_words>
    <column_subtotal_with_taxes_in_words/>
    <column_subtotal_with_taxes_uzs_in_words/>
    </column_summary_values_in_words>
    </document>
    <expansion>???</expansion>
    </invoice_for_payment>
    </invoice_for_payments>

    <invoices>
    <invoice>
    <head>
    <file_name>invoice-for-payment_464722759__2017-02-20_FU_00000000001.xml</file_name>
    <program_version>1.0.0</program_version>
    <format_version>1.0.0</format_version>
    <sender>
    <sender_info>
    <INN>000000000</INN>
    <company_name>ООО "Тестовая компания"</company_name>
    <address>
    <postal_code>100135</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Чиланзар</city_district>
    <street>1</street>
    <building>2</building>
    <wing/>
    <apartment>52</apartment>
    </address>
    <phone>+998 (97) 1212121</phone>
    <email>testuser@mailinator.com</email>
    <fax>N/A</fax>
    <website>N/A</website>
    <bank_details>
    <account_number>20018000100112348001</account_number>
    <special_account_number/>
    <bank_name>Чиланзарский филиал АИКБ «Ипак Йули»</bank_name>
    <bank_code>01067</bank_code>
    <activity_code/>
    </bank_details>
    </sender_info>
    <approver_and_signers>
    <approver>
    <position>Индивидуальный предприниматель</position>
    <last_name>Поздеев</last_name>
    <first_name>Артем</first_name>
    <middle_name>Иванович</middle_name>
    </approver>
    <signer_director>
    <position>Индивидуальный предприниматель</position>
    <last_name>Поздеев</last_name>
    <first_name>Артем</first_name>
    <middle_name>Иванович</middle_name>
    </signer_director>
    <signer_accountant>
    <position>Главный бухгалтер</position>
    <last_name>Не предусмотрен</last_name>
    <first_name/>
    <middle_name/>
    </signer_accountant>
    <signer_warehouse>
    <position/>
    <last_name>Сидоров</last_name>
    <first_name>Александр</first_name>
    <middle_name>Васильевич</middle_name>
    </signer_warehouse>
    </approver_and_signers>
    </sender>
    <receiver>
    <receiver_info>
    <INN>123456789</INN>
    <company_name>SPACE ONLINE GENESIS</company_name>
    <address>
    <postal_code>100000</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Ю.Абад</city_district>
    <street>М.Ашрафи</street>
    <building>35</building>
    <wing/>
    <apartment>12</apartment>
    </address>
    <phone>1500000</phone>
    <email>info@faktura.uz</email>
    <fax>1600000</fax>
    <website>N/A</website>
    <bank_details>
    <account_number>12345123451234512345</account_number>
    <special_account_number/>
    <bank_name>АИКБ Ипак Йули</bank_name>
    <bank_code>00444</bank_code>
    <activity_code>12345</activity_code>
    </bank_details>
    </receiver_info>
    <approver_and_signers>
    <approver>
    <position>Генеральный директор</position>
    <last_name>Исмоилов</last_name>
    <first_name>Бобир</first_name>
    <middle_name/>
    </approver>
    <signer>
    <position>Технический директор</position>
    <last_name>Исмоилов</last_name>
    <first_name>Бобир</first_name>
    <middle_name/>
    </signer>
    </approver_and_signers>
    </receiver>
    <sender_operator>
    <INN>121212121</INN>
    <company_name>Faktura.uz</company_name>
    <address>
    <postal_code>100135</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Чиланзар</city_district>
    <street>17</street>
    <building>39</building>
    <wing/>
    <apartment>52</apartment>
    </address>
    <phone>+998 (97) 7227833</phone>
    <email>pozdeev-artem@yandex.ru</email>
    <fax>N/A</fax>
    <website>N/A</website>
    </sender_operator>
    <receiver_operator>
    <INN>121212121</INN>
    <company_name>Faktura.uz</company_name>
    <address>
    <postal_code>100000</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Ю.Абад</city_district>
    <street>М.Ашрафи</street>
    <building>35</building>
    <wing/>
    <apartment>12</apartment>
    </address>
    <phone>1500000</phone>
    <email>info@faktura.uz</email>
    <fax>1600000</fax>
    <website>N/A</website>
    </receiver_operator>
    </head>
    <document>
    <document_version>2017-02-20</document_version>
    <document_number>2017-2</document_number>
    <document_date>01.03.2017</document_date>
    <korrektirovoch_document_number>N/A</korrektirovoch_document_number>
    <korrektirovoch_document_date>N/A</korrektirovoch_document_date>
    <doverennost_number>N/A</doverennost_number>
    <doverennost_date>N/A</doverennost_date>
    <contract_number>951951</contract_number>
    <contract_date>01.01.2017</contract_date>
    <currency_code>860</currency_code>
    <currency_rate>1</currency_rate>
    <currency_rate_date>01.01.2017</currency_rate_date>
    <items>
    <item>
    <vat>
    <vat_rate>0</vat_rate>
    <vat_value>0</vat_value>
    </vat>
    <item_number>1</item_number>
    <description>Материал №1</description>
    <volume>20</volume>
    <unit_price>15000</unit_price>
    <subtotal>300000</subtotal>
    <measurement_unit>кг</measurement_unit>
    <excise>
    <excise_rate>0</excise_rate>
    <excise_value>0</excise_value>
    </excise>
    <subtotal_with_taxes>0</subtotal_with_taxes>
    </item>
    </items>
    <column_summary_values>
    <column_subtotal>300000</column_subtotal>
    <column_subtotal_uzs>300000</column_subtotal_uzs>
    <column_excise_value>0</column_excise_value>
    <column_excise_value_uzs>0</column_excise_value_uzs>
    <column_vat_value>0</column_vat_value>
    <column_vat_value_uzs>0</column_vat_value_uzs>
    <column_subtotal_with_taxes>0</column_subtotal_with_taxes>
    <column_subtotal_with_taxes_uzs>0</column_subtotal_with_taxes_uzs>
    </column_summary_values>
    <column_summary_values_in_words>
    <column_subtotal_in_words>Триста тысяч сум 00 тийин</column_subtotal_in_words>
    <column_subtotal_uzs_in_words>Триста тысяч сум 00 тийин</column_subtotal_uzs_in_words>
    <column_subtotal_with_taxes_in_words/>
    <column_subtotal_with_taxes_uzs_in_words/>
    </column_summary_values_in_words>
    </document>
    <expansion>???</expansion>
    </invoice>
    </invoices>

    <acts_and_invoices>
    <act_and_invoice>
    <head>
    <file_name>invoice-for-payment_464722759__2017-02-20_FU_00000000001.xml</file_name>
    <program_version>1.0.0</program_version>
    <format_version>1.0.0</format_version>
    <sender>
    <sender_info>
    <INN>000000000</INN>
    <company_name>ООО "Тестовая компания"</company_name>
    <address>
    <postal_code>100135</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Чиланзар</city_district>
    <street>1</street>
    <building>2</building>
    <wing/>
    <apartment>52</apartment>
    </address>
    <phone>+998 (97) 1212121</phone>
    <email>testuser@mailinator.com</email>
    <fax>N/A</fax>
    <website>N/A</website>
    <bank_details>
    <account_number>20018000100112348001</account_number>
    <special_account_number/>
    <bank_name>Чиланзарский филиал АИКБ «Ипак Йули»</bank_name>
    <bank_code>01067</bank_code>
    <activity_code/>
    </bank_details>
    </sender_info>
    <approver_and_signers>
    <approver>
    <position>Индивидуальный предприниматель</position>
    <last_name>Поздеев</last_name>
    <first_name>Артем</first_name>
    <middle_name>Иванович</middle_name>
    </approver>
    <signer_director>
    <position>Индивидуальный предприниматель</position>
    <last_name>Поздеев</last_name>
    <first_name>Артем</first_name>
    <middle_name>Иванович</middle_name>
    </signer_director>
    <signer_accountant>
    <position>Главный бухгалтер</position>
    <last_name>Не предусмотрен</last_name>
    <first_name/>
    <middle_name/>
    </signer_accountant>
    <signer_warehouse>
    <position/>
    <last_name>Сидоров</last_name>
    <first_name>Александр</first_name>
    <middle_name>Васильевич</middle_name>
    </signer_warehouse>
    </approver_and_signers>
    </sender>
    <receiver>
    <receiver_info>
    <INN>123456789</INN>
    <company_name>SPACE ONLINE GENESIS</company_name>
    <address>
    <postal_code>100000</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Ю.Абад</city_district>
    <street>М.Ашрафи</street>
    <building>35</building>
    <wing/>
    <apartment>12</apartment>
    </address>
    <phone>1500000</phone>
    <email>info@faktura.uz</email>
    <fax>1600000</fax>
    <website>N/A</website>
    <bank_details>
    <account_number>12345123451234512345</account_number>
    <special_account_number/>
    <bank_name>АИКБ Ипак Йули</bank_name>
    <bank_code>00444</bank_code>
    <activity_code>12345</activity_code>
    </bank_details>
    </receiver_info>
    <approver_and_signers>
    <approver>
    <position>Генеральный директор</position>
    <last_name>Исмоилов</last_name>
    <first_name>Бобир</first_name>
    <middle_name/>
    </approver>
    <signer>
    <position>Технический директор</position>
    <last_name>Исмоилов</last_name>
    <first_name>Бобир</first_name>
    <middle_name/>
    </signer>
    </approver_and_signers>
    </receiver>
    <sender_operator>
    <INN>121212121</INN>
    <company_name>Faktura.uz</company_name>
    <address>
    <postal_code>100135</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Чиланзар</city_district>
    <street>17</street>
    <building>39</building>
    <wing/>
    <apartment>52</apartment>
    </address>
    <phone>+998 (97) 7227833</phone>
    <email>pozdeev-artem@yandex.ru</email>
    <fax>N/A</fax>
    <website>N/A</website>
    </sender_operator>
    <receiver_operator>
    <INN>121212121</INN>
    <company_name>Faktura.uz</company_name>
    <address>
    <postal_code>100000</postal_code>
    <region/>
    <provincial_district/>
    <city>Ташкент</city>
    <locality/>
    <city_district>Ю.Абад</city_district>
    <street>М.Ашрафи</street>
    <building>35</building>
    <wing/>
    <apartment>12</apartment>
    </address>
    <phone>1500000</phone>
    <email>info@faktura.uz</email>
    <fax>1600000</fax>
    <website>N/A</website>
    </receiver_operator>
    </head>
    <document>
    <document_version>2017-02-20</document_version>
    <document_number>2017-3</document_number>
    <document_date>01.03.2017</document_date>
    <korrektirovoch_document_number>N/A</korrektirovoch_document_number>
    <korrektirovoch_document_date>N/A</korrektirovoch_document_date>
    <doverennost_number>N/A</doverennost_number>
    <doverennost_date>N/A</doverennost_date>
    <contract_number>951951</contract_number>
    <contract_date>01.01.2017</contract_date>
    <currency_code>860</currency_code>
    <currency_rate>1</currency_rate>
    <currency_rate_date>01.01.2017</currency_rate_date>
    <items>
    <item>
    <vat>
    <vat_rate>0</vat_rate>
    <vat_value>0</vat_value>
    </vat>
    <item_number>1</item_number>
    <description>Материал №1</description>
    <volume>20</volume>
    <unit_price>15000</unit_price>
    <subtotal>300000</subtotal>
    <measurement_unit>кг</measurement_unit>
    <excise>
    <excise_rate>0</excise_rate>
    <excise_value>0</excise_value>
    </excise>
    <subtotal_with_taxes>0</subtotal_with_taxes>
    </item>
    </items>
    <column_summary_values>
    <column_subtotal>300000</column_subtotal>
    <column_subtotal_uzs>300000</column_subtotal_uzs>
    <column_excise_value>0</column_excise_value>
    <column_excise_value_uzs>0</column_excise_value_uzs>
    <column_vat_value>0</column_vat_value>
    <column_vat_value_uzs>0</column_vat_value_uzs>
    <column_subtotal_with_taxes>0</column_subtotal_with_taxes>
    <column_subtotal_with_taxes_uzs>0</column_subtotal_with_taxes_uzs>
    </column_summary_values>
    <column_summary_values_in_words>
    <column_subtotal_in_words>Триста тысяч сум 00 тийин</column_subtotal_in_words>
    <column_subtotal_uzs_in_words>Триста тысяч сум 00 тийин</column_subtotal_uzs_in_words>
    <column_subtotal_with_taxes_in_words/>
    <column_subtotal_with_taxes_uzs_in_words/>
    </column_summary_values_in_words>
    </document>
    <expansion>???</expansion>
    </act_and_invoice>
    </acts_and_invoices>
    </document_container>

                                        

Sending a request

In the examples above, after completing training preparations, a query was created with the body and headers containing a token and a data structure type.                                 It only remains to send a request to the URL address with the requested method, in this case HTTP POST, let's send our request:

POST https://Api.Faktura.uz/ Api/Document/ImportDocumentRegister HTTP/1.1
    Host: api.faktura.uz

....
                                

Response processing

Consider the response from the service API:

HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?ZjpcRGV2ZWxvcG1lbnRcRmFrdHVyYVxTb3VyY2VcRmFrdHVyYUFwaU1hc3RlclxmYWt0dXJhLmFwaVxhcGlcZG9jdW1lbnRcSW1wb3J0RG9jdW1lbnRSZWdpc3Rlcg==?=
X-Powered-By: ASP.NET
Date: Tue, 07 Mar 2017 10:30:29 GMT
Content-Length: 167

{"SuccessCount":3,"ErrorCount":0,"SuccessItems":[{"Name":"2017-3","Message":null},{"Name":"2017-2","Message":null},{"Name":"2017-1","Message":null}],"ErrorItems":null}

Formatted answer body variant:

{
    "ErrorCount" : 0,
    "ErrorItems" : null,
    "SuccessCount" : 3,
    "SuccessItems" : [
        {
            "Message" : null,
            "Name" : "2017-3"
        },
        {
            "Message" : null,
            "Name" : "2017-2"
        },
        {
            "Message" : null,
            "Name" : "2017-1"
        }
    ]
}
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/xml; charset=utf-8
Expires: -1
Server: Microsoft-IIS/10.0
X-AspNet-Version: 4.0.30319
X-SourceFiles: =?UTF-8?B?ZjpcRGV2ZWxvcG1lbnRcRmFrdHVyYVxTb3VyY2VcRmFrdHVyYUFwaU1hc3RlclxmYWt0dXJhLmFwaVxhcGlcZG9jdW1lbnRcSW1wb3J0RG9jdW1lbnRSZWdpc3Rlcg==?=
X-Powered-By: ASP.NET
Date: Tue, 07 Mar 2017 10:30:29 GMT
Content-Length: 497

<DocumentImportResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><ErrorCount>0</ErrorCount><ErrorItems i:nil="true" /><SuccessCount>3</SuccessCount><SuccessItems><DocumentImportItemResult><Message i:nil="true" /><Name>2017-3</Name></DocumentImportItemResult><DocumentImportItemResult><Message i:nil="true" /><Name>2017-2</Name></DocumentImportItemResult><DocumentImportItemResult><Message i:nil="true" /><Name>2017-1</Name></DocumentImportItemResult></SuccessItems></DocumentImportResult>

Отформатированный вариант тела ответа:

<DocumentImportResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
    <ErrorCount>0</ErrorCount>
    <ErrorItems i:nil="true" />
    <SuccessCount>3</SuccessCount>
    <SuccessItems>
        <DocumentImportItemResult>
            <Message i:nil="true" />
            <Name>2017-3</Name>
        </DocumentImportItemResult>
        <DocumentImportItemResult>
			<Message i:nil="true" />
			<Name>2017-2</Name>
		</DocumentImportItemResult>
        <DocumentImportItemResult>
			<Message i:nil="true" />
			<Name>2017-1</Name>
		</DocumentImportItemResult>
    	</SuccessItems>
</DocumentImportResult>

Important points are highlighted in the answer:

HTTP/1.1 200 OK

Tells us that the service has successfully processed the request and returned a response with code status 200 (OK)

As a result, we managed to turn to the service and get an authorized token. We prepared a request for sending and filled in the data for transmission. We sent the request and received a response.

You do not need to receive a new token for each cycle, you can omit the step of getting a token if you have an active token. The expiration date of this is indicated when the given token is received in the field ."Expires"

One cycle of the order of work with the service is over. Next, we offer you a list of available methods.

Methods

Import and send a contract

URL: Api/Document/SendDocument

Request method: POST

Imports the contract into the system and sends the contract to the

Input parameters:

Property A type Description
documentData DocumentMin The model object DocumentMin Containing document details

Importing documents into the system

URL: Api/Document/ImportDocumentRegister

Request method: POST

Imports a lot of documents into the system. The type of documents is transmitted separately as arrays.

Input parameters:

Property A type Description
invoices invoice [] Multiple model objects invoice
acts_and_invoices act_and_invoice [] Multiple model objects act_and_invoice
invoice_for_payments invoice_for_payment [] Multiple model objects invoice_for_payment
material_reports material_report [] Multiple model objects material_report
dynamic_documents dynamic_document [] Multiple model objects dynamic_document

The root element for querying the XML type

<document_container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">

...

</document_container>

Example of dynamic report request content (Act transfer)

<document_container xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <dynamic_document>
    <head>
      <file_name>act-transfer_302563857_489043363_2017-09-20_FU_00000000001.xml</file_name>
      <program_version>1.0.0</program_version>
      <format_version>1.0.0</format_version>
      <sender>
        <sender_info>
          <INN>302563857</INN>
          <OKED>55555</OKED>
          <company_name>Space Online Genesis</company_name>
          <address>
            <postal_code>postal_code0</postal_code>
            <region>region0</region>
            <provincial_district>provincial_district0</provincial_district>
            <city>city0</city>
            <locality>locality0</locality>
            <city_district>city_district0</city_district>
            <street>street0</street>
            <building>0</building>
            <wing>wing0</wing>
            <apartment>apartment0</apartment>
          </address>
          <phone>phone0</phone>
          <email>email0</email>
          <fax>fax0</fax>
          <website>website0</website>
          <bank_details>
            <account_number>0</account_number>
            <special_account_number>special_account_number0</special_account_number>
            <bank_name>bank_name0</bank_name>
            <bank_code>0</bank_code>
            <activity_code>0</activity_code>
          </bank_details>
        </sender_info>
        <approver_and_signers>
          <approver>
            <position>position0</position>
            <last_name>last_name0</last_name>
            <first_name>first_name0</first_name>
            <middle_name>middle_name0</middle_name>
          </approver>
          <signer_director>
            <position>position1</position>
            <last_name>last_name1</last_name>
            <first_name>first_name1</first_name>
            <middle_name>middle_name1</middle_name>
          </signer_director>
          <signer_accountant>
            <position>position2</position>
            <last_name>last_name2</last_name>
            <first_name>first_name2</first_name>
            <middle_name>middle_name2</middle_name>
          </signer_accountant>
          <signer_warehouse>
            <position>position3</position>
            <last_name>last_name3</last_name>
            <first_name>first_name3</first_name>
            <middle_name>middle_name3</middle_name>
          </signer_warehouse>
        </approver_and_signers>
      </sender>
      <receiver>
        <receiver_info>
          <INN>489043363</INN>
          <OKED>0</OKED>
          <company_name>company_name1</company_name>
          <address>
            <postal_code>postal_code1</postal_code>
            <region>region1</region>
            <provincial_district>provincial_district1</provincial_district>
            <city>city1</city>
            <locality>locality1</locality>
            <city_district>city_district1</city_district>
            <street>street1</street>
            <building>0</building>
            <wing>wing1</wing>
            <apartment>apartment1</apartment>
          </address>
          <phone>phone1</phone>
          <email>email1</email>
          <fax>fax1</fax>
          <website>website1</website>
          <bank_details>
            <account_number>0</account_number>
            <special_account_number>special_account_number1</special_account_number>
            <bank_name>bank_name1</bank_name>
            <bank_code>0</bank_code>
            <activity_code>0</activity_code>
          </bank_details>
        </receiver_info>
        <approver_and_signers>
          <approver>
            <position>position4</position>
            <last_name>last_name4</last_name>
            <first_name>first_name4</first_name>
            <middle_name>middle_name4</middle_name>
          </approver>
          <signer>
            <position>position5</position>
            <last_name>last_name5</last_name>
            <first_name>first_name5</first_name>
            <middle_name>middle_name5</middle_name>
          </signer>
        </approver_and_signers>
      </receiver>
      <sender_operator>
        <INN>0</INN>
        <company_name>company_name2</company_name>
        <address>
          <postal_code>postal_code2</postal_code>
          <region>region2</region>
          <provincial_district>provincial_district2</provincial_district>
          <city>city2</city>
          <locality>locality2</locality>
          <city_district>city_district2</city_district>
          <street>street2</street>
          <building>0</building>
          <wing>wing2</wing>
          <apartment>apartment2</apartment>
        </address>
        <phone>phone2</phone>
        <email>email2</email>
        <fax>fax2</fax>
        <website>website2</website>
      </sender_operator>
      <receiver_operator>
        <INN>0</INN>
        <company_name>company_name3</company_name>
        <address>
          <postal_code>postal_code3</postal_code>
          <region>region3</region>
          <provincial_district>provincial_district3</provincial_district>
          <city>city3</city>
          <locality>locality3</locality>
          <city_district>city_district3</city_district>
          <street>street3</street>
          <building>0</building>
          <wing>wing3</wing>
          <apartment>apartment3</apartment>
        </address>
        <phone>phone3</phone>
        <email>email3</email>
        <fax>fax3</fax>
        <website>website3</website>
      </receiver_operator>
    </head>
    <document>
      <header_values>						
        <dynamic_item>
          <item_name>document_number</item_name>
          <item_type>integer</item_type>
          <item_value>94228</item_value>
        </dynamic_item>
        <dynamic_item>
          <item_name>document_date</item_name>
          <item_type>datetime</item_type>
          <item_value>28.06.2016</item_value>
        </dynamic_item>
        <dynamic_item>
          <item_name>contract_date</item_name>
          <item_type>datetime</item_type>
          <item_value>10.10.2016</item_value>
        </dynamic_item>
        <dynamic_item>
          <item_name>contract_number</item_name>
          <item_type>integer</item_type>
          <item_value>176</item_value>
        </dynamic_item>
        <dynamic_item>
          <item_name>commission_date</item_name>
          <item_type>string</item_type>
          <item_value>28.07.2017</item_value>
        </dynamic_item>
        <dynamic_item>
          <item_name>commission_number</item_name>
          <item_type>string</item_type>
          <item_value>29-01-13/2201</item_value>
        </dynamic_item>
      </header_values>
      <items>
        <item_row>
          <item_columns>
            <dynamic_item>
              <item_name>service_name_column</item_name>
              <item_type>string</item_type>
              <item_value>Sim card GSM 900-1800</item_value>
            </dynamic_item>
            <dynamic_item>
              <item_name>serial_number_column</item_name>
              <item_type>string</item_type>
              <item_value>с 8999999999999999 по 9999999999999999</item_value>
            </dynamic_item>
            <dynamic_item>
              <item_name>quantity_column</item_name>
              <item_type>integer</item_type>
              <item_value>70</item_value>
            </dynamic_item>
            <dynamic_item>
              <item_name>price_column</item_name>
              <item_type>decimal</item_type>
              <item_value>6000.00</item_value>
            </dynamic_item>
            <dynamic_item>
              <item_name>sub_total_column</item_name>
              <item_type>decimal</item_type>
              <item_value>420000.00</item_value>
            </dynamic_item>
          </item_columns>
        </item_row>					           
      </items>
      <summary_values>
        <dynamic_item>
          <item_name>quantity_column</item_name>
          <item_type>integer</item_type>
          <item_value>80</item_value>
        </dynamic_item>
        <dynamic_item>
          <item_name>sub_total_column</item_name>
          <item_type>decimal</item_type>
          <item_value>490000.00</item_value>
        </dynamic_item>
      </summary_values>
    </document>
    <expansion/>
  </dynamic_document>
</dynamic_documents>

Check company existance

URL: Api/CheckCompanyExist/{Inn}

Request method: GET

Checks, if the company with this INN number registered on system or not

Input parameters:

Fields marked with * are mandatory
Property A type Description
Inn string * The number of the counterparty (nine-digit number)

Download ZIP-archive

URL: Api/DownloadArchive/{UniqueId}

Request method: GET

Get published document's ZIP-archive by stream content

Input parameters:

Поля отмеченные * являются обязательными
Property A type Description
UniqueId string * Unique identifier of document

Recommendation: On downloading big ZIP-archives from server, there are might be unexpected exceptions and connection might get closed. In this cases, in order to resume downloading the documents, please use the boundary conditions for the output of streaming data to separate the content into several pieces.
The boundary conditions are passed in the request header

Example of using Range header:

How to get content from 100th byte
GET https://api.faktura.uz/Api/DownloadArchive/5249260F0A HTTP/1.1
Host: api.faktura.uz
Authorization: Bearer p7p3kYGBqFNWgsYWS0gPxkadHXADTMWI-iml_1GITxbPU9mPWf8l19tP46PPf2xcgbAZFSLEu3QhWoDKaIDx0_tQEGRwyojAtFAjwQWLw_V93CjD1khJKQOd4q1zLF0Pjmg3w4DhUVdt-91ZTpXh02vrg8xbXeZf5hClFLU-_pP6peePjXOQM3V2xlgXoPVruOBBxzd9qDq0-XqOijtrt3FdLvNpwFGlXhm7Rgt5cMuBT83MY845d2a5yaLFRsdkP3xJgSR7j6Qcr_KIouFcDuHJUxM8yuEaO7bax7fQG5HE0iQDY9k8d-JB5fbvi-QxFNInALf2VjHonDIEEU_JGMLfB0-SgRJd-szDST-yb87X-W0x7uTAaQaMCIPiyxeYcvC9qvswK0uEx2yLAMJj5w
Range: bytes=100-

How to get content from 100th to 199 (included) bytes
GET https://api.faktura.uz/Api/DownloadArchive/5249260F0A HTTP/1.1
Host: api.faktura.uz
Authorization: Bearer p7p3kYGBqFNWgsYWS0gPxkadHXADTMWI-iml_1GITxbPU9mPWf8l19tP46PPf2xcgbAZFSLEu3QhWoDKaIDx0_tQEGRwyojAtFAjwQWLw_V93CjD1khJKQOd4q1zLF0Pjmg3w4DhUVdt-91ZTpXh02vrg8xbXeZf5hClFLU-_pP6peePjXOQM3V2xlgXoPVruOBBxzd9qDq0-XqOijtrt3FdLvNpwFGlXhm7Rgt5cMuBT83MY845d2a5yaLFRsdkP3xJgSR7j6Qcr_KIouFcDuHJUxM8yuEaO7bax7fQG5HE0iQDY9k8d-JB5fbvi-QxFNInALf2VjHonDIEEU_JGMLfB0-SgRJd-szDST-yb87X-W0x7uTAaQaMCIPiyxeYcvC9qvswK0uEx2yLAMJj5w
Range: bytes=100-199

Models

DocumentMin (Contract model)

Fields marked with * are mandatory
Property A type Description
DocumentType integer * An integer representation of the document type.
  • 1 - Contract
DocumentName string * Document's name
FileExtension string * File extension
ReceiverInnNumber string * The number of the counterparty (nine-digit number)
FileName string * File name in file structure
Base64Document string * The contents of the file are encoded in Base64 string

invoice (Invoice model)

Property A type Description
head head Model objects head
document document Model objects document
expansion string Text field for additional information about the invoice

act_and_invoice (Model act and invoice)

Property A type Description
head head Model objects head
document document Model objects document
expansion string Text field for additional information about the act and invoice

invoice_for_payment (Account model for prepayment)

Property A type Description
head head Model objects head
document document Model objects document
expansion string Text field for additional information about the bill for payment

material_report (Model material report)

Property A type Description
head head Model objects head
document document Model objects document
expansion string Text field for additional information about the material report

dynamic_document (Model dynamic report)

Property A type Description
head head Model objects head
document document Model objects document
expansion string Text field for additional information about the dynamic report

head (The document company model)

Property A type Description
file_name string File name in string form
In case `dynamic_document` document type will determined by first part of filename.
Available: act-transfer(Act transfer)
For example: act-transfer_302563857_489043363_2017-09-20_FU_00000000001.xml
program_version string The version of the program in a string form
format_version string Format version in string form
sender sender Model objects sender
receiver receiver Model objects receiver
sender_operator company Model objects company
receiver_operator company Model objects company

document (Document Model)

Fields marked with * are mandatory
Property A type Description
document_version string Document version in string form
document_number string Document number in string form
document_date string Date of the document in the string format in the format "dd.MM.yyyy"
korrektirovoch_document_number string Correction number of the document in string form
korrektirovoch_document_date string Corrective date of the document in a string format in the format "dd.MM.yyyy"
doverennost_number string Power of Attorney number in string form
doverennost_date string The date of the power of attorney in the string form in the format "dd.MM.yyyy"
contract_number string * Contract number in string form
contract_date string * Date of the contract in the string form in the format "dd.MM.yyyy"
currency_code string Currency code in string form
currency_rate double The exchange rate relative to the sum
currency_rate_date string Exchange rate to the given day in a string format in the format "dd.MM.yyyy"
items item [] Multiple model objects item
column_summary_values column_summary_values Model objects column_summary_values
column_summary_values_in_words column_summary_values_in_words Model objects column_summary_values_in_words

document (Model document of material report)

Fields marked with * are mandatory
Property A type Description
document_number string Document's number in string
document_date string Document's number string represented in format "dd.MM.yyyy".
items item [] Multiple model objects item
summary_values summary_values Model objects summary_values

document (Model document of dynamic report type)

Fields marked with * are mandatory
Property A type Description
header_values dynamic_item * [] Document's header values. Multiple model objects dynamic_item
items item_row * [] Enumerable rows values. Multiple model objects item_row
summary_values dynamic_item [] Document's summary values for rows. Multiple model objects dynamic_item

item_row (Model enumerable row's values)

Fields marked with * are mandatory
Property A type Description
item_columns dynamic_item * [] Multiple model objects dynamic_item

dynamic_item (Model row's single cell's value)

Fields marked with * are mandatory
Property A type Description
item_name string * Field name
item_type string * System defined value type
(Available: string | integer | decimal | datetime)
item_value string Field value in string

sender (Sender model)

Property A type Description
sender_info sender_info Model objects sender_info
approver_and_signers approver_and_signers Model objects approver_and_signers

receiver (Recipient Model)

Property A type Description
receiver_info receiver_info Model objects receiver_info
approver_and_signers approver_and_signers Model objects approver_and_signers

company (Operator model)

Property A type Description
INN string INN number in string form
company_name string Company name in string form
address address The model object address
phone string Phone number in string form
email string E-mail address in a string form
fax string Fax number in string form
website string Web site address in string form
bank_details bank_details The model object bank_details

item (Product or service model)

Fields marked with * are mandatory
Property A type Description
description string * Product or service name
volume integer * Quantity of goods or services
subtotal double * Cost including delivery
item_number string Product or service number in string form
measurement_unit string * Unit of measurement in string form
unit_price double * The price per unit of a good or service
excise excise * Excise tax. Model object excise
vat vat * VAT. The model object vat
subtotal_with_taxes double * Cost including taxes

item (Model material report for products or services)

Fields marked with * are mandatory
Property A type Description
service_name string * Name of service or product
period_start_item_count integer * Count (Saldo for begin of period)
obtain_item_count integer * Count (got Sim / Ruim cards (in))
connect_item_count integer * Count (connected Sim / Ruim cards)
change_item_count integer Count (change Sim / Ruim cards)
lost_item_count integer Count (lost Sim / Ruim cards)
period_end_item_count integer * Count (Saldo for end of period)

column_summary_values (Model of the aggregate values of goods or services)

Fields marked with * are mandatory
Property A type Description
column_subtotal double * Total amountа
column_subtotal_uzs double Total amount in uzbek soums
column_excise_value double Total amount of excise tax
column_excise_value_uzs double The total amount of excise tax in soums
column_vat_value double Total amount of VAT
column_vat_value_uzs double Total amount of VAT in uzbek soums
column_subtotal_with_taxes double Total amount including taxes
column_subtotal_with_taxes_uzs double Total amount including taxes in uzbek soums

column_summary_values_in_words (Model of the total value of goods or services)

Fields marked with * are mandatory
Property A type Description
column_subtotal_in_words string * Total amount in words
column_subtotal_uzs_in_words string Total amount in uzbek soums in words
column_subtotal_with_taxes_in_words string Total amount including taxes in words
column_subtotal_with_taxes_uzs_in_words string Total amount including taxes in uzbek soums in words

summary_values (Model of the aggregate values of goods or services for material report)

Fields marked with * are mandatory
Property A type Description
total_period_start_item_count integer * Total count (Saldo for begin of period)
total_obtain_item_count integer * Total count (got Sim / Ruim cards (in))
total_connect_item_count integer * Total count (connected Sim / Ruim cards)
total_change_item_count integer Total count (change Sim / Ruim cards)
total_lost_item_count integer Total count (lost Sim / Ruim cards)
total_period_end_item_count integer * Total count (Saldo for end of period)

sender_info (The sender information model)

Property A type Description
INN string INN number in string form
company_name string Company name in string form
address address The model object address
phone string Phone number in string form
email string E-mail address in a string form
fax string Fax number in string form
website string Web site address in string form
bank_details bank_details The model object bank_details

approver_and_signers (Model responsible)

Property A type Description
approver employee Employee responsible for approval. The model object employee
signer employee Employee responsible for signing. The model object employee
signer_director employee Director. The model object employee
signer_accountant employee Accountant. The model object employee
signer_warehouse employee Storekeeper. The model object employee

receiver_info (Recipient Information Model)

Property A type Description
INN string INN number in string form
company_name string Company name in string form
address address The model object address
phone string Phone number in string form
email string E-mail address in a string form
fax string Fax number in string form
website string Web site address in string form
bank_details bank_details The model object bank_details

address (Address information model)

Property A type Description
postal_code string Zip in string form
region string Region in string form
provincial_district string Area in string form
city string City in string form
locality string Location in string form
city_district string City area in string form
street string Street in string form
building string Building in string form
wing string Wing of the building in line form
apartment string House number in string form

bank_details (Bank Information Model)

Property A type Description
account_number string Settlement account in a string form
special_account_number string Special account in a string form
bank_name string Bank name in string form
bank_code string MFO bank in the string form
activity_code string OKONH code in the string form

excise (Excise tax model)

Property A type Description
excise_rate integer Bid in integer format
excise_value double Amount

vat (VAT model)

Property A type Description
vat_rate integer Bid in integer format
vat_value double Amount

employee (Employee Model)

Property A type Description
position string Position in string form
last_name string Surname in string form
first_name string Name in string form
middle_name string Middle name in the string form