Skip to main content

Fiscalization of the self-employed

You can carry out fiscalization separately from the payment — that is, register the payment to the self-employed in the Federal Tax Agency and receive a receipt.

This method is available upon request. To learn more, apply to a Bank 131 manager.

If the receipt was issued by mistake, you can cancel the fiscalization.

How to perform fiscalization

Step 1. Create a payment session

Send the session/create request and obtain the session_id. The request body is empty.

Request example: session creation

curl -X POST \
https://demo.bank131.ru/api/v1/session/create \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: 721af394d5a7aefd0e91f5390abc4d7e20fb2b5784b091fef621f3c61b7abb4b' \
-d '{}'
use Bank131\SDK\API\Request\Builder\RequestBuilderFactory;
use Bank131\SDK\Client;
use Bank131\SDK\Config;

$config = new Config(
'https://demo.bank131.ru',
'your_project_name',
file_get_contents('/path/to/your/private_key.pem')
);

$client = new Client($config);

$request = RequestBuilderFactory::create()
->createPayoutSession()
->build();

$response = $client->session()->create($request);

Step 2. Send the fiscalization request

Create the request through the fiscalization method.

In the session_id parameter, pass the session identifier created in the previous step.

In the ProfessionalIncomeTaxpayer item, enter:

  • into the payer_type field, the legal value (if the payment is sent by a Russian company)
  • into the payer_tax_number field, the Taxpayer Identification Number (INN in Russia) of the company sending the payment (required if payer_type: legal)
  • into the tax_reference field, specify the Taxpayer Identification Number (INN in Russia) of the self-employed
  • into the services field, details for generating a check.

Fiscalization request example

curl --location --request POST 'https://demo.bank131.ru/api/v1/fiscalization' \
--header 'Content-Type: application/json' \
--header 'X-PARTNER-SIGN: sign' \
--header 'X-PARTNER-PROJECT: project' \
--data-raw '{
"session_id": "ps_2704",
"fiscalization_details": {
"professional_income_taxpayer": {
"tax_reference": "123456789012",
"payer_type": "legal",
"payer_tax_number": "3316004777",
"payer_name": "OOO Roga and Kopyta",
"services": [
{
"name": "Goods delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
}
},
{
"name": "Component delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
}
}
]
}
}
}'

Successful response example

    {
"status": "ok",
"session": {
"id": "ps_2704",
"status": "in_progress",
"created_at": "2021-05-27T08:13:33.736384Z",
"updated_at": "2021-05-27T08:13:33.871729Z",
"payments": [
{
"id": "po_2705",
"status": "in_progress",
"created_at": "2021-05-27T08:13:33.860754Z",
"amount_details": {
"amount": 15000,
"currency": "rub"
},
"amounts": {
"gross": {
"amount": 15000,
"currency": "rub"
}
},
"fiscalization_details": {
"professional_income_taxpayer": {
"services": [
{
"name": "Goods delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
},
"quantity": 2
},
{
"name": "Component delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
},
"quantity": 1
}
],
"tax_reference": "123456789012",
"payer_type": "legal",
"payer_tax_number": "3316004777",
"payer_name": "ООО Roga and Kopyta"
}
}
}
]
}
}

Step 3. Wait to be notified of the result

Bank 131 will send you the payment_finished webhook. The body of the webhook will contain all the data that you sent in the request and a link to the receipt from the tax office in the fiscalization_details.receipt parameter.

{
"type": "payment_finished",
"session": {
"id": "ps_2704",
"status": "accepted",
"created_at": "2021-06-08T09:07:34.689353Z",
"updated_at": "2021-06-08T09:07:53.491653Z",
"payments": [
{
"id": "po_23695",
"status": "succeeded",
"created_at": "2021-06-08T09:07:42.591416Z",
"finished_at": "2021-06-08T09:07:53.319963Z",
"amount_details": {
"amount": 15000,
"currency": "rub"
},
"amounts": {
"net": {
"amount": 15000,
"currency": "rub"
},
"gross": {
"amount": 15000,
"currency": "rub"
}
},
"fiscalization_details": {
"professional_income_taxpayer": {
"services": [
{
"name": "Goods delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
},
"quantity": 2
},
{
"name": "Component delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
},
"quantity": 1
}
],
"tax_reference": "645493572846",
"receipt": {
"id": "203zpt6nu5",
"link": "https://himself-ktr.nalog.ru/api/v1/receipt/645493572846/203zpt6nu5/print"
},
"payer_type": "legal",
"payer_tax_number": "3316004790",
"payer_name": "ООО Roga and Kopyta"
}
}
}
]
}
}

How to cancel fiscalization

Occasionally it's necessary to cancel fiscalization and annul the issued check. For example, if the payment failed or the check was issued by mistake.

Send a fiscalization cancelation request

Create a session/refund request. Into the session_id field, enter the session identifier from the fiscalization that you are canceling. In the amount field, specify the entire check amount.

Example of a fiscalization cancelation request

curl -X POST \
https://demo.bank131.ru/api/v1/session/refund \
-H 'content-type: application/json' \
-H 'X-PARTNER-PROJECT: your_project_name' \
-H 'X-PARTNER-SIGN: 6eaf1e9cfa15f011e02c0a126187fe327a71e9d79be5e3fdb3f69dc5dfcd9871' \
-d '{
"session_id":"ps_2704"
}'

Wait for the payment_refunded webhook

Bank 131 will send a payment_refunded webhook with a link to the annulled check.

Upon cancelation of fiscalization, Bank 131 transmits the tax office the reason for cancelation as “The check was generated erroneously.”

Webhook example

{
"type": "payment_refunded",
"session": {
"id": "ps_2704",
"status": "accepted",
"created_at": "2021-06-08T09:07:34.689353Z",
"updated_at": "2021-06-08T09:16:48.624196Z",
"payments": [
{
"id": "po_23695",
"status": "succeeded",
"created_at": "2021-06-08T09:07:42.591416Z",
"finished_at": "2021-06-08T09:07:53.319963Z",
"amount_details": {
"amount": 15000,
"currency": "rub"
},
"amounts": {
"net": {
"amount": 15000,
"currency": "rub"
},
"gross": {
"amount": 15000,
"currency": "rub"
}
},
"fiscalization_details": {
"professional_income_taxpayer": {
"services": [
{
"name": "Goods delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
},
"quantity": 2
},
{
"name": "Component delivery",
"amount_details": {
"amount": 5000,
"currency": "rub"
},
"quantity": 1
}
],
"tax_reference": "645493572846",
"receipt": {
"id": "203zpt6nu5",
"link": "https://himself-ktr.nalog.ru/api/v1/receipt/645493572846/203zpt6nu5/print"
},
"payer_type": "legal",
"payer_tax_number": "3316004790",
"payer_name": "ООО Roga and Kopyta"
}
},
"refunds": [
{
"id": "rf_249",
"status": "accepted",
"created_at": "2021-06-08T09:16:42.897606Z",
"finished_at": "2021-06-08T09:16:48.517040Z",
"amount_details": {
"amount": 15000,
"currency": "rub"
}
}
]
}
]
}
}