7.2 bill (creating a slip)
| Field | Type | Required | Description |
|---|---|---|---|
distCode | text | Yes | Distributor code |
centralCode | text | Yes | Head office code |
invoiceNumber | text | Yes | Slip number; for non-order types it must be unique within the distributor |
evDate | date | Yes | Slip date |
items | list | Yes | Line items (below) |
targetSlipType | text | No | Slip type; default BUYINVOICEFROMHEADQUARTER |
customerCode or customerIntegCode | text | Depends on slip type | One of them is required for the "Required" types in the table |
sellerCode or sellerIntegCode | text | Depends on slip type | Same rule as the customer code |
fromStockCode, toStockCode | text | No | Source and destination warehouse; default warehouse if empty |
invoiceNumberOther | text | No | Second number; default invoiceNumber |
docStatus | text | No | Printed, Unconfirmed or Waiting; determined by type if empty |
paymentType | text | No | Payment type; default cash |
gross, discount, kdv, price, weight, volume | number | No | Header amounts; written as sent, the server does not recalculate them |
explanation, explanation2 | text | No | Notes |
Leave the idInv and cancelReason fields empty for a new slip; they are used for revisions. Additional header fields: custDisRat1 (customer discount, %), priceCurr (promissory note amount), rebateDis (signage discount). Weight is in grams, volume in dm³.
Line items (items[])
| Field | Type | Required | Description |
|---|---|---|---|
metaCode | text | Yes | Product code |
amount | number | Yes | Quantity, in the idUnit unit; must be greater than 0 |
idUnit | number | Yes* | Unit: 0 piece, 1 box, 2 case; must be defined for the product |
sapUnit | text | No | Unit short name; if filled, it is used instead of idUnit |
itemNo | text | Yes | Item number; an empty string ("") may be sent |
explanation | text | Yes | Line note; an empty string ("") may be sent |
unitPrice | number | No | Unit price; if 0, the product's list price |
realPrice | number | No | Net line amount; if empty, calculated from price, quantity and discounts |
unitKdvRat, unitKdvRat2 | number | No | VAT rates, as a fraction (0.18) |
unitDisRat2–unitDisRat4 | number | No | Additional user discount rates |
unitTaxBase, tax | number | No | Unit tax base and tax amount; 0 if empty |
firstAmount | number | No | Initially entered quantity; default amount |
batch | text | No | Batch; the product is looked up by the code metaCode-batch |
disc[] | list | No | Line discounts (below) |
* If sapUnit is not sent.
Line discounts (items[].disc[])
| Field | Type | Required | Description |
|---|---|---|---|
discCode | text | Yes | Discount code |
discName | text | Yes | Discount name |
discRate | number | No | Discount rate, between 0 and 1 (0.05 = 5%) |
discAmount | number | No | Discount amount |
discOrderNo | number | No | Order of application |
{ "distCode": "1001", "centralCode": "C1001", "invoiceNumber": "F2026000123", "evDate": "2026-11-18 10:00:00", "targetSlipType": "ORDER", "customerCode": "M001", "sellerCode": "S01", "items": [ { "metaCode": "P100", "amount": 10, "idUnit": 2, "unitPrice": 120, "unitKdvRat": 0.18, "itemNo": "10", "disc": [ { "discCode": "D1", "discName": "Campaign", "discRate": 0.05, "discAmount": 60, "discOrderNo": 1 } ] } ] }
In the response, data.idInv is the ID of the created slip.
| HTTP | Message | Cause |
|---|---|---|
400 | Target slip type is not found | Invalid targetSlipType |
400 | The <kod> Distributor Code was not found! | Distributor does not exist |
400 | Customer is not found / Seller is not found | Customer or seller code not sent for a type that requires it |
400 | Duplicate invoice: InvNo = X, Dist Code = Y! | Slip number already used |
400 | <kod> Product Code value/s not found! | Product does not exist |
400 | The unit of idUnit <n> of the product with code <kod> was not found! | Unit is not defined for the product |
400 | DiscRate must be between 0-1 | Invalid discount rate |
400 | The DistCode field is required. etc. | Required field missing |