Parameters for generating a receipt

To generate a receipt you need to specify additional parameters in the request to create a payment:

Parameter

Type

Description

customerEmail

string

Payer's Email

customerPhone

number

Payer's phone number in international format without "+"

cashItems

string

Order Items

Obtained by encoding a base64 value in json format. For example:

base64_encode(json_encode([["name" => "Hosting for 1 month", "count" => 1, "price" => 10.00, "type" => "commodity"]]));

It is sufficient to pass cashItems to generate a refund receipt. CustomerEmail or customerPhone are not required

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

The cashItems parameter is formed from:

Parameter

Type

Description

name

string

Item name (required parameter): no more than 128 characters per position

count

number

Quantity (required parameter): the total amount in the receipt can not be more than 100 items

price

number

Price per unit (required parameter)

currency

string

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. Full list of currencies). 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).

vat

string

Amount of VAT rate:

none

vat0

vat10

vat20 vat110 (rate 10/110, applies only to receipts with the payment method characteristics Prepayment, 100% prepayment and Advance vat120 (rate 20/120, applies only to reciepts with the payment method characteristics Prepayment, 100% prepayment and Advance)

type

string

paymentMethod

string

The sign of the payment method: full_payment - full payment (used by default) full_prepayment - 100% prepayment prepayment - advance payment advance - advance payment

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 less than or equal to the product of price*count).

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:

Parameter

Type

Description

markCode

string

Product labeling code in the format required by the Federal Tax Service of Russia (http://www.consultant.ru/document/cons_doc_LAW_362322/a25979352fed3ee44244249284fb21451e8118c5/)

quantity

number

Quantity of items. In total in the check can not be more than 100 items.

measure

number

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;

10 - gram;

11 - kilogram;

12 - ton;

20 - centimeters.

If sold by the unit, the measure always = 0.

If there is one label for one particular item, then quantity = 1 is specified and mark_quantity is not included in the query.

markQuantity

array

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. Example: "mark_quantity":{"numerator":2, "denominator":10}

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:

"Amount of items is more than the cost of the order".

Last updated