My Products
Help
AndreasDevDotNet
CONTRIBUTOR ***

Getting error : Unknown company.

by AndreasDevDotNet

Hi, I have just started using Business NXT and I have completed all the steps for Authentication and I am able to get a token.

 

When I tried to run a query I get the following error : : Unknown company.

The companynumber I have connected the user to is 1

this is the query I am running:

 

query
{
    useCompany(no: 1)
    {
        queryResult : orderDocument
        (

            sortOrder: {orderNo:ASC _thenBy: {orgUnit3:DESC}}
        )
        {
            totalCount
            items
            {
                orderNo
                orgUnit3
                customerNo
                deliveryAddress1
                deliveryAddress2
                deliveryAddress3
                deliveryAddress4

            }
        }
    }  
}

 

What am I doing wrong ?

 

Best regards 

Andreas

5 REPLIES 5
Florian Haase
PARTNER

by Florian Haase

The companyNo should be a 7 digit number which relates to the companyID from the Visma Connect plattform and not the internal Visma Business CompanyNumber. The advantage is that you can write API-integrations across different customers by using the Visma-unique companyNumbers.  

Accepted solution
AndreasDevDotNet
CONTRIBUTOR ***

by AndreasDevDotNet

Ok, I so it is the VismaNet company no I should use ?

by Marius Bancila

As described in the documentation https://docs.business.visma.net/docs/schema/queries/query

 

Accessing company tables requires specifying a company number. Similarly, accessing a system table requires specifying a customer number. These are the Visma.net identifiers for the company and the customer and can be either found in the Visma.net portal or can be retrieved with a query

by Øyvind Årseth (Updated ‎18-08-2023 15:33 by Øyvind Årseth VISMA )

These may be handy: 

 

{
    availableCustomers   {
        totalCount
        items{
            vismaNetCustomerId
            name
        }
    }
}
{
    availableCompanies (customerNo: xxxxxx) {
        items{
            vismaNetCompanyId
            name
            
        }
    }
}

 

omelhus
PARTNER

by omelhus

I doubt that 1 is the correct company number.


Please have a look at https://docs.business.visma.net/docs/schema/queries/companies