Use case
To be able to follow a sale from the perspectives of products on the Procountor's sales reporting, the invoice row's product must be allocated to the existing product in Procountor's register.
The product rows on the invoice must be allocated to product register in order to show the value of the invoice behind the product(s). Retrieving the product from product register adds the value of the product to the right place on sales reporting. If the products are not allocated to the product register, the values of the products on the invoice will show on the N/A section in the report and not behind the product(s) of the report.
Used endpoints
Product allocation is done with product specific id (productId). To create the invoice with product allocation, you need to use those productid’s when posting invoices. Allocation cannot be done with a product name or code. ProductId must be retrieved from the product register in order to allocate the row.
For this, you need to get productId by using GET /products endpoint.
GET /products will give you a response like this example:
{
"products": [
{
"id": 1037853,
"type": "SALES",
"name": "salesproduct1",
"code": "productcode",
"unit": "PIECE",
"price": 200.000000,
"vat": 24.000000,
"active": true,
"defaultAccount": "1160",
"currency": "EUR",
"productGroupId": null
},
{
"id": 1037854,
"type": "PURCHASE",
"name": "purchaseproduct1",
"code": "productcode",
"unit": "PIECE",
"discount": 0.0000,
"price": 100.000000,
"active": true,
"currency": "EUR",
"productGroupId": null
}
]
}
POST /invoices endpoint creates a new invoice.
To create invoice row with "salesproduct1" from the example request, you would need to use productId 1037853.
"invoiceRows": [
{
"productId": 1037853,
"product": "salesproduct1",
"quantity": 1.000000,
"unit": "PIECE",
"unitPrice": 200.0000,
"discountPercent": 0.0000,
"vatPercent": 24.00
}
],
Other information
The invoice row must include all the necessary product information. Product information will not be extracted or replaced from Procountor's product register to the invoice even if allocating occurs.
Only a product's default account and a default dimensions are used on the invoice's accounting page (ledgerReceipt in API), if the allocation is done and the default(s) are set for the product in advance. Defaults can only be set in the Procountor's user interface. If product's default dimensions are going to be utilized, accounting entries must be done by one row at a time:
"accountingByRow": true