# Testing the service Self-employed
Testing the SMZ service is only possible in sandbox mode. To enable this mode, please contact Support Service (opens new window).
To obtain a specific check status, you must use one of the two test TINs:
| Parameter | Description |
|---|---|
185796979287 | the status is set to SUCCESS when the check is registered. |
058104954632 | the status is set to FAILED when the check is registered. |
# Connecting a self-employed person by TIN
Request Parameters::
| Parameter | Required | Description |
|---|---|---|
inn | Yes | Individual taxpayer identification number. |
callback_url | Yes | URL to which the response will be sent. |
is_sandbox | Yes | Test mode parameter: true;1;yes |
Example Request:
curl --location 'https://api.psp.io/self-employed/v1/tin/bind' \
--header 'MID: 1234' \
--header 'Authorization: Bearer Nwii9xFAfHjAWkk6PPOFUmpheFe123' \
--data '{
"is_sandbox": true,
"inn": "185796979287",
"callback_url": "https://webhook.site/28b30c34-9fbd-4e98-b1b7-e20a999d530b"
}'
If successful, the response will include:
id: the unique request ID.inn: the associated taxpayer ID.
Example Response:
{
"id": "3ab4e73d-a197-4a2f-9b92-69ef07468b04",
"inn": "185796979287"
}
Callback:
PLEASE NOTE!
Please provide the url for sending callbacks in Mandarin in advance!
{
"id": "80cf6b02-795f-486f-a515-562a41a87429",
"inn": "185796979287",
"status": 0,
"message": null
}
Callback Parameters:
| Parameter | Type | Description |
|---|---|---|
| id | uuid | Request ID |
| inn | string | INN |
| status | integer | Status of the response from SMZ, possible options: 0 - success; 1 - completed with an error; 8 - the permanent request to the Federal Tax Service has expired; 408 - timeout error (long wait for a response from the Federal Tax Service) |
| message | string | Error text for statuses: 1, 8, 408 |
# Check State
When calling the status verification method (opens new window) self-employed, you need to pass parameters to the querystring with the results you want to get:
| Query Params | Value | Description |
|---|---|---|
| is_sandbox | true; 1; да; yes | Test mode parameter, you can use any of the listed values |
| state | ACTIVE; NOT_SELF_EMPLOYEE | SMZ status, you can specify any of this list (opens new window) |
Example Request:
curl --location 'https://api.psp.io/self-employed/v1/tin/185796979287?is_sandbox=true&state=ACTIVE' \
--header 'MID: 1234' \
--header 'Authorization: Bearer Nwii9xFAfHjAWkk6PPOFUmpheFe123'
Example Response:
{
"id": "test-d4dc85c1-765a-4865-bea6-01b215a333ed",
"inn": "185796979287",
"status": "ACTIVE"
}
# Creating a test receipt
Request Parameters::
| Parameter | Obligatory | Description |
|---|---|---|
inn | Yes | The TIN (taxpayer identification number) associated with the check. |
price | Yes | The price of the product/service |
title | Yes | The name of the product/service in the check |
is_sandbox | Yes | Test mode parameter: true;1;yes |
Example Request:
curl --location 'https://api.psp.io/self-employed/v1/receipts' \
--header 'MID: 1234' \
--header 'Authorization: Bearer Nwii9xFAfHjAWkk6PPOFUmpheFe123' \
--data '{
"is_sandbox": true,
"inn": "185796979287",
"price": 100,
"title": "Order payment №1234"
}'
Response with test TIN 185796979287:
{
"cheque_id": "20172zyc8z",
"inn": "185796979287",
"message": "",
"session_id": "edccadd7-e5f9-4de2-8088-64e6adf0959b",
"status": "success",
"url": "https://lknpd.nalog.ru/api/v1/receipt/623406197779/20172zyc8z/print",
"title": "Order payment №1234"
}
Response with test TIN 058104954632:
{
"cheque_id": null,
"inn": "058104954632",
"message": "Inactive TIN 058104954632 failed/ACTIVE",
"session_id": "edccadd7-e5f9-4de2-8088-64e6adf0959b",
"status": "failed",
"url": null,
"title": "Order payment №1234"
}
Response Parameters:
cheque_id- unique identifier of the created cheque.inn- INN associated with the cheque.message- additional information or error message.session_id- id of the created cheque.status- status of the request, see the list of statuses below.url- URL for printing the created cheque.title- Title of the product/service specified in the request.
Status list:
| Status | Description |
|---|---|
| success | The check was successfully created |
| failed | Failed to create the check. The error details can be found in the response (message). |