YooMoney API
Guides
Old versions of the API
Help
Sign up for YooMoney
Submitting data for receipts in accordance with 54-FZ
If you use the YooMoney solution for 54-FZ, you need to create receipts for your marketplace’s remuneration for Safe deal.
 
Specifics
Use the Receipt after payment scenario for submitting receipts in Safe deal.
A receipt must be created for every payment, refunds require a receipt only when you’re returning your remuneration. Information for a receipt must be submitted in a separate request. You can create up to 30 receipts per receipt or refund.
To work with receipts, activate an online sales register in your Merchant Profile and set up submitting data for receipts following this manual.
Processing payments
We recommend submitting data for a receipt after you successfully receive a payment from a customer. The procedure depends on whether you’re processing a one-stage or two-stage payment.
One-stage payment
  1. Create a one-stage payment.
  2. When the payment status changes to succeeded, create an income receipt with the full amount of your remuneration.
Two-stage payment
  1. Create a two-stage payment.
  2. When the payment status changes to waiting_for_capture, create an income receipt with the full amount of your remuneration.
  3. When confirming the payment:
    • If you’re debiting the full amount, you don’t need a new receipt.
    • If you’re only debiting a part of your commission, create two receipts: a refund receipt with the amount of your remuneration paid by the customer and the income receipt with a new amount that you’re confirming.
    • If you’re canceling the payment, create a refund receipt with the full amount of your remuneration.
Refunding payments
A refund receipt is required only if you’re using the Remuneration after the deal is closed scenario and refunding the payment. We recommend submitting data for the receipt right after the refund is successfully processed.
  1. Create a refund (full or partial).
  2. When the refund status changes to succeeded, create a refund receipt with the remuneration amount that’s being returned.
Receipts for payments
When processing the payment, create an income receipt: the request for creating a refund  must contain the payment ID in payment_id, the payment value in the type parameter, and data for receipts with information about your remuneration to be paid to you for conducting the deal.
Example of a request for creating an income receipt
cURL
PHP
Python
curl https://api.yookassa.ru/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": "user@example.com",
          "phone": "7100000000"
        },
        "payment_id": "2855940e-000f-5000-9000-1ef78d597562",
        "type": "payment",
        "send": "true",
        "items": [
          {
            "description": "Service fee",
            "quantity": "1.00",
            "amount": {
              "value": "200.00",
              "currency": "RUB"
            },
            "vat_code": "4",
            "payment_mode": "full_payment",
            "payment_subject": "service"
          }
        ],
        "settlements": [
          {
            "type": "cashless",
            "amount": {
              "value": "200.00",
              "currency": "RUB"
            }
          }
        ]
      }'
YooMoney will send you a receipt object  in its current status in response to the request.
Example of a receipt object
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "payment",
  "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
  "status": "pending",
  "items": [
    {
      "description": "Service fee",
      "quantity": "1.00",
      "amount": {
        "value": "200.00",
        "currency": "RUB"
      },
      "vat_code": "4",
      "payment_mode": "full_payment",
      "payment_subject": "service"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "amount": {
        "value": "200.00",
        "currency": "RUB"
      }
    }
  ]
}
Receipts for partial payment confirmation
Create two receipts for partial payment confirmation:
Step 1. Create a refund receipt for the remuneration amount paid by the customer: the request for creating a receipt  must contain the ID of the payment being confirmed in payment_id, the refund value in the type parameter, and data for receipts with information about the remuneration.
Example of a request for creating a refund receipt for partial payment confirmation
cURL
PHP
Python
curl https://api.yookassa.ru/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": "user@example.com",
          "phone": "7100000000"
        },
        "payment_id": "2855940e-000f-5000-9000-1ef78d597562",
        "type": "refund",
        "send": "true",
        "items": [
          {
            "description": "Service fee",
            "quantity": "1.00",
            "amount": {
              "value": "200.00",
              "currency": "RUB"
            },
            "vat_code": "4",
            "payment_mode": "full_payment",
            "payment_subject": "service"
          }
        ],
        "settlements": [
          {
            "type": "cashless",
            "amount": {
              "value": "200.00",
              "currency": "RUB"
            }
          }
        ]
      }'
YooMoney will send you a receipt object  in its current status in response to the request.
Example of a receipt object
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "payment",
  "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
  "status": "pending",
  "items": [
    {
      "description": "Service fee",
      "quantity": "1.00",
      "amount": {
        "value": "200.00",
        "currency": "RUB"
      },
      "vat_code": "4",
      "payment_mode": "full_payment",
      "payment_subject": "service"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "amount": {
        "value": "200.00",
        "currency": "RUB"
      }
    }
  ]
}
Step 2. Create an income receipt for the remuneration that’s being confirmed: the request for creating a receipt  must contain the ID of the payment being confirmed in payment_id, the payment value in the type parameter, and data for the receipt with information about the new remuneration.
Example of a request for creating an income receipt for partial payment confirmation
cURL
PHP
Python
curl https://api.yookassa.ru/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" : "7100000000"
        },
        "payment_id": "2855940e-000f-5000-9000-1ef78d597562",
        "type": "payment",
        "send": "true",
        "items": [
          {
            "description": "Service fee",
            "quantity": "1.00",
            "amount": {
              "value": "120.00",
              "currency": "RUB"
            },
            "vat_code": "4",
            "payment_mode": "full_payment",
            "payment_subject": "service"
          }
        ],
        "settlements": [
          {
            "type": "cashless",
            "amount": {
              "value": "120.00",
              "currency": "RUB"
            }
          }
        ]
      }'
YooMoney will send you a receipt object  in its current status in response to the request.
Example of a receipt object
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "payment",
  "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
  "status": "pending",
  "items": [
    {
      "description": "Service fee",
      "quantity": "1.00",
      "amount": {
        "value": "120.00",
        "currency": "RUB"
      },
      "vat_code": "4",
      "payment_mode": "full_payment",
      "payment_subject": "service"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "amount": {
        "value": "120.00",
        "currency": "RUB"
      }
    }
  ]
}
Receipts for canceled payments
If the payment is canceled, create a refund receipt: the request for creating a receipt  must contain the ID of the canceled payment in payment_id, the refund value in the type parameter, and data for the receipt with information about your remuneration that’s being returned.
Example of a request for a receipt for a canceled payment
cURL
PHP
Python
curl https://api.yookassa.ru/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": "user@example.com",
          "phone": "7100000000"
        },
        "payment_id": "2855940e-000f-5000-9000-1ef78d597562",
        "type": "refund",
        "send": "true",
        "items": [
          {
            "description": "Service fee",
            "quantity": "1.00",
            "amount": {
              "value": "200.00",
              "currency": "RUB"
            },
            "vat_code": "4",
            "payment_mode": "full_payment",
            "payment_subject": "service"
          }
        ],
        "settlements": [
          {
            "type": "cashless",
            "amount": {
              "value": "200.00",
              "currency": "RUB"
            }
          }
        ]
      }'
YooMoney will send you a receipt object  in its current status in response to the request.
Example of a receipt object
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "refund",
  "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
  "status": "pending",
  "items": [
    {
      "description": "Service fee",
      "quantity": "1.00",
      "amount": {
        "value": "200.00",
        "currency": "RUB"
      },
      "vat_code": "4",
      "payment_mode": "full_payment",
      "payment_subject": "service"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "amount": {
        "value": "200.00",
        "currency": "RUB"
      }
    }
  ]
}
Receipts for refunded payments
Create a refund receipt: the request for creating a receipt  must contain the refund ID in refund_id, the refund value in the type parameter, and information about the part of your remuneration that you’re returning in the data for the receipt.
Example of a request for creating a receipt for a refunded remuneration
cURL
PHP
Python
curl https://api.yookassa.ru/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" : "7100000000"
        },
        "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
        "type": "refund",
        "send": "true",
        "items": [
          {
            "description": "Service fee",
            "quantity": "1.00",
            "amount": {
              "value": "40.00",
              "currency": "RUB"
            },
            "vat_code": "4",
            "payment_mode": "full_payment",
            "payment_subject": "service"
          }
        ],
        "settlements": [
          {
            "type": "cashless",
            "amount": {
              "value": "40.00",
              "currency": "RUB"
            }
          }
        ]
      }'
YooMoney will send you a receipt object  in its current status in response to the request.
Example of a receipt object
JSON
{
  "id": "rt_1da5c87d-0984-50e8-a7f3-8de646dd9ec9",
  "type": "refund",
  "payment_id": "24b94598-000f-5000-9000-1b68e7b15f3f",
  "status": "pending",
  "items": [
    {
      "description": "Service fee",
      "quantity": "1.00",
      "amount": {
        "value": "40.00",
        "currency": "RUB"
      },
      "vat_code": "4",
      "payment_mode": "full_payment",
      "payment_subject": "service"
    }
  ],
  "settlements": [
    {
      "type": "cashless",
      "amount": {
        "value": "40.00",
        "currency": "RUB"
      }
    }
  ]
}
See also