Introduction

What is cash (fiscal) receipt?

Cash or fiscal receipt is a primary accounting document that reflects the fact of mutual settlement between the store and the buyer and confirms that the buyer has deposited funds, and the store has transferred the goods or rendered the service to him.

In addition, the receipts contain information for the tax authorities about the amount of profit that the store received for a particular period of its financial activity.

Practically every store that sells online is obliged to form a receipt in accordance with Federal Law No. 54, since failure to provide a receipt entails the imposition of a fine by the tax authorities.

What is an online cash register?
The receipt is generated and registered using a special device - an online cash register, each store is obliged to purchase and connect an online cash register to its trading platform.

An online cash register is a cash register equipment (CRE) that is connected to the Internet. There are two types of online cash registers:

In the form of a portable PC that can be bought and installed in the office or at the point of sale
In the form of a cloud solution, in this case, the cash register will not be located with you, but in the provider's data center

What is the role of Paybox?
Paybox is not an online cash register, but it is integrated with various online cash registers and services in the Russian Federation and is able to send them data for registering cash receipts at the time of payment.

What you need to do to send receipts via Paybox service?
In order to use the Paybox service for sending data for receipt registration, you need to follow several steps:

1. Connect Paybox service

If you are not already our client.

2. Purchase an online cash register

Buy or rent an online cash register from one of our technology partners

3. Link the online cash register and Paybox service

Go through the procedure of connecting your online cash register to Paybox service in the store's personal account.

4. Set up sending data for the receipt registration on the side of your store

If you want to use our API, you need to read the documentation at this link.
If you use a ready-made CMS, check out the list of our modules that support the functionality for sending receipts.
The functionality of sending receipts when working with the store's personal account, as well as in CMS modules, is currently under development.

Which technology partners does Paybox service work with?
  • Атол Online*
* Services not listed are under development.

What features are there in our API?
By connecting to our API, you can:

  • send data for registering receipts to the online cash register in accordance with the requirements for the fiscal data format FDF 1.05 and FDF 1.2;
  • generate receipts at the time of payments and refunds, including when performing two-stage payments;
  • generate prepayment, advance payment or credit receipts, as well as prepayment offset receipts (final settlement or sale)
  • independently generate receipts after making payments and refunds;
  • receive data on individual store receipts generated using Paybox service;
  • upload a list of receipts by applying the necessary filters.

Existing methods of generating receipts

1. Receipt with payment

This method of generating receipts is suitable for most stores that want to automate this procedure as much as possible.

How to transfer data to Paybox service:

  • to generate a receipt (sale), it is necessary to send the pg_receipt object at the time of executing the request to create a payment (inside the payment body)
  • to generate a receipt for the return of a receipt (refund), you must send the pg_receipt object at the time of executing the request to create a partial refund (inside the refund body)
Paybox service will send a receipt to the online cash register immediately after the successful completion of the payment/return.

If for whatever reason the receipt is not registered, you can register it using your online cash register or try to resend this receipt using the Paybox API.

Since Paybox service sends the receipt to the online cash register only after a successful payment/refund payment transaction, an error when registering the receipt will not affect the main transaction in any way, the payment or refund will still be executed.

To connect this method in your Paybox personal account, in the Settings → Online cash register → 2. Setup → Receipt generation method, select the Receipt mode together with the payment.

2. Receipt is separate from the payment

This method is suitable for stores that have the status of an agent (marketplaces) and want to independently manage the sending of receipts using the Paybox API.

Using this method, you can create several receipts for payment or refund.

This method is mandatory for those who use the Payment Splitting functionality.

How to transfer data to Paybox service:

  • to generate a receipt (sale), you need to send a separate request to create a receipt after the payment is successfully completed;
  • to generate a receipt for the return (refund), it is necessary to send a separate request to create a receipt after the refund is successfully completed;
When choosing this method, a request to create a payment or refund must be sent without the pg_receipt object. If the pg_receipt object is passed in these requests, Paybox will ignore it.

Paybox will immediately send your online cash register the details for registering the receipt, and will return the receipt object to you in response to the request. An error when registering a receipt will not affect the payment or refund in any way.

To enable this method in the Paybox personal account, in the Settings → Online cash register → 2 Settings → Receipt generation method, select the Receipt mode separately from the payment.
Necessary steps for integration
  1. Connect an online cash register, which is included in the list of our technology partners.
  2. Conclude an agreement with the fiscal data operator, do not forget to activate the service of sending receipts to the buyer’s email.
  3. Make the settings in the "Online cash register" section of your Paybox personal account:
  • Open the Settings section on the left panel of the main menu and go to the Online cash register tab (fig.1).
  • In the Select store field, select the store to which you want to connect your online cash register (fig. 2).
  • In step No. 1, Select an online cash register, in the Your cash register field, select the name of your cash register (fig. 2).
  • In the FDF Version field, select the version of the fiscal document format that your online cash register supports (fig. 2), if you have any difficulties with determining the FDF version, contact your online cash register provider for advice.
  • Click the Go to settings button (fig. 2), after which step No. 2 Settings will open
  • In the Connection parameters section, enter the data that you received in the personal account of your online cash register, the set of parameters may differ depending on the online cash register used (fig. 3).
  • In the Taxation system (TS) section, go to the field, Select the default TS and indicate your taxation system, the selected taxation system will be displayed in the buyer’s receipt (fig. 3).
  • Go to the Other settings section and enter the email address of your store in the Mail of the sender of the receipt field, which will be displayed in the buyer's receipt (fig. 4)
  • Enter the email address to which we will send a notification letter in the Mail for errors field, if Paybox is unable to register the receipt (fig. 4).
  • In the Payment acceptance location field, enter information about where exactly you accept payments (for example, the email address of your online store). If you also accept payments at a physical point of sale, then its address must be entered in this field separated by commas. The information entered in this field will also be displayed in the buyer's receipt (fig. 4)
  • Enter in the TIN field the taxpayer identification number to which your online cash register was registered (fig. 4)
  • In the Receipt generation method field, select from the drop-down list the method by which you will send receipts to the online cash register (fig. 4)
  • You need to click the Verify connection button, after which Paybox will try to connect to your online cash register. If all the fields in the Connection parameters section have been filled in with the correct data, Paybox will display a message about a successful connection. If the attempt to connect to the online cash register failed, it is necessary to adjust the connection parameters and perform the check again (fig. 4)
  • To complete the online cash register setup, click the Enable online cash register button (fig. 4)*
  • That's it, all 3 setup steps are completed and you can start sending receipts (fig. 5).
4.Configure the sending of receipts from your store:
  • If you are integrating via the API, add the parameters for the receipt (names of goods, their prices, VAT rate, information about the buyer, signs of the method and subject of payment, etc.) to the requests for creating a payment/refund. Click here for more information.
  • If you use a CMS and connected Paybox via a payment module, update the module, go to its settings and enable data transmission under 54-FL there — for more information, see the instructions for your module. If there is no such setting in the payment module, write to the Paybox support service.
*If, as a result of checking the connection, Paybox could not connect to your online cash register, then even when you click the Enable online cash register button, sending receipts will not work.

If you want to make any changes to the online cash register settings that are not related to the connection parameters, then you need to open the Settings section on the left panel of the main menu, and go to the Online cash register tab, and then click the Disable online cash register button (fig. 5). After making changes, you must enable the online cash register, otherwise Paybox will not send receipts.

Рисунок 1
Рисунок 2
Рисунок 3
Рисунок 4
Рисунок 5
Receipts for payments
Common script
  1. Choose the method of generating the receipt
  2. Generate a receipt in the payment initialization request or in a separate request, depending on the selected method.
  3. If the receipt contained goods with prepayment, then when issuing them, generate a receipt to offset the prepayment
Receipt together with the payment
If you have chosen the method of sending receipts Receipt together with the payment, the data for generating the receipt must be transmitted in the following scenarios:
  • during initialization, in case of making a payment in one step (request for init_payment.php** with the parameter pg_auto_clearing=1)
  • during initialization, in case of payment in two stages (request for init_payment.php** with the parameter pg_auto_clearing=0)
  • for partial payment clearing, in case of two-stage payment (request for do_capture.php)

Making payment
To generate a receipt, it is necessary to pass the pg_receipt object in the request along with the data for initializing the payment.

Example of a request to initialize a payment with parameters for a receipt


curl --location --request POST 'https://api.freedompay.uz/init_payment.php' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data-raw \
'{
  "pg_order_id": "3552",
  "pg_merchant_id": 542088,
  "pg_amount": 200.00,
  "pg_description": "Заказ №052641",
  "pg_auto_clearing": 1,
  "pg_salt": "default",
  "pg_receipt": {
    "receipt_format": "ru_1_05",
    "customer": {
      "email": "[email protected]"
    },
    "positions": [
      {
        "price": 50.00,
        "name": "Товар №1",
        "quantity": 2.00,
        "vat_code": "vat_20",
        "payment_method": "full_payment",
        "payment_object": "goods"
      },
      {
        "price": 100.00,
        "name": "Товар №2",
        "quantity": 1.00,
        "vat_code": "vat_20",
        "payment_method": "full_payment",
        "payment_object": "goods"
      }
    ]
  },
  "pg_sig": "{{Ваша подпись запроса}}"
}'

In response, Paybox will return the payment object.

<?xmlversion="1.0"encoding="utf-8"?>
<response>
    <pg_status>ok</pg_status>
    <pg_payment_id>771889578</pg_payment_id>
    <pg_redirect_url>https://freedompay.uz/pay.html?customer=8f613c0d0e874e40247c7b4d20d7b10e</pg_redirect_url>
    <pg_redirect_url_type>needdata</pg_redirect_url_type>
    <pg_salt>v0MKA0IJS8GhHwfr</pg_salt>
    <pg_sig>{{Ваша подпись запроса}}</pg_sig>
</response>

If the payment is completed successfully, a receipt with the name "Receipt" will appear in the merchant's personal account when clicking on the payment and going to the Payment receipts tab. Also, this receipt will be available in the Receipts section located** on the left panel of the main menu.

Partial payment clearing

If you accept payment in two stages, then two new receipts will be generated during partial clearing of the payment:

  • Receipt No. 1 - return receipt for the full amount, with the goods that were present in the receipt formed as a result of the first stage of payment (blocking of funds)
  • Receipt No. 2 - new receipt, with those goods that were sold in fact, as a result of the second stage - clearing transactions
You need to generate Receipt No. 2, and along with the payment clearing data, pass the pg_receipt object, which includes the adjusted product items, in the do_capture.php request.

There is no need to transfer receipt No. 1, Paybox will generate it automatically.

Example of a partial payment clearing request


curl--location--requestPOST'https://api.freedompay.uz/do_capture.php' \
--header'Content-Type: application/json' \
--data-raw \
'{
  "pg_merchant_id": 542088,
  "pg_payment_id": 764197452,
  "pg_clearing_amount": 100,
  "pg_salt": "default",
  "pg_receipt": {
    "receipt_format": "ru_1_05",
    "customer": {
      "email": "[email protected]"
    },
    "positions": [
      {
        "price": 50.00,
        "name": "Товар№1",
        "quantity": 2.00,
        "vat_code": "vat_20",
        "payment_method": "full_payment",
        "payment_object": "goods"
      }
    ]
  },
  "pg_sig": "{{Ваша подпись запроса}}"
}'

If you perform full clearing of the payment (for the entire amount), then you do not need to send data for the receipt, since the set of commodity items has not changed after the first stage.

If you cancel the payment before clearing (request for cancel.php) it is also not necessary to transmit data for the receipt, Paybox will generate an automatic return receipt as soon as the transaction status changes to revoked.

If partial clearing is completed successfully, 3 receipts will appear in the merchant's personal account when clicking on the payment and going to the Payment receipts tab:

  • Receipt with initial goods, formed as a result of the first stage of payment
  • Return receipt generated as a result of partial clearing
  • Receipt containing adjusted goods, also generated as a result of partial clearing
All these receipts will be available in the Receipts section.

Receipt separately from payment
If you have chosen the method of sending receipts, the Receipt is separate from the payment, then you yourself control the process of creating receipts.

Data for generating the receipt must always be transmitted in a separate request, immediately after you have made sure that the payment was completed successfully (the pg_transaction_status parameter is equal to ok).

In this case, when sending a payment initialization request, you do not need to pass the pg_receipt object in the request body.

Principle of creating a receipt
When making a payment, you must perform the following sequence of actions:

  1. Send a request for payment initialization;
  2. Save the payment ID pg_payment_id received in the response from Paybox;
  3. Make a request to receive the payment status and make sure that the payment was completed successfully;
  4. Send a request to create a receipt, while passing the payment_id parameter in the request body, the value of which will be the payment ID received from Paybox in step No. 2. It is also necessary to pass the type of cash transaction operation_type equal to sell, and other parameters required for creating a receipt.
Example of a request to create a receipt separately from the payment


curl --location --request POST 'https://api.freedompay.uz/v5/receipts' \
--header'Accept: application/json' \
--header'X-JWS-Signature:{{Ваш JWS-токен}}' \
--header'Content-Type: application/json' \
--data-raw \
'{
  "receipt_format": "ru_1_05",
  "merchant_id": 542088,
  "payment_id": 764239789,
  "operation_type": "sell",
  "customer": {
    "email": "[email protected]"
  },
  "positions": [
    {
      "price": 50.00,
      "name": "Товар№1",
      "quantity": 2.00,
      "vat_code": "vat_20",
      "payment_method": "full_payment",
      "payment_object": "goods"
    },
    {
      "price": 100.00,
      "name": "Товра№2",
      "quantity": 1.00,
      "vat_code": "vat_20",
      "payment_method": "full_payment",
      "payment_object": "goods"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "sum": 200.00
    }
  ]
}'

In the response, Paybox will return the object of your receipt

Example of the response body

{
    "data": {
        "merchant_id": "542088",
        "receipt_id": "bb938d6c-6c1c-44a0-aa54-32c3e14fddb7",
        "operation_type": "sell",
        "receipt_format": "ru_1_05",
        "status": "registered",
        "fiscal_document_number": 10605,
        "fiscal_storage_number": "9999078900006286",
        "fiscal_attribute": 923085333,
        "registered_at": "29.03.202317:37:00",
        "created_at": "29.03.202320:39:16",
        "fiscal_provider_id": "5e402526-0c20-41c3-b30a-b52e7f903922",
        "positions": [
            {
                "name": "Товар №1",
                "quantity": 2,
                "price": 50,
                "vat_code": "vat_20",
                "payment_method": "full_payment",
                "payment_object": "goods",
                "sum": 100
            },
            {
                "name": "Товар №2",
                "quantity": 1,
                "price": 100,
                "vat_code": "vat_20",
                "payment_method": "full_payment",
                "payment_object": "goods",
                "sum": 100
            }
        ],
        "total": 200,
        "settlements": [
            {
                "type": "cashless",
                "sum": 200
            }
        ],
        "company": {
            "inn": "5544332219",
            "email": "[email protected]",
            "tax_system": "osn",
            "payment_address": "shop.ru"
        },
        "receipt_method": "separately",
        "error": null,
        "link": "https://consumer.1-ofd-test.ru/v1?fn=9999078900006286&fp=923085333&i=10605&t=20230329T173700&s=7&n=2",
        "payment_id": "764239789"
    }
}

Receipt created by a separate request will be displayed in the store's personal account under the name "Linked receipt", where the word "Linked" will indicate that this receipt was created separately from the payment.

Partial payment clearing
If you accept payment in two stages, then after the successful completion of the partial clearing, you need to generate two new receipts yourself:

  • Receipt No. 1 - return receipt for the full amount, with the goods that were present in the receipt formed as a result of the first stage of payment (blocking of funds)
  • Receipt No. 2 - new receipt, with goods that were sold in fact, as a result of the second stage - clearing transactions
In this case, a request for partial clearing do_capture.php it must be sent without the pg_receipt object.

If you have completed the full clearing of the payment (for the entire amount), then you do not need to create another receipt.

The following describes the sequence of actions that must be performed to create the above-described receipt No. 1 and receipt No. 2:

  1. Send a request for partial payment clearing;
  2. Make a request to receive the payment status and make sure that the clearing on it was completed successfully;
  3. Send a request to create a receipt for the return, at the same time, pass the refund_id parameter in the request body, the value of which will be the payment identifier. It is also necessary to pass the type of cash transaction operation_type equal to sell_refund, and other parameters required for creating a receipt.
  4. Send a request to create a receipt, at the same time, pass the payment_id parameter in the request body, the value of which will be the payment ID. It is also necessary to pass the type of cash transaction operation_type equal to sell, and other parameters required for creating a receipt.
3.4. Creating a prepayment offset receipt (final settlement or sale)

The formation of a prepayment offset receipt depends on what type of product you sell in your store.

If you do not have a long time interval between the receipt of payment and the actual transfer of the goods to the buyer, then a prepayment offset receipt is not needed. You accept the payment, form a receipt and immediately provide the goods to the buyer.

An example is the sale of software licenses, movies in an online cinema, or taxi services.

Everything changes dramatically when you accept the payment, and the goods themselves will be handed over to the buyer the next day or even a few days later (for example, by courier). In this situation, the buyer has already paid for the goods on the website, but the actual one does not yet have his hands, so in this case, you need to generate 2 receipts:

  1. Receipt - at the time of payment acceptance on the website. At the same time, all products in the generated receipt must have a payment method attribute with one of the following values: "Prepayment", "100% prepayment" or Advance payment
  2. Prepayment offset receipt is issued immediately after the transfer of the goods to the buyer. All goods in this receipt must contain the "Full settlement" payment method attribute, and objects with the sum of all previously made settlements must be transferred in the settlements array.
To generate a prepayment offset receipt, you need to send a separate request to create a receipt (using the Receipt method separately from the payment) and add a special offset parameter equal to true to the request body* At the same time, the method of sending the receipt does not depend on the method that is enabled in your personal account. Therefore, if you want to generate a prepayment offset receipt using the Receipt method separately from the payment, but at the same time you have another method enabled in the online cash register settings, then you do not need to make changes to the settings.

*If you do not pass this parameter, Paybox will not be able to create a prepayment offset receipt.

Example of a request to create a prepayment offset receipt

curl --location --request POST 'https://api.freedompay.uz/v5/receipts' \
--header'Accept: application/json' \
--header'X-JWS-Signature:{{Ваш JWS-токен}}' \
--header'Content-Type: application/json' \
--data-raw \
'{
  "receipt_format": "ru_1_05",
  "merchant_id": 542088,
  "payment_id": 754810596,
  "offset": true,
  "operation_type": "sell",
  "customer": {
    "email": "[email protected]"
  },
  "positions": [
    {
      "price": 200.00,
      "name": "Товар№1",
      "quantity": 1.00,
      "vat_code": "vat_20",
      "payment_method": "full_payment",
      "payment_object": "goods"
    }
  ],
  "settlements": [
    {
      "type": "prepayment",
      "sum": 200.00
    }
  ]
}'

In the response, Paybox will return the object of your receipt

{
    "data": {
        "merchant_id": "542088",
        "receipt_id": "bb938d6c-6c1c-44a0-aa54-32c3e14fddb7",
        "operation_type": "sell",
        "receipt_format": "ru_1_05",
        "status": "registered",
        "fiscal_document_number": 10605,
        "fiscal_storage_number": "9999078900006286",
        "fiscal_attribute": 923085333,
        "registered_at": "29.03.202317:37:00",
        "created_at": "29.03.202320:39:16",
        "fiscal_provider_id": "5e402526-0c20-41c3-b30a-b52e7f903922",
        "positions": [
            {
                "name": "Товар №1",
                "quantity": 1,
                "price": 200,
                "vat_code": "vat_20",
                "payment_method": "full_payment",
                "payment_object": "goods",
                "sum": 200
            }
        ],
        "total": 200,
        "settlements": [
            {
                "type": "prepayment",
                "sum": 200
            }
        ],
        "company": {
            "inn": "5544332219",
            "email": "[email protected]",
            "tax_system": "osn",
            "payment_address": "shop.ru"
        },
        "receipt_method": "separately",
        "error": null,
        "link": "https://consumer.1-ofd-test.ru/v1?fn=9999078900006286&fp=923085333&i=10605&t=20230329T173700&s=7&n=2",
        "payment_id": "754810596"
    }
}

A brief guide to preparing data for the receipt
Check that you are correctly transmitting the data for receipts in the pg_receipt object:

  • if you are generating a receipt along with a payment, check that the pg_receipt object is present only in those requests where it is really needed;
  • all required parameters have been passed;
  • the parameter values have the correct format;
  • the receipt contains no more than 100 goods;
  • the payment amount in pg_amount coincides with the total amount of the receipt in pg_receipt (to determine the amount of the receipt, multiply quantity by price for each product and sum up the resulting values for all goods);
  • the amount of partial clearing in pg_clearing_amount coincides with the total amount of the receipt in pg_receipt (to determine the amount of the receipt, multiply quantity by price for each product and sum up the resulting values for all goods);
  • amount
  • all amounts in the receipt are positive.


Receipts for refunds
Return receipt together with the refund
If you have chosen the method of sending receipts Receipt together with the payment, the data for the formation of the return receipt must be transmitted only when performing a partial refund (request for revoke.php ).

To generate a return receipt, it is necessary to pass the pg_receipt object in the request together with the data for a partial refund of the payment.

Example of a partial refund request with parameters for a refund receipt


curl --location --request POST 'https://api.freedompay.uz/revoke.php' \
--header 'Content-Type: application/json' \
--data-raw \
'{
  "pg_merchant_id": 542088,
  "pg_payment_id": 764197452,
  "pg_refund_amount": 100,
  "pg_salt": "default",
  "pg_receipt": {
    "receipt_format": "ru_1_05",
    "customer": {
      "email": "[email protected]"
    },
    "positions": [
      {
        "price": 100.00,
        "name": "Товар №1",
        "quantity": 1.00,
        "vat_code": "vat_20",
        "payment_method": "full_payment",
        "payment_object": "goods"
      }
    ]
  },
  "pg_sig": "{{Ваша подпись запроса}}"
}'

If you make a full refund, you do not need to transmit the data for the receipt, Paybox will generate a refund receipt automatically as soon as the transaction status changes to refunded.

If you are making a two-stage payment and after the completion of the partial clearing transaction, you want to fully refund the debited amount, then such a refund will be considered partial, not full, so when you make a refund of the debited amount, you need to pass the pg_receipt object

If the refund is completed successfully, in the store's personal account, when you click on the refund and go to the Payment receipts tab, a receipt called "Return receipt" will appear. This receipt will also be available in the **Receipts section located on the left panel of the main menu.

Return receipt separately from the return
If you have chosen the method of sending receipts, the Receipt is separate from the payment, then you yourself control the process of creating return receipts.

Data for generating a return receipt must always be transmitted in a separate request, immediately after you have made sure that the refund was completed successfully (the pg_transaction_status parameter is equal to the refunded value).

In this case, when sending a refund request, you do not need to pass the pg_receipt object in the request body.

When making a full and partial refund, you must perform the following sequence of actions:

  1. Send a refund request;
  2. Save the return ID pg_revoke_payment_id received in the response;
  3. Make a request to receive the payment status and make sure that the refund is completed successfully;
  4. Send a request to create a return receipt, while in the request body pass the refund_id parameter, the value of which will be the return ID received from Paybox in step No. 2. It is also necessary to pass the type of cash transaction operation_type equal to sell_refund, and other parameters required for creating a receipt.
Example of a request to create a return receipt separately from the return


curl --location --request POST 'https://api.freedompay.uz/v5/receipts' \
--header 'Accept: application/json' \
--header 'X-JWS-Signature:{{Ваш JWS-токен}}' \
--header 'Content-Type: application/json' \
--data-raw \
'{
  "receipt_format": "ru_1_05",
  "merchant_id": 542088,
  "refund_id": 764266262,
  "operation_type": "sell_refund",
  "customer": {
    "email": "[email protected]"
  },
  "positions": [
    {
      "price": 50.00,
      "name": "Товар №1",
      "quantity": 2.00,
      "vat_code": "vat_20",
      "payment_method": "full_payment",
      "payment_object": "goods"
    },
    {
      "price": 100.00,
      "name": "Товар №2",
      "quantity": 1.00,
      "vat_code": "vat_20",
      "payment_method": "full_payment",
      "payment_object": "goods"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "sum": 200.00
    }
  ]
}'

Example of the response body

{
    "data": {
        "merchant_id": "542088",
        "receipt_id": "bb938d6c-6c1c-44a0-aa54-32c3e14fddb7",
        "operation_type": "sell_refund",
        "receipt_format": "ru_1_05",
        "status": "registered",
        "fiscal_document_number": 10605,
        "fiscal_storage_number": "9999078900006286",
        "fiscal_attribute": 923085333,
        "registered_at": "29.03.202317:37:00",
        "created_at": "29.03.202320:39:16",
        "fiscal_provider_id": "5e402526-0c20-41c3-b30a-b52e7f903922",
        "positions": [
            {
                "name": "Товар №1",
                "quantity": 2,
                "price": 50,
                "vat_code": "vat_20",
                "payment_method": "full_payment",
                "payment_object": "goods",
                "sum": 100
            },
            {
                "name": "Товар №2",
                "quantity": 1,
                "price": 100,
                "vat_code": "vat_20",
                "payment_method": "full_payment",
                "payment_object": "goods",
                "sum": 100
            }
        ],
        "total": 200,
        "settlements": [
            {
                "type": "cashless",
                "sum": 200
            }
        ],
        "company": {
            "inn": "5544332219",
            "email": "[email protected]",
            "tax_system": "osn",
            "payment_address": "shop.ru"
        },
        "receipt_method": "separately",
        "error": null,
        "link": "https://consumer.1-ofd-test.ru/v1?fn=9999078900006286&fp=923085333&i=10605&t=20230329T173700&s=7&n=2",
        "refund_id": "764266262"
    }
}

Return receipt created by a separate request will be displayed in the store's personal account under the name "Linked return receipt", where the word "Linked" will indicate that this receipt was created separately from the refund.

If a partial clearing was performed for a payment for which you previously created a receipt, or for some reason you were forced to cancel it (a payment with the revoked status), you need to generate a return receipt yourself.

When canceling a payment, you must perform the following sequence of actions:
  1. Send a request to cancel a payment;
  2. Save the cancellation ID received in the response pg_cancel_payment_id;
  3. Make a request to receive the payment status and make sure that the cancellation is completed successfully;
  4. Send a request to create a return receipt, at the same time, pass the refund_id parameter in the request body, the value of which will be the cancellation ID received from Paybox in step No. 2. It is also necessary to pass the type of cash transaction operation_type equal to sell_refund, and other parameters required for creating a receipt.
A brief guide to preparing data for the receipt
Check that you are correctly transmitting the data for receipts in the pg_receipt object:

  • if you are generating a return receipt together with a refund, check that the pg_receipt object is present only in the request for a partial refund;
  • all required parameters have been passed;
  • the parameter values have the correct format;
  • the quantity of the goods does not exceed the quantity that was indicated in the receipt;
  • the refund amount in pg_refund_amount coincides with the total amount of the receipt in pg_receipt (to determine the amount of the receipt, multiply quantity by price for each product and sum up the resulting values for all goods);
  • all amounts in the receipt are positive.
Reference of values
This section provides values for parameters that are present in the pg_receipt object, as well as in the request to create a receipt:

  • Receipt format
  • Type of transaction
  • Taxation system
  • Document type code
  • VAT tax rates
  • Indication of the subject of calculation
  • Indication of the calculation method
  • Measure of the quantity of the subject of calculation
  • Type of calculation
  • Indication of the agent for the subject of calculation
  • ID of the Federal agencies of executive authority
The format of the receipt is passed in the receipt_format parameter. Possible values:

Taxation system (TS)
Taxation system is passed in the tax_system parameter. Possible values:
Document type code

Document type code is passed in the document_code parameter. Possible values:


Identity documents of citizens of the Russian Federation


Identity documents of foreign citizens or stateless persons
**VAT tax rates**
VAT tax rate is transmitted in the positions.vat_code array. Possible values:
Indication of the subject of calculation
Indication of the subject of calculation is transmitted in the positions.payment_object array. Possible values:
**Available starting from FDF 1.05
Available starting from FDF 1.2
Indication of the calculation method
Indication of the method of calculation is transmitted in the positions.payment_method array. Possible values:
Measure of the quantity of the subject of calculation
The measure of the quantity of the calculation object is passed in the positions.measure array. Possible values:

Type of calculation
The calculation type is passed in the settlements.type array. Possible values:

Indication of the agent for the subject of calculation
Indication of the agent for the subject of calculation is passed in the array positions.agent_type. Possible values:

ID of the Federal agencies of executive authority
ID of the Federal agencies of executive authority is passed in payment_object_industry_details.federal_id array and receipt_industry_details.federal_id array. Possible values are from 001 to 072.