Sending receipts
If you’re using the Yandex.Checkout solution for marketplaces, you can create payment receipts, refund receipts, and transaction completion receipts on behalf of the store where the user purchased the product. For that, all stores that you work with must implement the Receipt after payment scenario for sending receipts.
You will need to create a separate payment receipt, refund receipt, and transaction completion receipt for each store.
 
Payment receipt creation
To create a payment receipt, send a request for creating a receipt  to Yandex.Checkout. Make sure to specify
on_behalf_of
with the ID of the store on behalf of which you want to send the receipt,
payment_id
with the ID of the payment you accepted from the user, and
type
with the 
payment
value (payment receipt).
If a user paid for multiple items from several different stores, you will need to create a separate receipt on behalf of each store.
Example of request for creating a 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": {
          "email": "johndoe@yandex.ru",
          "phone": "79000000000"
        },
        "type": "payment",
        "payment_id": "24e89cb0-000f-5000-9000-1de77fa0d6df",
        "on_behalf_of": "123",
        "send": true,
        "items": [
          {
            "description": "Product name 1",
            "quantity": "1.00",
            "amount": {
              "value": "3000.00",
              "currency": "RUB"
            },
            "supplier": {
              "name": "Product name 2",
              "phone": "79000000000",
              "inn": "1000000000"
            },
            "agent_type": "commissioner",
            "vat_code": 2,
            "payment_mode": "full_payment",
            "payment_subject": "commodity",
            "country_of_origin_code": "IT"
          }
        ],
        "tax_system_code": 1,
        "settlements": [
          {
            "type": "cashless",
            "amount": {
              "value": "2000.00",
              "currency": "RUB"
            }
          },
          {
            "type": "postpayment",
            "amount": {
              "value": "1000.00",
              "currency": "RUB"
            }
          }
        ]
      }'
In response, Yandex.Checkout will send you the receipt object  with the current status. In addition to the main parameters, the response will contain
on_behalf_of
with the ID of the store on behalf of which you’re sending the receipt.
Example of receipt object
JSON
{
  "id": "rt-2da5c87d-0384-50e8-a7f3-8d5646dd9e10",
  "type": "payment",
  "payment_id": "24e89cb0-000f-5000-9000-1de77fa0d6df",
  "on_behalf_of": "123",
  "status": "pending",
  "items": [
    {
      "description": "Product name 1",
      "quantity": 1.000,
      "amount": {
        "value": "3000.00",
        "currency": "RUB"
      },
      "supplier": {
        "name": "Product name 2",
        "phone": "79000000000",
        "inn": "1000000000"
      },
      "agent_type": "commissioner",
      "vat_code": "2",
      "payment_mode": "full_payment",
      "payment_subject": "commodity",
      "country_of_origin_code": "IT"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "amount": {
        "value": "2000.00",
        "currency": "RUB"
      }
    },
    {
      "type": "postpayment",
      "amount": {
        "value": "1000.00",
        "currency": "RUB"
      }
    }
  ],
  "tax_system_code": 1
}
 
Refund receipt creation
Refund receipt must be generated in the following cases:
 
Receipt for refunding a successful payment
The refund receipt creation process is identical to the payment receipt creation, but instead of 
payment_id
with the payment ID in the request, you must specify
refund_id
with the refund ID as well as the 
refund
value (refund receipt) in the 
type
parameter.
You will need to generate the refund receipt regardless of which party made the refund, you or the store. To learn of the refunds made by a store, set up incoming notifications for the 
refund.succeeded
event.
 
Receipt for a partial capture or cancellation of a payment
To generate a refund receipt for a canceled or partially captured payment, specify the 
type
parameter with the 
refund
value and
payment_id
with the ID of this payment in the receipt creation  request.
 
Transaction completion receipt creation
When you create a transaction completion receipt, include in the request an additional parameter
on_behalf_of
with the ID of the store that the money is transferred to.
Example of request for creating a transaction completion 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": {
        "email": "johndoe@yandex.ru",
        "phone": "79000000000"
        },
        "payment_id": "24e89cb0-000f-5000-9000-1de77fa0d6df",
        "on_behalf_of": "123",
        "type": "payment",
        "send": "true",
        "items": [
        {
          "description": "Product name 1",
          "quantity": "1.00",
          "amount": {
            "value": "3000.00",
            "currency": "RUB"
          },
          "supplier": {
            "name": "Product name 2",
            "phone": "79000000000",
            "inn": "1000000000"
          },
          "agent_type": "commissioner",
          "vat_code": "2",
          "payment_mode": "full_payment",
          "payment_subject": "commodity",
          "country_of_origin_code": "IT"
        }
        ],
        "settlements": [
        {
          "type": "prepayment",
          "amount": {
            "value": "2000.00",
            "currency": "RUB"
          }
        },
        {
          "type": "cashless",
          "amount": {
            "value": "1000.00",
            "currency": "RUB"
          }
        }
      ]
    }'
In response, Yandex.Checkout will send you the receipt object  with the current status.
Example of the transaction completion receipt object
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "payment",
  "payment_id": "24e89cb0-000f-5000-9000-1de77fa0d6df",
  "on_behalf_of": "123",
  "status": "pending",
  "items": [
    {
      "description": "Product name 1",
      "quantity": 1.000,
      "amount": {
        "value": "3000.00",
        "currency": "RUB"
      },
      "supplier": {
        "name": "Product name 2",
        "phone": "79000000000",
        "inn": "1000000000"
      },
      "agent_type": "commissioner",
      "vat_code": "2",
      "payment_mode": "full_payment",
      "payment_subject": "commodity",
      "country_of_origin_code": "IT"
    }
  ],
  "settlements": [
    {
      "type": "prepayment",
      "amount": {
        "value": "2000.00",
        "currency": "RUB"
      }
    },
    {
      "type": "cashless",
      "amount": {
        "value": "1000.00",
        "currency": "RUB"
      }
    }
  ]
}
 
See also
Payment acceptance for marketplacesPayment refunds for marketplacesPayment by 54-FZ