# Parameters for generating a receipt

To generate a receipt you need to specify additional parameters in the request to [create a payment](https://help.unitpay.ru/v/master/payments/create-payment):

| **Parameter** | **Type** | **Description**                                                                                                                                                                                                                                                       |
| ------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| customerEmail | string   | Payer's Email                                                                                                                                                                                                                                                         |
| customerPhone | number   | Payer's phone number in international format without "+"                                                                                                                                                                                                              |
| cashItems     | string   | <p><strong>Order Items</strong><br></p><p>Obtained by encoding a base64 value in json format.<br><br>For example:</p><p><code>base64\_encode(json\_encode(\[\["name" => "Hosting for 1 month", "count" => 1, "price" => 10.00, "type" => "commodity"]]));</code> </p> |

{% hint style="info" %}
It is sufficient to pass cashItems to generate a [refund](https://help.unitpay.ru/v/master/payments/payment-refund) receipt. CustomerEmail or customerPhone are not required
{% endhint %}

{% hint style="warning" %}

The **paymentMethod** parameter is optional and can also be set in the checkout settings in the Unitpay personal account. In this case, the priority of the choice will be as follows:

1. Data from the cashItems request to create a payment
2. Data from the checkout settings
3. If items 1 and 2 are not specified, then by default - full\_payment
   {% endhint %}

**The cashItems parameter is formed from:**

| **Parameter** | **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| ------------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| name          | string   | <p>Item name (<em>required parameter</em>): <br><em><strong>no more than 128 characters per position</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| count         | number   | <p>Quantity (required parameter): <br><em><strong>the total amount in the receipt can not be more than 100 items</strong></em></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| price         | number   | Price per unit (*required parameter*)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| currency      | string   | <p>By default it is always RUB (if your goods/services are in rubles, then currency may not be transmitted separately). Currency of the order according to ISO 4217 standard (UAH, BYN, EUR, USD etc. <a href="https://help.unitpay.ru/v/master/book-of-reference/currency-codes">Full list of currencies</a>). <br>The user will always have rubles in the receipt, even if you transmitted a currency other than RUB (conversion takes place on the Unitpay side).</p>                                                                                                                                                                                 |
| vat           | string   | <p><strong>Amount of VAT rate:</strong></p><p>none</p><p>vat0</p><p>vat5</p><p>vat7</p><p>vat10</p><p>vat20<br><br>vat110 (rate 10/110, applies only to receipts with the payment method characteristics Prepayment, 100% prepayment and Advance<br>vat120 (rate 20/120, applies only to reciepts with the payment method characteristics Prepayment, 100% prepayment and Advance)<br>vat105 (rate 5/105, applies only to reciepts with the payment method characteristics Prepayment, 100% prepayment and Advance)<br>vat107 (rate 7/107, applies only to reciepts with the payment method characteristics Prepayment, 100% prepayment and Advance)</p> |
| type          | string   | <p><strong>Position type list:</strong><br><a href="https://help.unitpay.ru/v/master/online-cash-desk/receipt-items"><https://help.unitpay.ru/v/master/online-cash-desk/receipt-items></a></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| paymentMethod | string   | <p><strong>The sign of the payment method:</strong> <br>full\_payment - full payment (<em>used by default</em>) full\_prepayment - 100% prepayment <br>prepayment - advance payment <br>advance - advance payment</p>                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| sum           | number   | sum (optional parameter): required only when using **promotional codes, coupons and discount certificates** (the value is passed to sum after applying the discount on goods, sum must always be equal to the product of price\*count).                                                                                                                                                                                                                                                                                                                                                                                                                  |

{% hint style="info" %}
When selling labeled goods from March 1, 2020, the labeling attribute: **markCode** must be displayed. Additional parameters must be transmitted when generating a receipt for marked goods:
{% endhint %}

|               |          |                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Parameter** | **Type** | **Description**                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| markCode      | string   | <p>Product labeling code in the format required by the Federal Tax Service of Russia<br>(<http://www.consultant.ru/document/cons_doc_LAW_362322/a25979352fed3ee44244249284fb21451e8118c5/>)</p>                                                                                                                                                                                                                                                  |
| quantity      | number   | <p>Quantity of items. <br><strong>In total in the check can not be more than 100 items.</strong></p>                                                                                                                                                                                                                                                                                                                                             |
| measure       | number   | <p>Units of measurement of the calculation item quantity. Can take one of the values: 0 - applies to items of settlement that can be sold by the piece or units; </p><p>10 - gram; </p><p>11 - kilogram; </p><p>12 - ton; </p><p>20 - centimeters. </p><p>If sold by the unit, the measure always = 0. </p><p>If there is one label for one particular item, then quantity = 1 is specified and mark\_quantity is not included in the query.</p> |
| markQuantity  | array    | <p>The volume of items in the marked batch. If a single labeled package contains, for example, 10 units of product and you sell 2 units out of the box, then specify quantity = 1, and in mark\_quantity in the numerator numerator = 2, in the denominator denominator = 10. <br><br>Example: <br>"mark\_quantity":{"numerator":2, "denominator":10}</p>                                                                                        |

{% hint style="info" %}
**Important:**

The order amount (sum) must be greater than or equal to price\*count (from cashItems).

If the amount of the order is more, then the receipt will add an additional title "Adjustment of total".

If the amount of the order is less than price\*count, then when you go to pay by generated link / when initiating such request to API, the response from the server will look like this:<br>

"Amount of items is more than the cost of the order".
{% endhint %}
