...
Параметр | Тип | Назначение | Обязательный | Ограничения | Пример | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
code | String | Код товара | Нет | - | 1000000000021 | ||||||||||||||||||||||||||||
name | String | Наименование товара | Да | - | Марципан | ||||||||||||||||||||||||||||
price | Number | Цена за единицу | Да | >=0 | 145.00 | ||||||||||||||||||||||||||||
unit | String | Единица измерения | Да | Один из:
| piece | ||||||||||||||||||||||||||||
quantity | Number | Количество единиц | Да | >0 | 2, 3.5 | ||||||||||||||||||||||||||||
sum | Number | Цена | Да | >=0 | 249.50 | ||||||||||||||||||||||||||||
vat_mode | String | Тип НДС | Да | Один из:
| vat18 | ||||||||||||||||||||||||||||
vat_amount | Number | Размер НДС | Нет | >0 | 52.22 | ||||||||||||||||||||||||||||
discount_rate | Number | Скидка в процентах | Нет | >0 | 5.0 | ||||||||||||||||||||||||||||
discount_amount | Number | Скидка в рублях (вкл. в стоимость) | Нет | >0 | 25.3 | ||||||||||||||||||||||||||||
payment_method | String | Признак способа расчёта | Нет | Один из:
| |||||||||||||||||||||||||||||
payment_object | String | Признак предмета расчёта | Нет | Один из:
|
Листинг 1. JSON-схема поля invoice_data
Блок кода | ||
---|---|---|
| ||
{ "$schema": "http://json-schema.org/draft-04/schema#", "title": "Invoice data", "type": "object", "required": [ "items" ], "additionalProperties": false, "properties": { "items": { "type": "array", "minItems": 1, "maxItems": 100, "items": { "type": "object", "required": [ "name", "price", "unit", "quantity", "sum", "vat_mode" ], "additionalProperties": false, "properties": { "code": { "type": "string" }, "name": { "type": "string" }, "price": { "type": "number", "minimum": 0 }, "unit": { "enum": [ "piece", "service", "package", "g", "kg", "t", "ml", "l", "m3", "hr", "m", "km" ] }, "quantity": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, "sum": { "type": "number", "minimum": 0 }, "vat_mode": { "enum": ["none", "vat0", "vat10", "vat110", "vat18", "vat118", "vat20", "vat120"] }, "vat_amount": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, "discount_rate": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, "discount_amount": { "type": "number", "minimum": 0, "exclusiveMinimum": true }, } "payment_method": { } }, "vat_totalenum": { "type": "number",["full_prepayment", "prepayment", "advance", "full_payment", "partial_payment", "credit", "credit_payment"] "minimum": 0, "exclusiveMinimum": true }, }, "discountpayment_totalobject": { "type": "number", "minimumenum": 0["commodity", "excise", "job", "service", "gambling_bet", "exclusiveMinimum": truegambling_prize", }, "payment_method": { "enumlottery":, ["fulllottery_prepaymentprize", "prepayment", "advanceintellectual_activity", "full_payment", "partialagent_paymentcommission", "creditcomposite", "credit_paymentanother"] } } } }, "paymentvat_objecttotal": { "enumtype": ["commoditynumber", "exciseminimum": 0, "job", "service", "gambling_bet", "gambling_prize",exclusiveMinimum": true }, "discount_total": { "lotterytype",: "lottery_prizenumber", "intellectual_activity", "payment", "agent_commission", "composite", "another"] "minimum": 0, "exclusiveMinimum": true } } } |
Листинг 2. Пример заполненного поля invoice_data
...