My Products
Help
Kristofer H
CONTRIBUTOR *

Branch '1 ' cannot be found in the system

by Kristofer H (Updated ‎18-08-2023 10:36 by Kristofer H )

Hi, we're using Visma net ERP Service API to create invoices. The POST Request returns success when testing against our ISV Test Company. However, the request doesn't work on other companies, returning the following response:

 

'Sales invoice/note' record raised at least one error. Please review the errors.\\r\\nError: Branch '1    ' cannot be found in the system.

 

The integration is not authorized by any user, the application type is a service, but it seems to be a user permission issue? 

4 REPLIES 4
christianth
PARTNER

by christianth

Hi! Is this issue now fixed? I still get the same error in CustomerInvoice (v2) when using Visma Connect and Visma net ERP Service API.

Yıldırım
VISMA

by Yıldırım (Updated ‎22-08-2023 14:36 by Yıldırım VISMA )

Hi, 

after consulting with the team, we've checked the company settings, and we're able to POST > Customer Invoice with the service_type token. Following branches are available in the company and can be manually selected in the UI as well. Please control this in your company. 

 

Sales invoices.jpg 

 

Then all the combinations have been POSTED via the API. 

POST: https://integration.visma.net/API/controller/api/v2/customerinvoice

e.g  (you can change the values based on your data including "BranchNumber" fields for DocumentHeader & Line level.)

 

{
    "customerRefNumber": {
        "value": "777"
    },
    "externalReference": {
        "value": "46"
    },
    "invoiceLines": [
        {
            "operation": "Insert",
            "lineNumber": {
                "value": 1
            },
            "description": {
                "value": "Test"
            },
            "quantity": {
                "value": 1
            },
            "unitPriceInCurrency": {
                "value": 500
            },
            "vatCodeId": {
                "value": "04"
            },
            "branchNumber": {
                "value": "031"
            }
        }
    ],
    "branchNumber": {
        "value": "031"
    },
    "customerNumber": {
        "value": "10022"
    },
    "documentDate": {
        "value": "2023-08-22"
    },
    "hold": {
        "value": false
    },
    "invoiceText": {
        "value": "testBranch"
    }
}

 

 

Yıldırım
VISMA

by Yıldırım (Updated ‎18-08-2023 14:43 by Yıldırım VISMA )

Hi Kristofer, 

 

POST/controller/api/v2/customerinvoice

If you've checked the company and its branch settings & IDs, and made sure that the specified ID in the payload exists in the company so that it can be selected via Financials ERP UI > Manual Creation of the Customer Invoice, then please review the following information. 


One can choose a role that a user must have in order to access a branch. This can be configured in the Financials ERP UI <screenID=CS101500" If a role is assigned here, the user associated with the API request must have this role in order for the logic behind to successfully access the branch

Organisations.jpg

The issue is, when using the service-API, there is no ordinary user associated with the API request, but rather a system user associated with the integration client. These "users" will not have regular roles. A workaround is to let this field be empty, or set it to "Administrator".

 

This has recently been fixed for the Supplier Invoice, and has also been reported for the Customer Invoice. 

[Release Notes] - Visma.Net API 9.59.0 - 16.08.2023

 

Kristofer H
CONTRIBUTOR *

by Kristofer H

Thank you for your reply. The customer tried to set the field to "Administrator", it had no effect. But, because of this, no user in the customer account can access this company anymore. This is really bad design in my opinion (the user should not be able to change this if it will lock one out?). Kind of crucial for daily operations to work... We have raised this issue with their partner consultant.

 

How ever, when can we expect the Customer Invoice to work?