Answer the question
In order to leave comments, you need to log in
Is there a single API for accessing online checkout data?
Since 07/01/2017, all checks have a QR code, which can be used to check the check and download it in a special application of the Federal Tax Service. If there is a legal API for accessing receipt data for use in your applications / services?
Answer the question
In order to leave comments, you need to log in
< there was an old answer to an outdated api >
information on the new api (August 2020)
is here in the comments: leftjoin.ru/all/sobiraem-dannye-s-chekov-gipermark...
and here the new request format is analyzed in an issue:
https ://github.com/kosov/fns-check/issues/3#issuec...
https://github.com/DmitriyBobrovskiy/CheckReceiptS...
spoiler - a little more complicated, you need to get a session ID that lives for a couple of days, and after updating it by token (session and token are initially issued when verifying the number / registration, then when the session is updated, the token / session key pair is immediately updated)
ps links are taken from the application's discussion thread, maybe there is something else useful there:https://4pda.ru/forum/index.php?showtopic=835790&s...
The QR code on the check duplicates the same information that a person can read on the check.
Where exactly the FTS application sends data for verification, you can check it yourself if you install their program https://kkt-online.nalog.ru/ and use any sniffer.
You can also check the check at
https://kpkcheck.ru/System/ExpressCheck.aspx
https://ofd.ru/checkinfo
https://ofd-ya.ru/check
https://consumer.1-ofd.ru/ #/landing
etc.
Solution in PHP
Inline
Submit your data.
$base = "https://proverkacheka.nalog.ru:9999";
$derviceId = uniqid();
$deviceOS = "Android 4.4.4";
$protocol = "2";
$clientVersion = "1.4.1.3";
$userAgent = "okhttp/3.0.1";
$fn = $_GET["fn"];
$fd = $_GET["fd"];
$fs = $_GET["fs"];
$query = http_build_query([
'fiscalSign' => $fs,
'sendToEmail' => "no"
]);
$ch = curl_init("$base/v1/inns/*/kkts/*/fss/$fn/tickets/$fd?".$query);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"Device-Id: $derviceId",
"Device-OS: $deviceOS",
"Version: $protocol",
"ClientVersion: $clientVersion",
"ClientVersion: $clientVersion",
]);
curl_setopt($ch, CURLOPT_USERPWD, "8(800)555-35-35" . ":" . "554400");
$result = curl_exec($ch);
$json = json_decode($result);
var_dump($json);
Each OFD has its own API. Those. if you write software for a specific cash register, then you can collect the necessary link.
For example, a link to a taxcom check will look like this:
https://receipt.taxcom.ru/v01/show?fp=[fpd]&s=[sum...
where fpd - the fiscal signature of the document
summ - the total amount of the check For ofd.ru
it will look like this
: TIN of the legal person who broke the check
rn - reg. cash register number
fn - fiscal drive
number docNumb - check number
fpd - fiscal signature
But I agree, the answer to the question is interesting =) If there is a universal API that is the same for everyone, then this is of course more convenient.
The answer is most likely irrelevant, but suddenly in the future someone will need it - a post on Habré
In shell
environment c curl
[email protected]
NAME=Name
PHONE=+79xxxxxxxxxx
curl -X POST -H "Content-Type: application/json; charset=UTF-8" https://proverkacheka.nalog.ru:9999/v1/mobile/users/signup -d "{\"email\":\"$EMAIL\", \"name\": \"$NAME\", \"phone\": \"$PHONE\"}" -i
PHONE=+79xxxxxxxxxx
PASS=555xxx
FN=87100001017610xx
FDP=41709130xx
FD=128xx
DERVICEID=curl
DEVICEOS=linux
curl -H "Device-Id: $DERVICEID" -H "Device-OS: $DEVICEOS" "https://$PHONE:[email protected]:9999/v1/inns/*/kkts/*/fss/$FN/tickets/$FD?fiscalSign=$FDP&sendToEmail=no" -i
At the end of last year, the Federal Tax Service rolled out the official Check Check API. Access to the API is given if you write an application, certify with an electronic signature, tell why and how you will use it. We made a Ruby gem if anyone wants to use it.
https://github.com/actie/fnsapi
It makes no sense to try to carry out checks through OFD in gray ways.
Is there a legal API for accessing receipt data for use in your applications/services?
And here you can get Json from OFD by line from qr-code
https://get-ofz-json-from-qr.enzolab.ru
I wrote to the developers of the "FTS application", they said that "in 2 months the check goes to the Archive, and it will not be possible to get its contents YET - there is no such possibility ..."
Regarding the check check itself - they have an algorithm for calculating the FP field , according to which they, even without receiving a check, understand whether it is valid or not ...
state august 2020.
old API proverkacheka.nalog.ru started giving error:
{"update":true,"appstore":"https://apps.apple.com/ru/app/%D0%BF%D1%80%D0%BE%D0%B2%D0%B5%D1%80%D0%BA%D0%B0-%D1%87%D0%B5%D0%BA%D0%BE%D0%B2-%D1%84%D0%BD%D1%81-%D1%80%D0%BE%D1%81%D1%81%D0%B8%D0%B8/id1169353005","playmarket":"https://play.google.com/store/apps/details?id=ru.fns.billchecker","appstorebutton":"Обновить","playmarketbutton":"Обновить","message":"Уважаемый пользователь! \nДоступна новая версия приложения, пожалуйста установите обновление."}
Has anyone encountered error 402 when receiving data from checkcheck.tax.ru?
In general, does the case directly pull information on checks from OFD providers working? Please share your experience
Faced a recent tax api change. They were tied to it. I had to urgently look for an alternative. Found such a service: check check proverkacheka.com The service has its own API. The developers provide it upon request. From communication with them - the service uses different options, including an open API. Alternatively, I recommend. All contacts are on the website.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question