Solved

Query data for a single company

  • 7 March 2023
  • 6 replies
  • 103 views

Userlevel 1
Badge

I am creating an integration with Acumatica and I would like to give the user an option on which of their companies they would like to connect.

However, when I query any data endpoint (such as a list of ledgers or journals), I receive the information for all the companies that belong to that user. This means it was irrelevant for the user to select which companies they wanted to connect.

Is there a query param that I can pass to the endpoints that will return only the data for the company I specify? I have not been able to find such a thing in the documentation. If not, what is the best approach for getting around this?

Any advice would be appreciated.

icon

Best answer by Jonah 3 April 2023, 08:54

View original

6 replies

Userlevel 7
Badge +11

Hi @Jonah 

You can login the instance along with the tenant's name and check once.

Request
POST /auth/login HTTP/1.1
Host: [<Acumatica ERP instance URL>]/entity
Accept: application/json
Content-Type: application/json

{
"name" : "admin",
"password" : "123",
"tenant" : "MyTenant",
"branch" : "HEADOFFICE" //Optional
}

 

Userlevel 1
Badge

Hi @jinin, thank you for your response.

I have tried logging in like you suggested but I still receive the data for all branches, not just the branch I have specified.

For example, I am hitting the JournalTransaction endpoint and I want to only receive journals for the branch that I specify. However, I am receiving the journals for every company that is connected to this tenant.

Please let me know if this is possible.

Userlevel 7
Badge +11

Hi @Jonah ,

I ‘ve tried and able to fetch the data based on the tenant. I used the below endpoint to fetch the data.

API Request: /entity/Default/20.200.001/JournalTransaction

Method: GET

 

For login, used the request like below,

{
"name" : "admin",
"password" : "123",
"tenant" : "MyTenant",
}
Userlevel 1
Badge

Hi @jinin.

Thank you, I can see how to get data for a tenant. I am asking how to fetch data based on companies / branches.

For example, I have Company A and Company B linked to MyTenant. I only want the data for Company A when I call JournalTransaction.

Userlevel 7
Badge

Hi @Jonah  were you able to find a solution? Thank you!

Userlevel 1
Badge

I’ve found that this is possible specifying the branch ID with the $filter query parameter

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved