Create a new purchase invoice, purchase order or purchase return, or update an existing one.
|Parameter name||Description||Possible value||Required|
|id||ID of existing document. If this parameter is present, then an existing document is updated.||Integer|
|warehouseID||ID of the warehouse|
If omitted, system will associate with the warehouse with the first ID.
|currencyCode||Currency code: EUR, USD. Currency must be present in the system.||String||yes|
|no||Number to be given to the purchase document.||String||yes|
|type||If your account has configuration setting |
If the setting is not enabled, possible types are:
By default: PRCINVOICE
If omitted, date of request will be used
If omitted, time of submission will be used
|confirmInvoice||By default 1||0 or 1|
|employeeID||ID of the system employee, who is set as the creator of the invoice/order/etc.||Integer|
|stateID||Status of the document itself. See getPurchaseDocumentStatuses.||Integer|
Exchange rate of the main currency against system's default currency.
If the invoice is in system's default currency, does not have to be specified (but if specified, use 1.0)
If omitted, the current exchange rate stored in the system will be used.
In how many days the purchase document is due.
|paid||0 or 1|
|baseDocumentIDs||Source document IDs, separated by commas, such as: 1,2,3,4,5||String|
|shipDate||ISO date (yyyy-mm-dd)|
|netTotalForAccounting||Decimal, 2 places|
|totalForAccounting||Decimal, 2 places|
Lines (rows) of the purchase document. Send the lines as a flat list, each line defined by the following set of parameters. Replace # with set number (1, 2, 3, ...). For example: productID1, amount1, price1, vatrateID1 for the first invoice row, productID2, amount2, price2, vatrateID2 for the second one and so on.
VAT is calculated automatically, a separate VAT row is not needed. When updating an existing document and the input parameters contain no information about invoice rows, then sytem leaves the existing rows in the database as they are. However, if row definitions are present, then all rows on the document are replaced with new ones.
|productID#||ID of the product. Either productID or serviceID can be set, but not both at the same time. Both can be omitted, however - in that case a free-text invoice row is created||Integer|
|serviceID#||ID of the service||Integer|
|itemName#||name of the item (use only if you want to override the default product/service name)||String|
|vatrateID#||ID of VAT rate.||Integer||yes|
On a Purchase Return, the quantity should be negative.
|price#||Original net price (pre-discount) per item.||Decimal||yes|
Set this field if you want to indicate that the product is purchased as packages, or that you want to order the product in packages. Use it together with "amountOfPackages#".
Packages are product-specific; a product can have zero or more defined packages. To retrieve a product's packages, call getProducts with input parameter
Amount of packages sold.
If you specify both
However, it is sufficient to specify only one of the two fields; the second one will be calculated automatically.
|invoiceID||Integer||ID of the created (or updated) document|
|invoiceRegNo||String||Reg. number of the document (if it was confirmed)|
|invoiceLink||String||URL pointing to a HTML version of the document.
This URL is valid only for 24 hours; if you want to send the purchase invoice / PO by e-mail, you must retrieve the contents of this URL and enclose it as an attachment, instead of sending the URL itself.
|net||Decimal||Net total of the document|
|vat||Decimal||Total VAT of the document|