Receipts for refunds
If you use the Yandex.Checkout solution for 54-FZ, you must send a refund receipt after a payment is refunded.
 
Refund receipt sent with the refund
Use this method if you send data for generating the receipt using one of the following scenarios: Payment and receipt at the same time or Payment after receipt.
If you make a full refund, you don’t need to transfer data for the receipt. Yandex.Checkout will send the data for registering the receipt to your online sales register as soon as the refund is created .
If you’re making a partial refund, send the information about the returned products in the 
receipt
object when creating a refund .
Example of a request for partial refund with the receipt data
cURL
PHP
Python
curl https://payment.yandex.net/api/v3/refunds \
  -X POST \
  -u <Shop ID>:<Secret Key> \
  -H 'Idempotence-Key: <Idempotence Key>' \
  -H 'Content-Type: application/json' \
  -d '{
        "payment_id": "<Refunded payment's ID>",
        "amount": {
          "value": "600.00",
          "currency": "RUB"
        },
        "receipt": {
          "customer" : {
            "full_name" : "Ivanov Ivan Ivanovich",
            "email" : "email@email.ru",
            "phone" : "79000000000",
            "inn" : "6321000014"
          },
          "items": [
            {
              "description": "Product name 1",
              "quantity": "2.00",
              "amount": {
                "value": "250.00",
                "currency": "RUB"
              },
              "vat_code": "2"
            },
            {
              "description": "Product name 2",
              "quantity": "1.00",
              "amount": {
                "value": "100.00",
                "currency": "RUB"
              },
              "vat_code": "2"
            }
          ]
        }
      }'
As soon as the refund is created, Yandex.Checkout will send the receipt registration data to your online sales register.
 
Refund receipt in a separate request
In the Receipt after payment scenario, you control the process of sending the receipt manually by sending the data for creating them in a separate request.
In this case, the request for creating a refund must be sent without the 
receipt
object. In response to the request containing the 
receipt
object Yandex.Checkout will return an error.
The refund receipt for full or partial refund is created in the same manner as the payment receipt, but instead of the payment ID (
payment_id
) you must specify the refund ID (
refund_id
), as well as the 
refund
value in the 
type
parameter.
Example of request for creating a refund receipt
cURL
PHP
Python
curl https://payment.yandex.net/api/v3/receipts \
 -X POST \
 -u <Shop ID>:<Secret Key> \
 -H 'Idempotence-Key: <Idempotence Key>' \
 -H 'Content-Type: application/json' \
 -d '{
       "customer" : {
         "full_name" : "Ivanov Ivan Ivanovich",
         "email" : "email@email.ru",
         "phone" : "79000000000",
         "inn" : "6321000014"
       },
       "refund_id": "216749f7-0016-50be-b000-078d43a63ae4",
       "type": "refund",
       "send": "true",
       "items": [
         {
           "description": "Product name 1",
           "quantity": "2.00",
           "amount": {
             "value": "250.00",
             "currency": "RUB"
           },
           "vat_code": "2",
           "payment_mode": "full_payment",
           "payment_subject": "commodity",
           "country_of_origin_code": "CN",
         },
         {
           "description": "Product name 2",
           "quantity": "1.00",
           "amount": {
             "value": "100.00",
             "currency": "RUB"
           },
           "vat_code": "2",
           "payment_mode": "full_payment",
           "payment_subject": "commodity",
           "country_of_origin_code": "CN",
         },
       ],
       "settlements": [
         {
           "type": "prepayment",
           "amount": {
             "value": "600.00",
             "currency": "RUB"
           },
         }
       ]
     }'
In response, Yandex.Checkout will send you the receipt object  in its current status.
Example of the response body
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "refund",
  "refund_id": "216749f7-0016-50be-b000-078d43a63ae4",
  "status": "pending",
  "items": [
    {
      "description": "Product name 1",
      "quantity": 2.000,
      "amount": {
        "value": "250.00",
        "currency": "RUB"
      },
      "vat_code": "2",
      "payment_mode": "full_payment",
      "payment_subject": "commodity",
      "country_of_origin_code": "CN"
    },
    {
      "description": "Product name 2",
      "quantity": 1.000,
      "amount": {
        "value": "100.00",
        "currency": "RUB"
      },
      "vat_code": "2",
      "payment_mode": "full_payment",
      "payment_subject": "commodity",
      "country_of_origin_code": "CN"
    }
  ],
  "settlements": [
    {
      "type": "prepayment",
      "amount": {
        "value": "600.00",
        "currency": "RUB"
      }
    }
  ]
}
If the payment that you created the payment receipt for was partially captured or, for some reason, canceled (payment object with the 
canceled
status), you will need to generate the refund receipt independently.
To do that, send a request for creating a refund receipt  to Yandex.Checkout by sending the 
type
parameter with the 
refund
value and the ID of the cancelled or partially captured payment (
payment_id
).
Example of request
cURL
PHP
Python
curl https://payment.yandex.net/api/v3/receipts \
 -X POST \
 -u <Shop ID>:<Secret Key> \
 -H 'Idempotence-Key: <Idempotence Key>' \
 -H 'Content-Type: application/json' \
 -d '{
       "customer" : {
         "full_name" : "Ivanov Ivan Ivanovich",
         "email" : "email@email.ru",
         "phone" : "79000000000",
         "inn" : "6321000014"
       },
       "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
       "type": "refund",
       "send": "true",
       "items": [
         {
           "description": "Product name 1",
           "quantity": "2.00",
           "amount": {
             "value": "250.00",
             "currency": "RUB"
           },
           "vat_code": "2",
           "payment_mode": "full_payment",
           "payment_subject": "commodity",
           "country_of_origin_code": "CN",
         },
         {
           "description": "Product name 2",
           "quantity": "1.00",
           "amount": {
             "value": "100.00",
             "currency": "RUB"
           },
           "vat_code": "2",
           "payment_mode": "full_payment",
           "payment_subject": "commodity",
           "country_of_origin_code": "CN",
         },
       ],
       "settlements": [
         {
           "type": "prepayment",
           "amount": {
             "value": "600.00",
             "currency": "RUB"
           },
         }
       ]
     }'
Example of the response body
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "refund",
  "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f"
  "status": "pending",
  "items": [
    {
      "description": "Product name 1",
      "quantity": 2.000,
      "amount": {
        "value": "250.00",
        "currency": "RUB"
      },
      "vat_code": "2",
      "payment_mode": "full_payment",
      "payment_subject": "commodity",
      "country_of_origin_code": "CN"
    },
    {
      "description": "Product name 2",
      "quantity": 1.000,
      "amount": {
        "value": "100.00",
        "currency": "RUB"
      },
      "vat_code": "2",
      "payment_mode": "full_payment",
      "payment_subject": "commodity",
      "country_of_origin_code": "CN"
    }
  ],
  "settlements": [
    {
      "type": "prepayment",
      "amount": {
        "value": "600.00",
        "currency": "RUB"
      }
    }
  ]
}
 
See also
RefundsPayment processReference for receipt parameter values