📜 ⬆️ ⬇️

Universal API for Check Information

Hello to residents of Habr.

In this article I would like to tell you about the API for receipt of checks, which was not provided to us by everyone’s favorite FTS.

When the QR codes first appeared on the checks, I thought “Wow, how cool! You scan the code and see if not all the info on the check, then a link to it. ” And what was my disappointment when, after scanning such code, I saw something like
')
t=20180518T220500&s=975.88&fn=8710000101125654&i=99456&fp=1250448795&n=1

But I did not get upset and thought that the Federal Tax Service took care of us and provided an API for obtaining such information. Googling for some time, I realized that the Federal Tax Service provided us with only a mobile application to check the receipt and view the information that came to them from the store.

But! Between the store and the tax there is another link - OFD - those who process information on checks received from the stores, and sent to the tax. So they provide an API for getting the information we need. Not all. And not always free.

Judging by the information from Wikipedia as of March 1, 2018, 17 CRFs are registered. Suppose 10 of them provide an open and free API. Taking into account that we do not know with which OFD a particular store is working, it will be necessary to go through API 10 of fiscal data operators. Far from the best option.

After some time, I accidentally stumbled upon an application (not from the FTS), which receives a check from the check code from the QR code. They will not "run" through all the CRFs and collect information from there - I thought. I went to Google again and came across such an answer .

It seemed that after this answer an impromptu investigation could be completed, but I still had some questions:


Having started the Android Device Monitor and SoapUI, I started to figure it out. I post here all the generalized information that I managed to get. The FTS provides the following public API:

check in
POST
https://proverkacheka.nalog.ru:9999/v1/mobile/users/signup
Content-Type: application / json; charset = UTF-8

Content:

 {"email":"some@mail.com","name":"SomeName","phone":"+79991234567"} 

All parameters are required.

If the result is successful, the user is created, an SMS with a password is sent to the specified number, and 204 No content is returned in response.

If the user already exists, then 409 Conflict and the message "user exists" are returned.
If the phone number is incorrect, then 500 Internal Server Error and the message “failed with code 20101” are returned.

If the email address is incorrect, then 400 Bad Request is returned and the message "[" Object did not pass validation for format email: <the email address you specified> "]".
If the email address is already in use, but the phone is not there, then there are no errors and the registration is successful.

Login
Get
https://proverkacheka.nalog.ru:9999/v1/mobile/users/login

In the header, the Pre-emptive Basic Authorization is transmitted, where the phone number is transmitted as username, as "+79991234567", and the password received in SMS when registering or recovering the password.

If everything is good, then 200 OK will return and the message will be in the form of json

 { "email": "<  ,   >", "name": "<,   >" } 

If you enter an incorrect phone number or password, then 403 Forbidden will be returned and the message "not be correct."

If you do not specify a phone number and / or password, then nothing will be returned.

Password recovery
POST
https://proverkacheka.nalog.ru:9999/v1/mobile/users/restore
Content-Type: application / json; charset = UTF-8

Content:

 {"phone":"+79991234567"} 

If the phone number is found, then 204 No Content is returned and an SMS with a new password is sent to the phone.

If the phone number is not found or the number is incorrect, then 404 Not Found and the message "the user was not found" are returned.

Check the existence of a check
Get
https://proverkacheka.nalog.ru:9999/v1/ofds/*/inns/*/fss/< FN number> / operations / <type of cash voucher> / tickets / <FD number>? fiscalSign = <FPD number> & date = 2018-05-17T17: 57: 00 & sum = 3900
Where

  • FN number (Fiscal Number) - 16-digit number. For example 8710000100518392
  • FD number (Fiscal document) - up to 10 characters. For example 54812
  • FPD number (Fiscal Document Indication, also known as FP) - up to 10 characters. For example 3522207165
  • Type of cash voucher. The check is marked as n = 1 (receipt) and n = 2 (return return)
  • Date - the date of the check. The format may vary. I tried to turn the date (ie 17-05-2018), put a space instead of T, delete seconds
  • Amount - amount from the check in kopecks

If the check is found, then 204 No Content will return.
If the check is not found, then 406 Not Acceptable will be returned.
If the date / amount is incorrect or does not match the date / amount indicated on the check, then 406 Not Acceptable is returned. At the same time seconds are not counted.
If you do not specify the date / amount parameter, then 400 Bad Request is returned and the message "[" Missing required property: <property_name> "]".

Getting detailed information on the check
Get
https://proverkacheka.nalog.ru:9999/v1/inns/*/kkts/*/fss/<FN number> / tickets / <FD number>? fiscalSign = <FPD number> & sendToEmail = no
Where

  • FN number (Fiscal Number) - 16-digit number. For example 8710000100518392
  • FD number (Fiscal document) - up to 10 characters. For example 54812
  • FPD number (Fiscal Document Indication, also known as FP) - up to 10 characters. For example 3522207165

You must also specify at least the empty device-id and device-os headers.
If incorrect user data is provided, then 403 Forbidden is returned and the message "was not correct".

If you do not specify a phone number and / or password, then nothing will return.

If the check is not found, then 406 Not Acceptable is returned. Also, the check may not be found if it was received long enough. FTS does not store information on checks for all time. At the time of this writing, the FTS kept detailed information for about 2-3 months.

If a check for the existence of a check did not occur before calling this method, then 202 Accepted will return (without messages and any content). When you call again information on the check will return.

If you try to substitute the value “yes” in the “sendToEmail” parameter, then 500 Internal Server Error and the message “connect ECONNREFUSED 127.0.0.1:465” will be returned. If you try to substitute other values ​​("true", 1, etc.), 400 Bad Request will return and the message "[" No enum match for: <value that you tried to transfer> "]".

If everything is good, then 200 OK will return and the contents in json format look something like this:

 {"document": {"receipt": { "operationType": 1, "fiscalSign": 3522207165, "dateTime": "2018-05-17T17:57:00", "rawData": "AwAzAREEEAA4NzEwMDAwMTAwNTE4MzEzDQQUADAwMDExOTM1MTQwNDE0MDUgICAg+gMMADc4MjU3MDYwODYgIBAEBAAJ2gAA9AMEAGzC/Vo1BAYAMQTSDyLSDgQEABYBAAASBAQAogAAAB4EAQAB/AMCADwPPAQPAD0EAwCKrqQ+BAQARzYzNyMERQAGBCcAKjM0OTIyNzcgTkVTVC6MruAuTUFYSUIukZKQgJeAkoWLLjE0MKyrNwQCAJ8P/wMEAAZAQg8TBAIAnw9PBAIAbAH9Aw4AhK6ro+PopaKgIICtraAHBAIAPA85BAEAAE8EAgBsARgEDACAo+Cu4q7goyCOjo7xAyoANjIwMDE3LCCjLiCFqqDipeCoraHj4KMsIOOrLiCAp6itoCwgpC4gMTimHwQBAAE=", "totalSum": 3900, "nds10": 364, "userInn": "7825706086", "taxationType": 1, "operator": "< >", "fiscalDocumentNumber": 54812, "properties": [ { "value": "G637", "key": "" }], "receiptCode": 3, "requestNumber": 162, "user": " ", "kktRegId": "0001193514041405", "fiscalDriveNumber": "8710000100518392", "items": [ { "sum": 3999, "price": 3999, "name": "*3492277 NEST..MAXIB..140", "quantity": 1, "nds10": 364 }], "ecashTotalSum": 0, "retailPlaceAddress": "620017, . , . , . 18", "cashTotalSum": 3900, "shiftNumber": 278 }}} / Vo1BAYAMQTSDyLSDgQEABYBAAASBAQAogAAAB4EAQAB / AMCADwPPAQPAD0EAwCKrqQ + BAQARzYzNyMERQAGBCcAKjM0OTIyNzcgTkVTVC6MruAuTUFYSUIukZKQgJeAkoWLLjE0MKyrNwQCAJ8P / wMEAAZAQg8TBAIAnw9PBAIAbAH9Aw4AhK6ro + PopaKgIICtraAHBAIAPA85BAEAAE8EAgBsARgEDACAo + Cu4q7goyCOjo7xAyoANjIwMDE3LCCjLiCFqqDipeCoraHj4KMsIOOrLiCAp6itoCwgpC4gMTimHwQBAAE =", {"document": {"receipt": { "operationType": 1, "fiscalSign": 3522207165, "dateTime": "2018-05-17T17:57:00", "rawData": "AwAzAREEEAA4NzEwMDAwMTAwNTE4MzEzDQQUADAwMDExOTM1MTQwNDE0MDUgICAg+gMMADc4MjU3MDYwODYgIBAEBAAJ2gAA9AMEAGzC/Vo1BAYAMQTSDyLSDgQEABYBAAASBAQAogAAAB4EAQAB/AMCADwPPAQPAD0EAwCKrqQ+BAQARzYzNyMERQAGBCcAKjM0OTIyNzcgTkVTVC6MruAuTUFYSUIukZKQgJeAkoWLLjE0MKyrNwQCAJ8P/wMEAAZAQg8TBAIAnw9PBAIAbAH9Aw4AhK6ro+PopaKgIICtraAHBAIAPA85BAEAAE8EAgBsARgEDACAo+Cu4q7goyCOjo7xAyoANjIwMDE3LCCjLiCFqqDipeCoraHj4KMsIOOrLiCAp6itoCwgpC4gMTimHwQBAAE=", "totalSum": 3900, "nds10": 364, "userInn": "7825706086", "taxationType": 1, "operator": "< >", "fiscalDocumentNumber": 54812, "properties": [ { "value": "G637", "key": "" }], "receiptCode": 3, "requestNumber": 162, "user": " ", "kktRegId": "0001193514041405", "fiscalDriveNumber": "8710000100518392", "items": [ { "sum": 3999, "price": 3999, "name": "*3492277 NEST..MAXIB..140", "quantity": 1, "nds10": 364 }], "ecashTotalSum": 0, "retailPlaceAddress": "620017, . , . , . 18", "cashTotalSum": 3900, "shiftNumber": 278 }}} 

Where

  • all amounts are in kopecks
  • data of the cashier in different stores have different formats (in one case the “Last Name First Name” can return, in the other “Last Name I. position”
  • the order of the elements may change
  • Different stores use different sets of parameters and, if a parameter is returned in a check from one store, then it’s not a fact that this parameter will be in a check from another store
  • the store address format may vary

Another example of a return check
 {"document": {"receipt": { "cashTotalSum": 0, "fiscalSign": 1301551154, "nds18": 4859, "operationType": 1, "userInn": "7728029110", "dateTime": "2018-05-18T22:05:00", "fiscalDocumentNumber": 12654, "receiptCode": 3, "ecashTotalSum": 97588, "nds10": 5976, "requestNumber": 395, "retailPlaceAddress": "., ., .50", "fiscalDriveNumber": "871000010459859", "taxationType": 1, "user": "  ", "operator": "< >", "items": [ { "sum": 3799, "quantity": 1, "price": 3799, "name": "18074   100", "nds10": 345 }, { "sum": 7490, "quantity": 0.872, "nds18": 1143, "name": "2000339  . 1", "price": 8590 } ], "totalSum": 97588, "rawData": "AwD5BREEEAA4NzEwMDAwMTAxMzM3NjU5DQQUADAwMDEyNDg4ODgwNDkzNDEgICAg+gMMADc3MjgwMjkxMTAgIBAEBAAocAEA9AMEAAxO/1o1BAYAMQRNlDKEDgQEAAYBAAASBAQAiwEAAB4EAQAB/AMDADR9ASMEMwAGBBYAMTgwNzQgk6rgrq8gr6CqpeIgMTAwozcEAgDXDv8DAwAD6AMTBAIA1w5PBAIAWQEjBEEABgQkADIwMDAzMzkgn6GrrqqoIJGFh46NLo+QhYSLjoaFjYiFIDGqozcEAgCOIf8DAwADaAMTBAIAQh1OBAIAdwQjBD4ABgQiACozMDc3NDA0IJGPryCBoKOl4iDhIKrjrabj4q6sIDE1MKM3BAIAxwP/AwMAA9AHEwQCAI4HTwQBALAjBDkABgQcADMyMjYzMTQgjKDhq64giJCBiJKRio6FIDE4MKM3BAIA7ir/AwMAA+gDEwQCAO4qTwQCAOcDIwQ5AAYEHQAqMzIyNjQzNCCKoODiruSlq+wg4KCtraipIDGqozcEAgDGB/8DAwAD5gMTBAIAwgdPBAEAtSMENQAGBBkAKjMyMjY0NDAgi+OqIJCFj5eAkpuJIDGqozcEAgDGB/8DAwAD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DEwQCALMUTgQCACgDIwQ9AAYEIAAzNTAzMzY2IIqu4qul4usgipCTg4ubiSCDjoQgNDUwozcEAgBXG/8DAwAD6AMTBAIAVxtPBAIAfAIjBDkABgQdADM2MDExMjIgiuDjr6Agn5eNhYKAnyD8MiA4MDCjNwQCAGcG/wMDAAPoAxMEAgBnBk8EAQCV/QMUAJHj5aDgpaKgII4goOHhqOHipa3iBwQBAAA5BAMANH0BTgQCAPsSTwQCAFgXGAQRAICOIJKEII+l4KWq4KXh4q6q8QMhAKMuhaqg4qXgqK2h4+CjLCDjqy6R46uorK6ioCwgpC41MB8EAQAB", "shiftNumber": 262, "kktRegId": "0001248888049341" }}} / 1o1BAYAMQRNlDKEDgQEAAYBAAASBAQAiwEAAB4EAQAB / AMDADR9ASMEMwAGBBYAMTgwNzQgk6rgrq8gr6CqpeIgMTAwozcEAgDXDv8DAwAD6AMTBAIA1w5PBAIAWQEjBEEABgQkADIwMDAzMzkgn6GrrqqoIJGFh46NLo + QhYSLjoaFjYiFIDGqozcEAgCOIf8DAwADaAMTBAIAQh1OBAIAdwQjBD4ABgQiACozMDc3NDA0IJGPryCBoKOl4iDhIKrjrabj4q6sIDE1MKM3BAIAxwP / AwMAA9AHEwQCAI4HTwQBALAjBDkABgQcADMyMjYzMTQgjKDhq64giJCBiJKRio6FIDE4MKM3BAIA7ir / AwMAA + gDEwQCAO4qTwQCAOcDIwQ5AAYEHQAqMzIyNjQzNCCKoODiruSlq + wg4KCtraipIDGqozcEAgDGB / 8DAwAD5gMTBAIAwgdPBAEAtSMENQAGBBkAKjMyMjY0NDAgi + OqIJCFj5eAkpuJIDGqozcEAgDGB / 8DAwADWAETBAIArQJPBAEAPiMENwAGBBoAKjMyMjczOTEgg + Dj6KggipCAkY2bhSAxqqM3BAIAPx // AwMAA2IBEwQCABALTgQCALABIwQyAAYEFQAzMjI3NDAzIICvpavs4ait6yAxqqM3BAIArx3 / AwMAA14CEwQCAP0RTgQCAL4CIwQ9AAYEIAAzMjU1MjQ4IIyu4Kquouwgr64tqq7gpanhqqggMTAwozcEAgBkMv8DAwADRgETBAIAbRBOBAIAgQIjBDsABgQeADMzMzAzNjggkayl4qCtoCAyMCUgr6sv4eIgNDAwozcEAgCmHf8DAwAD6AMTBAIAph1PBAIAsgIjBD8ABgQiADMzMzkx {"document": {"receipt": { "cashTotalSum": 0, "fiscalSign": 1301551154, "nds18": 4859, "operationType": 1, "userInn": "7728029110", "dateTime": "2018-05-18T22:05:00", "fiscalDocumentNumber": 12654, "receiptCode": 3, "ecashTotalSum": 97588, "nds10": 5976, "requestNumber": 395, "retailPlaceAddress": "., ., .50", "fiscalDriveNumber": "871000010459859", "taxationType": 1, "user": "  ", "operator": "< >", "items": [ { "sum": 3799, "quantity": 1, "price": 3799, "name": "18074   100", "nds10": 345 }, { "sum": 7490, "quantity": 0.872, "nds18": 1143, "name": "2000339  . 1", "price": 8590 } ], "totalSum": 97588, "rawData": "AwD5BREEEAA4NzEwMDAwMTAxMzM3NjU5DQQUADAwMDEyNDg4ODgwNDkzNDEgICAg+gMMADc3MjgwMjkxMTAgIBAEBAAocAEA9AMEAAxO/1o1BAYAMQRNlDKEDgQEAAYBAAASBAQAiwEAAB4EAQAB/AMDADR9ASMEMwAGBBYAMTgwNzQgk6rgrq8gr6CqpeIgMTAwozcEAgDXDv8DAwAD6AMTBAIA1w5PBAIAWQEjBEEABgQkADIwMDAzMzkgn6GrrqqoIJGFh46NLo+QhYSLjoaFjYiFIDGqozcEAgCOIf8DAwADaAMTBAIAQh1OBAIAdwQjBD4ABgQiACozMDc3NDA0IJGPryCBoKOl4iDhIKrjrabj4q6sIDE1MKM3BAIAxwP/AwMAA9AHEwQCAI4HTwQBALAjBDkABgQcADMyMjYzMTQgjKDhq64giJCBiJKRio6FIDE4MKM3BAIA7ir/AwMAA+gDEwQCAO4qTwQCAOcDIwQ5AAYEHQAqMzIyNjQzNCCKoODiruSlq+wg4KCtraipIDGqozcEAgDGB/8DAwAD5gMTBAIAwgdPBAEAt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NDUwozcEAgBXG / 8DAwAD6AMTBAIAVxtPBAIAfAIjBDkABgQdADM2MDExMjIgiuDjr6Agn5eNhYKAnyD8MiA4MDCjNwQCAGcG / wMDAAPoAxMEAgBnBk8EAQCV / QMUAJHj5aDgpaKgII4goOHhqOHipa3iBwQBAAA5BAMANH0BTgQCAPsSTwQCAFgXGAQRAICOIJKEII + l4KWq4KXh4q6q {"document": {"receipt": { "cashTotalSum": 0, "fiscalSign": 1301551154, "nds18": 4859, "operationType": 1, "userInn": "7728029110", "dateTime": "2018-05-18T22:05:00", "fiscalDocumentNumber": 12654, "receiptCode": 3, "ecashTotalSum": 97588, "nds10": 5976, "requestNumber": 395, "retailPlaceAddress": "., ., .50", "fiscalDriveNumber": "871000010459859", "taxationType": 1, "user": "  ", "operator": "< >", "items": [ { "sum": 3799, "quantity": 1, "price": 3799, "name": "18074   100", "nds10": 345 }, { "sum": 7490, "quantity": 0.872, "nds18": 1143, "name": "2000339  . 1", "price": 8590 } ], "totalSum": 97588, "rawData": "AwD5BREEEAA4NzEwMDAwMTAxMzM3NjU5DQQUADAwMDEyNDg4ODgwNDkzNDEgICAg+gMMADc3MjgwMjkxMTAgIBAEBAAocAEA9AMEAAxO/1o1BAYAMQRNlDKEDgQEAAYBAAASBAQAiwEAAB4EAQAB/AMDADR9ASMEMwAGBBYAMTgwNzQgk6rgrq8gr6CqpeIgMTAwozcEAgDXDv8DAwAD6AMTBAIA1w5PBAIAWQEjBEEABgQkADIwMDAzMzkgn6GrrqqoIJGFh46NLo+QhYSLjoaFjYiFIDGqozcEAgCOIf8DAwADaAMTBAIAQh1OBAIAdwQjBD4ABgQiACozMDc3NDA0IJGPryCBoKOl4iDhIKrjrabj4q6sIDE1MKM3BAIAxwP/AwMAA9AHEwQCAI4HTwQBALAjBDkABgQcADMyMjYzMTQgjKDhq64giJCBiJKRio6FIDE4MKM3BAIA7ir/AwMAA+gDEwQCAO4qTwQCAOcDIwQ5AAYEHQAqMzIyNjQzNCCKoODiruSlq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APcR/wMDAAPoAxMEAgD3EU8EAgCiASMEQAAGBCMAMzQ5NTA4MCCCrqSgIEpFWUVBIENSWVNUQUxOQVlBIDAsNas3BAIAsxT/AwMAA+gDEwQCALMUTgQCACgDIwQ9AAYEIAAzNTAzMzY2IIqu4qul4usgipCTg4ubiSCDjoQgNDUwozcEAgBXG/8DAwAD6AMTBAIAVxtPBAIAfAIjBDkABgQdADM2MDExMjIgiuDjr6Agn5eNhYKAnyD8MiA4MDCjNwQCAGcG/wMDAAPoAxMEAgBnBk8EAQCV/QMUAJHj5aDgpaKgII4goOHhqOHipa3iBwQBAAA5BAMANH0BTgQCAPsSTwQCAFgXGAQRAICOIJKEII+l4KWq4KXh4q6q8QMhAKMuhaqg4qXgqK2h4+CjLCDjqy6R46uorK6ioCwgpC41MB8EAQAB", "shiftNumber": 262, "kktRegId": "0001248888049341" }}} 



I don’t see much sense in the login, but it is used in their mobile application. Perhaps in the future it will come in handy for something.

Who is interested in an example of implementing a connection to this API, here is a link to the github project of a library written in C #.

For any questions or comments please in the comments.

UPD After a small check, it turned out that the FTS does not store detailed information on all checks. At least on 05/22/2018, I could not get a complete check from December 2017, January and February 2018, despite the fact that the CRF has this information and the FTS mobile application reports that the check is correct. For March 2018, the check has already been received.

UPD As users noticed, IvanG and neoman36 , n = 1, is a “Cash voucher type”. 1 - means "arrival", 2 - "Return of the parish." The same number must be inserted when checking the existence of a check.

UPD As the Echo77 user noted , from December 2018, the API began to return the response code 451 “Illegal public API usage”, so now before requesting a check, it is necessary to make a request to check the existence of the check.

Source: https://habr.com/ru/post/358966/


All Articles