Purchases use cases
Purchase invoices, orders, vendors and payments – use case guide
This guide explains how to use the Netvisor API correctly for the most common purchase scenarios: importing a purchase invoice, moving it through review, approval and accounting, managing vendors, working with purchase orders and creating outgoing bank transfers. It complements the API reference, which describes every element and parameter in detail. Here the focus is on the order of calls, the business rules behind them and how API elements map to the Netvisor user interface.
Netvisor's user interface is mainly used in Finnish, so many end users and accountants will refer to fields by their Finnish names. Throughout this guide the Finnish UI term is shown in italics after the English description, for example due date (Eräpäivä).
Contents
Before you start
Resources used in the purchase flow
Use case: import a purchase invoice
Purchase invoice – key elements and their UI names
Invoice image and attachments
Use case: review, approve and post a purchase invoice
Use case: accrue a purchase invoice
Use case: manage vendors
Use case: purchase orders
Use case: outgoing bank transfers and purchase payments
Use case: read purchase data back into your system
Appendix: statuses and glossary
1. Before you start
Transaction fee. Every purchase invoice imported through the API is charged as an e-invoice transaction (verkkolaskun transaktiomaksu).
Vendor data on the invoice is not taken from the vendor card. Unlike sales invoices, where the customer's details are fetched from the customer card, a purchase invoice uses only the vendor details given in the message. If the company pays its purchase invoices from Netvisor, the payment file sent to the bank is built from the payee details in the imported invoice, so the vendor's name, address, bank account and payment reference must be complete in the message.
Vendor data is not updated from invoices. Importing a purchase invoice never updates an existing vendor card. Use vendor.nv to maintain vendor master data.
Large volumes. Purchase invoices can also be imported in batches with purchaseinvoicebatch.nv. Each item in the batch follows the purchaseinvoice.nv structure, and the batch is processed in the background. Follow its progress with getbatchstatus.nv and getbatchlist.nv. Batch import requires the purchase ledger (ostoreskontra) to be in use in the company.
Store the Netvisor keys. Successful imports return the new record's Netvisor key in InsertedDataIdentifier. Store it in your own system: you need it to approve, post, accrue or fetch the invoice later.
2. Resources used in the purchase flow
Area | Resource | Method | Purpose |
|---|---|---|---|
Purchase invoices | POST | Import a purchase invoice | |
POST | Import a batch of purchase invoices | ||
GET | List purchase invoices | ||
GET | Get the full details of one or more purchase invoices | ||
GET | Get a purchase invoice's attachments | ||
GET | List deleted purchase invoices | ||
Review, approval and accounting | POST | Set, change or remove the review and approval circulation | |
GET | List circulation lists (kiertolistat) | ||
POST | Review, approve or reject an invoice and update its posting lines | ||
POST | Accrue a purchase invoice | ||
POST | Add comments to purchase invoices | ||
Vendors | POST | Create or update a vendor | |
GET | Get vendor details, also by change date | ||
Purchase orders | POST | Create or update a purchase order | |
GET | List purchase orders | ||
GET | Get the full details of a purchase order | ||
GET | List deleted purchase orders | ||
GET / POST | List or add product quality classes (laatuluokat) | ||
Payments | POST | Create an outgoing bank transfer (tilisiirto) | |
GET | Get the status of transfers sent through the API | ||
GET | List purchase payments | ||
GET | List deleted purchase payments |
3. Use case: import a purchase invoice
The typical flow for importing purchase invoices from an external system (for example a scanning service, procurement system or another accounting system) is shown below.
Step 1 – Decide how the vendor is matched
You do not need to create the vendor before importing the invoice. Netvisor matches the invoice to a vendor in this order:
a vendor whose name and business ID (Y-tunnus) match the invoice
a vendor whose business ID matches the invoice
a vendor whose vendor code (toimittajakoodi) matches
vendorcodea vendor whose name matches the invoice.
If none of these match, Netvisor creates a new vendor card. If vendorcode is given and a new vendor is created, the code is saved on the new vendor; it is not updated on existing vendors.
To change the matching priority, give primaryvendormatchtype with code, name or organizationid. If no vendor is found with that field, the normal matching order is used.
If you want full control over vendor master data (bank accounts, default accounts, reviewers), create or update vendors first with vendor.nv (see section 8).
Step 2 – Build the invoice message
The following elements are required:
Element | Netvisor UI name | Notes |
|---|---|---|
| Laskun numero | The vendor's invoice number. |
| Laskun päiväys | Invoice date, |
| Eräpäivä | Due date, |
| Laskun summa | Invoice total including taxes, two decimals. |
| Laskurivit | At least one line. Each line needs |
Value date: according to Netvisor's support documentation,
valuedate(Arvopäivä) is currently needed for invoice imports even though it is marked as optional in the DTD. Include it in your messages.
Give the vendor details in the same message (see Step 1 and section 4). A minimal invoice with one line looks like this:
Step 3 – Send the request and store the key
Send the message to purchaseinvoice.nv. On success, the response returns the new invoice's Netvisor key in InsertedDataIdentifier.
If invoicesource is finvoice, the import takes about a minute longer, because the invoice is routed through Netvisor's Finvoice handler (see section 5).
Step 4 – Continue the process
After the import, the invoice continues in Netvisor's purchase invoice process. Depending on your integration, you can:
set the review and approval circulation with
purchaseinvoicecirculation.nvreview, approve or post the invoice with
purchaseinvoicepostingdata.nvaccrue the invoice with
purchaseinvoiceaccrual.nvcreate a bank transfer with
payment.nv, or let the company pay the invoice from Netvisor.
4. Purchase invoice – key elements and their UI names
Dates, status and accounting
Element | Netvisor UI name | Notes |
|---|---|---|
| Laskun päiväys | Required. |
| Arvopäivä | See the note in section 3. |
| Kirjauspäivä | Posting date. The invoice's accounting voucher is created for this date. |
| Eräpäivä | Required. |
| Toimituspäivämäärä | Delivery date. |
| – |
|
| – | 1 = Netvisor creates the accounting voucher automatically when the invoice status is |
Vendor details
Element | Netvisor UI name | Notes |
|---|---|---|
| Toimittajan nimi | Vendor name. |
| Y-tunnus | Vendor's business ID. Used in vendor matching. |
| VAT-tunnus | Vendor's VAT number. |
| Toimittajakoodi | Saved only when a new vendor is created during the import. |
| Osoite | Vendor address. Country as an ISO-3166 code. |
| – | Vendor contact details. |
| – | Optional matching priority: |
Payment details
Element | Netvisor UI name | Notes |
|---|---|---|
| Laskun summa | Total including taxes, two decimals. Required. |
| Tilinumero | Vendor's bank account. Always use IBAN format for IBAN countries. |
| Viitenumero / Viesti | Bank reference number or payment message, max 70 characters. |
| – | Invoice currency. For the currency calculation to work correctly, also give the bank account ( |
| Myöhästymismaksuprosentti | Late payment interest percentage. |
| – | Amount already paid on the invoice ( |
Other header elements
Element | Netvisor UI name | Notes |
|---|---|---|
| Viitteemme / Viitteenne | References, max 200 characters. |
| Toimitusehdot / Toimitustapa | Delivery terms and method. |
| Lisätieto | The invoice's additional information field, max 255 characters. |
| Sopimustunnus | Agreement identifier. |
| – | Numbers of the purchase orders ( |
Invoice lines
Element | Netvisor UI name | Notes |
|---|---|---|
| Tuotekoodi | Product code, max 50 characters. |
| Tuotteen nimi | Required element, but can be empty. |
| – | Ordered quantity. |
| – | Delivered quantity. Required. |
| Yksikköhinta | Unit price including VAT. Required. |
| Alennusprosentti | |
| ALV-prosentti | Required. |
| Rivisumma | Line total including taxes, rounded to two decimals, |
| Riviselite | Line description. |
| Mittayksikkö | Not shown on the purchase invoice in Netvisor, but returned by |
| – | Line order number. |
| Tiliöintiehdotus | Accounting account suggestion. If not given, the vendor's default account is used. The VAT code on the posting lines comes from the settings of that account in Netvisor. |
| Laskentakohde | Dimension name (laskentakohdeotsikko) and dimension item. Both are created automatically if they do not exist. When |
Subtotal lines (purchaseinvoicesublines) and comment lines (purchaseinvoicecommentlines) can also be imported.
5. Invoice image and attachments
Attachments are imported in purchaseinvoiceattachments with the MIME type, description, file name and the file as Base64 in documentdata.
To create an invoice image (Laskun kuva) in Netvisor's purchase invoice view, invoicesource must be finvoice. The same applies if you want Netvisor's automation rules (automaatiosäännöt) to be applied to the invoice. The attachment used as the invoice image can be:
a Finvoice XML file: Netvisor generates the invoice image from the Finvoice data. TEAPPS files are not supported. A Finvoice file can be downloaded from Netvisor with Ostolaskun toiminnot > Lataa Finvoice-aineisto.
a PDF file: the PDF is used as the invoice image and is shown under the invoice's attachments (Laskun liitteet).
The documenttype attribute of documentdata is invoiceimage (default) or otherattachment. If several attachments have the type invoiceimage, only the first one is shown. To import several attachments, give the others the type otherattachment.
Attachments of an existing invoice can be fetched with getattachments.nv (attachmentsource=purchaseinvoice). PDF attachments can optionally be returned as one image per page with convertpdfstoimages=true.
6. Use case: review, approve and post a purchase invoice
Set the review and approval circulation
purchaseinvoicecirculation.nv sets, changes or removes an invoice's review and approval circulation (asiatarkastus- ja hyväksyntäkierto). The circulation is set either from a circulation list (kiertolista) or person by person:
Circulation list: give the list's Netvisor key in
circulationlistidentifier. Get the keys with getcirculationlists.nv. If a circulation list is given, persons cannot be given, and vice versa.Persons: give the reviewers (
factualverificator, asiatarkastaja) and the approver (approver, hyväksyjä) by email address. If the person has an email address set in their own Netvisor settings under company-specific exceptions (Yrityskohtaiset poikkeukset), that address is used. The email address must be unique within the company.
The invoice is identified by its Netvisor key or invoice number. Rules:
The persons must have sufficient ledger rights for their role in Netvisor, and a possible vendor or amount limit must not prevent them from being set.
The API user needs the ledger right for setting circulations.
One call can set circulations for several invoices. If the call returns OK, all circulations were set. If it returns an error, none were set. The response contains a
ValidDataIdentifierelement for each invoice that could have been set without errors.The last reviewer becomes the invoice's main reviewer (pääasiatarkastaja).
To remove a circulation, send the invoice without reviewers and approver.
Once someone in the circulation has reviewed or approved the invoice, the circulation can no longer be changed through the API.
The optional
comment(max 250 characters) is added to the invoice's processing history (käsittelyhistoria).
Review, approve, reject or post
purchaseinvoicepostingdata.nv is used to reject, review or approve an invoice and to post it (tiliöinti). The invoice is identified by purchaseinvoicenetvisorkey.
| Meaning |
|---|---|
| Rejected (hylätty) |
| Rejected in review (hylätty asiatarkastuksessa) |
| Reviewed (asiatarkastettu) |
| Reviewed as main reviewer (asiatarkastettu pääasiatarkastajana). The main reviewer can review on behalf of all reviewers, after which the invoice moves to approval. |
| Rejected in approval (hylätty hyväksynnässä) |
| Approved (hyväksytty) |
Rules:
The statuses must be given in the order above. An invoice cannot be returned to an earlier status, and the status it already has cannot be given again.
To review, approve or reject an invoice, its payment status must be open (avoin) or overdue (erääntynyt).
isreadyforaccounting= 1 makes Netvisor create the accounting voucher automatically. With 0, the actual posting must be done manually in Netvisor.Posting without changing the status: give
isreadyforaccounting= 1 and leave outstatus. Depending on the invoice's status, this pre-posts or posts the invoice, in the same way as in the UI. Withisreadyforaccounting= 0 and no status, the message only updates the posting lines without posting the invoice.The invoice must not be in a locked period.
comment(max 3,000 characters) is shown in the invoice's processing history.
Posting lines. purchaseinvoicepostingline elements have the same content as purchase invoice lines, plus a VAT code (vatcode attribute of vatpercent, ALV-tunnus). The posting lines you send replace the lines on the invoice, so one invoice line can be split into several posting lines. The posting lines determine the invoice amount in Netvisor: if their total differs from the invoice's original total, the invoice amount changes to match the posting lines when the invoice is approved. The UI then shows the note "Laskun summa poikkeaa laskun alkuperäisestä summasta", and the original amount is shown on the posting lines as "Laskun alkuperäinen summa".
Posting lines can be edited, added and removed when the invoice is in one of the statuses new invoice (Uusi lasku), reviewed (Asiatarkastettu), approved (Hyväksytty) or posted (Tiliöity). If the invoice is approved, editing requires the accountant role (KP-rooli). Once the invoice has an accounting voucher, posting lines can only be edited with the accountant role.
Required rights. The posting rights of the owner of the API credentials are checked on every call. To review, approve or post invoices or to edit posting lines, the API user needs at least the purchase ledger user profile (Ostoreskontran käyttäjä) and, in the sales and purchase ledger rights, the rights to review and approve purchase invoices.
Add comments
purchaseinvoicecomment.nv adds comments to one or more existing purchase invoices. Comment is added to the invoice's history, and AdditionalInformation overwrites the invoice's additional information field. Use it for notes that should be visible in the approval flow without changing the invoice's accounting data.
7. Use case: accrue a purchase invoice
purchaseinvoiceaccrual.nv accrues (jaksottaa) a purchase invoice identified by its Netvisor key or invoice number.
Equal split (tasajako): give a start month and year and an end month and year. The invoice lines are spread evenly over the period; for example, 3/2021–4/2021 accrues 50 % to March and 50 % to April.
Division curve (jakokäyrä): give a start month and year and
divisioncurvename. The curve name must be unique, and the curve can define monthly percentages.The end of the accrual cannot be before the start, and the start can be no earlier than the month of the invoice's posting date.
Invoices cannot be accrued to a locked period.
By default, no accrual is created if the invoice already has an accounting voucher or an accrual. To change an existing accrual or to accrue an invoice that has already been posted, give
removeexistingaccrual=true. If the invoice has no voucher or accrual, this element has no effect.
8. Use case: manage vendors
Create or update a vendor
vendor.nv creates a new vendor (method=add) or updates an existing one (method=edit, with the vendor's Netvisor key in the netvisorkey parameter). The response returns the vendor's Netvisor key. Store it if you need to update or fetch the vendor later.
The vendor's Netvisor key can also be found:
through the API with getvendor.nv and the
changedSinceparameterin the Netvisor UI by opening the vendor card and checking the
idin the address bar (for exampleid=123).
Element | Netvisor UI name | Notes |
|---|---|---|
| Toimittajakoodi | Vendor code. |
| Toimittajan nimi | Required. |
| Osoite | Required. Country as an ISO-3166 code. |
| Y-tunnus | Business ID. Required. |
| Toimittajaryhmä | Vendor group. |
| – | Phone, email, contact person (yhteyshenkilö), homepage and comment. |
| Oletus ALV-kanta | Default VAT rate. |
| – | Vendor has only partial VAT deduction rights (osittainen ALV-vähennysoikeus). |
| Oletusmaksuehto | Default payment term. Used on incoming purchase invoices when |
| Oletusvaluutta | Default currency. |
| Oletuslaskentakohteet | Default dimensions. |
| Kirjanpidon tilit | The vendor's accounting accounts, one marked as default. |
| Asiatarkastajat | Reviewers for the vendor's invoices. |
Bank accounts
Vendor bank accounts are divided into domestic and foreign accounts, up to eight of each:
Domestic accounts (
vendordomesticbankaccount): IBAN and bank name.Foreign accounts (
vendorforeignbankaccount): BBAN, BIC, bank name, country and currency, plus optional clearing code, clearing number and bank address.includeaddresssinforeignpaymentsadds the bank's address details to the payment file in addition to the BIC.If a bank account has no
netvisorkey, it is added to the vendor as a new account. If thenetvisorkeyis found, that account is updated.isdefault= True makes the account the default. If several accounts have True, the last one in the message becomes the default.
9. Use case: purchase orders
Create a purchase order
purchaseorder.nv creates (method=add) or updates (method=edit, with the order's Netvisor key in id) a purchase order (ostotilaus). A new order requires:
Element | Netvisor UI name | Notes |
|---|---|---|
| Tilauksen numero | Order number. |
| Tilauksen päivämäärä | Order date, |
| Tila | See the status table below. |
| Toimittaja |
|
| Tuoterivit | Product lines need a product code, ordered quantity, VAT percentage and delivery date. Comment lines need a comment. |
| Netvisor UI status |
|---|---|
| Hankintaehdotus |
| Hyväksytty |
| Lähetetty toimittajalle |
| Arkistoitu |
Things to note:
When editing an order, send only the data you want to change. The required elements do not have to be included.
The payment term (maksuehto), delivery term (toimitusehto) and delivery method (toimitustapa) are looked up with the given data. If no match is found, a new one is created.
productcodelinks the line to the product register only when itstypeattribute is given:netvisor(product's Netvisor key) orcustomer(product code, tuotekoodi). Withouttype, the line is not linked to a product.unitpriceis the product's unit price excluding VAT, in the order currency.privatecommentis an internal comment that is not printed, whilecommentis printed on the order.
Edit order lines
Each purchaseorderproductline has a method attribute. All methods except add require the line's netvisorkey.
Line | Use |
|---|---|
| Add a new product line. |
| Edit a line. Include only the elements you want to change, and no partial delivery data. |
| Delete a line. The line element must be empty, for example |
| Split a line into partial deliveries (osatoimitus). Must contain at least two partial delivery rows, and their ordered quantities must add up to the ordered quantity of the line. |
| Add a row to an existing partial delivery group. Must contain at least one partial delivery row. If you correct the ordered quantities, add the remaining row and update another row so that the ordered quantities still add up to the line's original ordered quantity. |
Comment lines (purchaseordercommentline) support add, edit and delete. When deleting, the comment line must be empty.
Record deliveries
Deliveries are recorded per line in purchaseorderproductlinedeliverydetails (or in the partial delivery rows):
Element | Netvisor UI name | Notes |
|---|---|---|
| – | Quantity received. |
| – | Date received, |
| – |
|
| Laatuluokka | Quality class of the delivered product. Manage quality classes with |
| Varasto | Inventory, |
| Tiliöintiehdotus | The account must exist in Netvisor. |
Partial delivery rows can also carry batch information for the delivered products: batch number (max 20 characters), manufacture date, packaging date, best-before date and expiry date.
Link orders and invoices
A purchase invoice is linked to purchase orders by giving the order numbers in purchaseinvoicerelatedpurchaseordernumbers when the invoice is imported. purchaseorderlist.nv with haslinktopurchaseinvoice=1 returns only orders linked to at least one purchase invoice, together with the linked invoices.
10. Use case: outgoing bank transfers and purchase payments
Create a bank transfer
payment.nv creates a new bank transfer (tilisiirto), which is then approved or paid in Netvisor's transfer view (tilisiirtonäkymä). One XML message contains one transfer.
Element | Notes |
|---|---|
|
|
| The reference number or message. |
| Recipient's name and optional business ID. Address, postcode, town and country are required if the recipient's account is not a Finnish bank account. |
| Payer's account number. |
| Recipient's bank name, BIC ( |
| Due date. |
| Amount. |
Rules:
Transfers can be made within the SEPA area, and the recipient's account number must be in IBAN format. The account number is validated on import. The BIC is validated if Netvisor cannot identify the bank from the recipient's account number.
The currency is always euro.
If the due date is in the past, Netvisor changes it to the current date when the transfer is sent for payment.
Imported transfers can be edited in Netvisor afterwards.
Several imported transfers can be paid in the same payment batch (maksuerä), and transfers imported through the API can be combined with transfers created in Netvisor. All transfers sent for payment at the same time with the same payment account and payment date are paid in one batch.
The
paymentgroupelement is legacy and no longer needs to be used.
Check the transfer status
unprocessedoutgoingpayments.nv returns the status of transfers sent through the API. Give the InsertedDataIdentifier values returned by payment.nv in idlist. The response status is 2 (OK) or 3 (failed, with the reason in StatusDescription). While the payment is being processed and no response has been received from the bank, the resource returns nothing.
List purchase payments
paymentlist.nv lists payments recorded against purchase invoices, including the linked invoice and the accounting voucher. Use limitAboveNetvisorKey to fetch only new payments since the last one you processed, or filter by date range, reference number or invoice Netvisor key (limitInvoiceID). Deleted payments can be listed with deletedpurchasepayments.nv.
11. Use case: read purchase data back into your system
Purchase invoices
purchaseinvoicelist.nv lists purchase invoices. Useful filters:
begininvoicedate/endinvoicedateandinvoicenumberinvoicestatus:open,approvedoraccepted(see the appendix)paymentstatus:unpaidorpaidlastmodifiedstart/lastmodifiedendin the formatyyyy-MM-ddTHH:mm:ss, for fetching only invoices changed within a time windowpurchaseinvoicebatchidfor invoices imported in a given batch.
Each row contains the invoice's Netvisor key, number, date, vendor and business ID, total, paid amount, open amount and a Uri pointing to the full record.
getpurchaseinvoice.nv returns one invoice (netvisorkey) or up to 500 at a time (netvisorkeylist). Optional sections, such as actions, handling history, payment information, invoice image, circulation list, Finvoice data and attachments, are included with the include parameter. omitattachments=true returns only the attachment count, which is faster for invoices with large attachments. With version=2, dimensions are returned inside each line.
Use deletedpurchaseinvoices.nv to keep your system in sync with invoices deleted in Netvisor.
Purchase orders
purchaseorderlist.nv filters by order number range, order date range, status, vendor (Netvisor key, vendor code or business ID), comment text and modification time. getpurchaseorder.nv returns the full order, and deletedpurchaseorders.nv lists deleted orders.
Vendors
getvendor.nv returns one vendor (NetvisorKey), several vendors (NetvisorKeyList, up to 500) or all vendors changed since a given date (changedSince), with up to 500 vendors per page (page).
12. Appendix
Purchase invoice statuses
Status on import (purchaseinvoiceonround) and in the list filter (invoicestatus):
Value | Netvisor UI status |
|---|---|
| New invoice, in review (Uusi lasku, asiatarkastuksessa) |
| In approval (Hyväksynnässä) |
| Approved (Hyväksytty) |
Status changes with purchaseinvoicepostingdata.nv are listed in section 6.
Glossary: English – Finnish
English | Finnish (Netvisor UI) |
|---|---|
Purchase invoice | Ostolasku |
Purchase order | Ostotilaus |
Purchase ledger | Ostoreskontra |
Vendor / vendor card | Toimittaja / toimittajakortti |
Vendor code | Toimittajakoodi |
Vendor group | Toimittajaryhmä |
Business ID | Y-tunnus |
Invoice date | Laskun päiväys |
Posting date | Kirjauspäivä |
Value date | Arvopäivä |
Due date | Eräpäivä |
Invoice image | Laskun kuva |
Invoice attachments | Laskun liitteet |
Automation rule | Automaatiosääntö |
Review / reviewer | Asiatarkastus / asiatarkastaja |
Main reviewer | Pääasiatarkastaja |
Approval / approver | Hyväksyntä / hyväksyjä |
Circulation list | Kiertolista |
Processing history | Käsittelyhistoria |
Posting | Tiliöinti |
Accounting suggestion | Tiliöintiehdotus |
Accountant role | KP-rooli (kirjanpitäjän rooli) |
Accrual / division curve | Jaksotus / jakokäyrä |
Dimension / dimension name | Laskentakohde / laskentakohdeotsikko |
Purchase proposal | Hankintaehdotus |
Partial delivery | Osatoimitus |
Quality class | Laatuluokka |
Bank transfer | Tilisiirto |
Payment batch | Maksuerä |
Reference number / message | Viitenumero / viesti |
Default payment term | Oletusmaksuehto |
Partial VAT deduction right | Osittainen ALV-vähennysoikeus |