Skip to main content

Import purchase order purchaseorder.nv

Resource: purchaseorder.nv

HTTP-method: POST

Purchase orders can be imported over the API to Netvisor. Required information is order number, order date and vendor information. If product lines are included, product code and amount are required, and commentlines require the comment text.

Things to note:

  • When editing an order, all existing product- and comment lines are not needed, give only edited and/or new data in the XML.

  • Payment term, delivery term and delivery method are searched with the given information, if not found, a new one is created

Querystring parameters:

Parameter

Format

Required

Description

Example

method

String

Always

Add Import as new order
Edit Edit an existing order


id

Numeric

If method is edit

ID of the order to edit


Things to note when using Purchaseorderproductline:

Method

Description

edit

If used, do not include purchase order productline partial delivery information (purchaseorderproductlinepartialdelivery) and can include only elements which will be edited

delete

If used, purchase order productline must be empty

partialdeliver

Used for importing partial delivery rows. If used, must include at least two partial delivery rows (purchaseorderproductlinepartialdeliverycontent). In partial delivery information (purchaseorderproductlinepartialdeliverycontent) the amount of ordered products (orderedamount) must correspond to the ordered amount of the targeted productline amount, which was ordered.

addtopartialdeliverygroup

Used for adding partial delivery rows. If used, must include at least one partial delivery row (purchaseorderproductlinepartialdeliverycontent).
If editing erroneous amount of partially delivered product, you must add new partial delivery row for the rest of the amounts and update some partial delivery row amount with the delivered amount. Partially delivered product amount must correspond to the original purchase order line's product amount.

Paramateres

Description

netvisorkey

Mandatory if using other methods than add

The following describes the XML message to import (POST) a purchase order into Netvisor:
When reading documentation:
* - When creating new purchase order, mandatory
** - When creating new product line, mandatory

Level

Element

Format

Occurs

Description

Example

Root

root

Aggr.

1

1

purchaseorder

Aggr.

1

Main order information

2

ordernumber

Integer

1

Number of the order

141128

2

orderstatus

String

1

Status of the order
proposal
- Purchase proposal
approved - Approved
senttovendor - Sent to vendor
waitinginvoice - Link delivery and invoice
archived - Archive

approved

2

orderdate

Date

1

Date of the order

28.11.2023

Attr.

format

String

1

Format of the date, always ansi

ansi

2

vendoridentifier

String

1

Vendor identification information

101714

Attr.

type

String

1

Identification type
netvisor - Netvisor key
code - Vendor code
organisationidentifier - Vendor's organisation identifie

code

2

purchaseordervendordetails

Aggr.

0...1

Vendor details


3

address

String

1

Vendor's address

3

postnumber

String

1

Vendor's post number

3

city

String

1

Vendor's post office

3

country

String

0...1

Vendor's country's code

Attr.

type

String

1

Country code's type, always ISO-3166

2

deliveryterm

String

0...1

Term of delivery

2

deliverymethod

String

0...1

Method of delivery

2

purchaseorderdeliverydetails

String

0...1

Delivery details


3

name

String

0...1

Recipient of the delivery

3

address

String

0...1

Address of the delivery

3

postnumber

String

0...1

Post number of the delivery

3

city

String

0...1

Post office of the delivery

3

country

String

0...1

Country code of the delivery

Attr.

type

String

1

Type of the country code, always ISO-3166

2

privatecomment

String

0...1

Free private comment text. Will not show on printed order

2

comment

String

0...1

Free comment text, will show on printed order

2

ourreference

String

0...1

Our reference

1411281

2

currencycode

String

0...1

Order's currency code

USD

Attr.

type

String

1

Type of the currency code, always ISO-4217

ISO-4217

2

purchaseorderpaymentterm

Aggr.

0...1

Payment term information

3

netdays

Integer

1

Payment term net days

14

3

discountdays

Integer

1

Payment term cash discount days

10

3

discountpercent

Decimal

1

Payment term discount percentage

7,5

2

purchaseorderlines

Aggr.

0...1*

Order's product lines

3

purchaseorderproductline

Aggr.

0...n

Order's product line

Attr.

method

String

0...1

Product line method
add - Add new line (default)
edit - Edit line
delete - Delete line
partialdeliver - Partial delivery for line
addtopartialdeliverygroup - Add new line for partial delivery group

add
(read instructions above)

Attr.

netvisorkey

Integer

0...1*

ID of the product line

4

purchaseorderproductlinepartialdelivery

Aggr.

0...1

Partial delivery information

5

purchaseorderproductlinepartialdeliverycontent

Aggr.

1...n

Partial delivery

6

orderedamount

Decimal

1

Amount of ordered products

10,00

6

deliveredamount

Decimal

1

Amount of delivered products

5,00

6

deliveryreceiveddate

Date

1

Product delivery date

2023-12-28

Attr.

format

String

1

Date format, always ansi

ansi

6

deliverymanuallyconfirmed

String

0...1

Delivery manually confirmed, even if divergent amount

true
or
false

6

deliveredproductquality

Integer

0...1

Delivered product quality

1

6

inventorybatchnumber

Integer

0...1

Delivered product inventory batch number

1234

6

inventorymanufacturedate

Date

0...1

Delivered product's manufacture date

2023-05-31

Attr.

format

String

1

Date format, always ansi

ansi

6

inventorypackagingdate

Date

0...1

Delivered product's packaging date

2023-06-01

Attr.

format

String

1

Date format, always ansi

ansi

6

inventorybestbeforedate

Date

0...1

Delivered product's best before date

2023-10-25

Attr.

format

String

1

Date format, always ansi

ansi

6

inventoryexpirydate

Date

0...1

Delivered product's expiry date

2023-10-25

Attr.

format

String

1

Date format, always ansi

ansi

4

productcode

String

1**

Mandatory, when purchaseorderproductline method = add.
Product id, if type attribute not given, line can't be linked to Netvisor's product

1017

Attr.

type

String

0...1

Type of indentifier
netvisor -NetvisorKey
customer - Product code

customer

4

vendorproductcode

String

0...1

Supplier code for product

TK100

4

vendorproductname

String

0...1

Supplier's product name

Product100

4

orderedamount

Decimal

0...1**

Ordered amount of product

10,00

4

unitprice

Decimal

0...1

Product unit price, VAT excluded

52,50

4

vatpercent

Decimal

0...1**

Product VAT percentage

24

4

freightrate

Decimal

0...1

Shipping costs, freight rate

22,50

4

linecomment

String

0...1

Line comment (max. 255 chars.)

4

deliverydate

Date

0...1**

Product line product's delivery date

2023-12-09

Attr.

format

String

1

Date format, always ansi

ansi

4

purchaseorderproductlinedeliverydetails

Aggr.

0...1

Purchase order product line delivery details

5

deliveredamount

Decimal

1

Received/Delivered product amount

5,0

5

deliveryreceiveddate

Date

1

Received/Delivered delivery date

Attr.

format

String

1

Date format, always ansi

ansi

5

deliverymanuallyconfirmed

String

0...1

Delivery manually confirmed, even if divergent amount

true
or
false

5

deliveredproductquality

Integer

0...1

Quality of delivered product

5

inventoryplace

String

0...1

ID/name of the used warehouse

12

Attr.

type

String

1

Type of warehouse indentifier
netvisor - Warehouse NetvisorKey
customer - Name of the warehouse

netvisor

5

accountingsuggestion

Integer

0...1

Suggestion for accounting account. Must be found in the system

4020

4

purchaseorderproductlinedimensions

Aggr.

0...1

Purchase order product line dimension details

5

dimension

Aggr.

0...n

Productline dimension

6

dimensionname

String

1

Dimension header

Hankinta

6

dimensionitem

String

1

Dimension item

Tarvikkeet

3

purchaseordercommentline

String

0...1

Purchase order comment line

Attr.

method

String

1

Comment line method
add - Add new line
edit - Edit current comment
delete - Delete line

Attr.

netvisorkey

Integer

0...1

ID of the commentline

Mandatory, if method
edit
or
delete

4

comment

String

0...1

Comment text

This is an order

Please note:

Element

Method

Description

purchaseordercommentline

delete

If used, element purchaseordercommentline comment must be empty

Did this answer your question?