Skip to main content

Update invoice status and post purchase invoice purchaseinvoicepostingdata.nv

Resource: purchaseinvoicepostingdata.nv

HTTP-method: POST

The resource can be used to reject, perform factual verification, approve, and post a purchase invoice. During import, you can also re-submit posting rows, meaning that rows can be edited through this resource and a purchase invoice row can be posted into several posting rows.

When using this resource, Netvisor user rights of the owner of the used API user keys are checked.

The purchase invoice that you want to factually verify, approve, or reject must be in status open or overdue. The row data are the same as in the purchase invoice message; the imported row data replace the existing row data of the purchase invoice. Note that the row data may contain a different amount than the original total amount of the purchase invoice. The posting rows define the invoice amount in Netvisor. When the invoice is approved, the invoice total is updated to match the posting rows. In the UI, the invoice shows a note “The invoice total deviates from the original total” and on the posting rows the original invoice total is shown in the field “Original invoice total”.

Purchase invoice posting rows can be edited, added, and deleted if the invoice is in status: New invoice, Factually verified, Approved, or Posted. If the purchase invoice is in Approved status, editing the purchase invoice requires the accountant role (KP role). The total of the posting rows must match the original invoice total. The invoice must not be on a locked period. A purchase invoice can be posted without changing the status when element IsReadyForAccounting is given value 1 and the Status element is omitted. Depending on the current status of the purchase invoice, this will either pre-post or post the invoice, as in the user interface. IsReadyForAccounting can also be left as zero, in which case the message will modify the posting rows without performing the actual posting.

If you want to factually verify, approve, or post a purchase invoice, or edit the posting rows of a purchase invoice, the API user must have sufficient rights. The user should have at least the Accounts payable user profile and, under sales and Accounts payable rights, rights to factual verification and approval of purchase invoices. When the purchase invoice has an accounting voucher, the posting rows can only be edited with the accountant (KP) role.

The imported data are sent as XML (POST data) as described below:

| Level | Element | Type and length | Occurs | Description | Example |
| --- | --- | --- | --- | --- | --- |
| root | root | Aggregate | 1 | | |
| 1 | purchaseinvoicepostingdata | Aggregate | 1 | | |
| 2 | purchaseinvoicenetvisorkey | Numeric | 1 | Purchase invoice ID | 31646 |
| 2 | status | String | 1 | Purchase invoice statuses in the order in which they can be given:
​reject = rejected
​contentsupervisorrejected = rejected in factual verification
​approved = factually verified
​contentsupervisorchecked = factually verified by main factual verifier*
​acceptorrejected = rejected in approval
​accepted = approved

The purchase invoice status cannot be updated to a previous status, nor can the current status be re-submitted.
*The main factual verifier can verify the invoice on behalf of all factual verifiers, after which the invoice status changes to “in approval”.
*A purchase invoice can be posted without changing the status when IsReadyForAccounting is given value 1 and the Status element is omitted. Depending on the current status of the purchase invoice, this will either pre-post or post the invoice, as in the user interface. | approved |
| 2 | eventdate | Date | 0…1 | Posting date | 2019-01-15 |
| Attr. | format | String | 1 | Posting date format, always ansi | ansi |
| 2 | isreadyforaccounting | Numeric | 1 | If value 1 is given Netvisor will generate a voucher automatically. If value 0 is given, the actual posting must be done manually in Netvisor. | 1 |
| 2 | comment | String, max 3000 chars | 0…1 | Purchase invoice comment, shown in the purchase invoice handling history | Comment |
| 2 | purchaseinvoicepostingline | Aggregate | 0…n | | |
| 3 | purchaseinvoicelinenetvisorkey | Numeric | 0…1 | Purchase invoice row NetvisorID | 12345 |
| 3 | productcode | String | 0…1 | Product code | 123 |
| 3 | productname | String | 1 | Product name. Can be left out by giving the element empty, but if the purchase invoice row has an item, this will overwrite the value with empty. | Example product |
| 3 | orderedamount | Numeric | 0…1 | Number of ordered products | |
| 3 | deliveredamount | Numeric | 1 | Number of delivered products | |
| 3 | unitname | String | 0…1 | Unit of measure | kpl |
| 3 | unitprice | Numeric | 1 | Unit price | |
| 3 | discountpercentage | Numeric | 0…1 | Discount percentage | |
| 3 | vatpercent | Numeric | 1 | VAT percent | 24 |
| Attr. | vatcode | String | 1 | VAT ID. VAT codes and identifiers are listed here. | KOMY |
| 3 | linesum | Numeric | 1 | Rounded to two decimals | |
| Attr. | type | String | 1 | Only gross = "gross" | gross |
| 3 | description | String, max 200 chars | 0…1 | Description | |
| 3 | sort | Numeric | 0…1 | Imported row order number | 1 |
| 3 | accountingsuggestion | Numeric | 0…1 | Posting suggestion; if not given, the company’s default posting account will be used | |
| 3 | dimension | Aggregate | 0…n | | |
| 4 | dimensionname | String | 1 | Cost object header | |
| 4 | dimensionitem | String | 1 | Cost object | |
| 5 | dimensionitemcode | String | 0…1 | Cost object code (when this is given, the dimensionitem element is ignored) | DIMC-001 |
| 5 | dimensionitemname | String | 0…1 | Cost object name (when this is given, the dimensionitem element is ignored) | Item Name 1 |

*This article has been translated using an AI-based translation tool. The contents or wording of these instructions may differ from those in other instructions or in the software.
*

Did this answer your question?