inFlow’s API
For apps and services that aren’t integrated with inFlow, your team’s developers can use the API to read or write data from inFlow’s database.
What is an API?
APIs act as the “front door” for applications to access data or functionality from your inFlow database. This can allow developers or others with web development knowledge to access inFlow’s data from outside the program.
The inFlow Inventory API allows you to read and write data to inFlow Inventory. Like most modern APIs, it’s organized around REST and JSON. This can open a whole world of possibilities for what you can do with that data. This could mean creating custom reports or building an integration with other software.
The inFlow API is available for select plans and add-ons.
API Documentation
You can find the API documentation here.
The inFlow support team isn’t able to assist with specific API questions. However, we can direct questions to the development team if help is needed!
How can I access the API?
To gain access to inFlow’s API, you will need an active inFlow Inventory subscription and the API add-on. You can do that from the Account page in inFlow.
Then, you can go to inFlow’s Integration page and generate an API key. To create a new API key, click “Add new API key” and give it a name. Once it’s created, you’ll be given your API key to access your inFlow Inventory account (until revoked), so please keep it safe! You will also need your ‘companyId,’ an identifier for your inFlow Inventory account, which can be found on the integration page as well, with your API keys.
Sample API Requests
Getting started with any API can be tricky. Here are a few examples of some common requests to get back useful information. Replace {{companyId}} with your actual company ID.
Filtering
https://cloudapi.inflowinventory.com/{{companyId}}/sales-orders?filter[orderDate]={“fromDate“:“2021-03-01“,“toDate“:“2021-04-03“}&filter[isActive]=true&filter[smart]=18
Filtering is a great way to return only the information you want. Most requests can be filtered using various filters. The documentation shows which filter can be applied to each request.
In this example, we request sales orders from March 1st, 2021, to April 3rd, 2021, but only for active or non-canceled orders that contain the number 18.
filter[orderDate]={“fromDate”:“2021-03-01“,“toDate“:“2021-04-03“} is a good example of how to create and use a date object when filtering. You specify the start and end dates, and inFlow will return results for those dates.
filter[smart]=18 is a special filter that will search across multiple fields. For sales orders, this will search both the order number and the customer name for the number 18 and return results based on that. The smart filter will search different fields based on the endpoint you are calling and check the documentation to determine which fields it searches across.
Include & Pagination
https://cloudapi.inflowinventory.com/{{companyId}}/products?include=cost,defaultPrice,vendorItems,inventoryLines&count=50
To keep things as fast as possible, the API returns small chunks of data rather than all available data. This comes in 2 forms: pagination and includes.
Pagination limits the number of results returned at a time. By default, the API returns 20 results per request. You can increase this amount, or specify where in the results to return by telling the API to return results before or after a certain entityId. The above example uses count=50 to return 50 results instead of the default 20. You can find more about pagination in the documentation by clicking on the word request under Query Parameters in each section.
Includes statements are extremely powerful with inFlow’s API. Because so much information is linked to each other inside inFlow, by default, the API will return only the basic information of what you request. To get more information or related data to what you are requesting, you will need to use the includes parameter. Adding this returns the object specified in the includes request.
In the example above, we are requesting a list of products, but we are also including several additional objects of information. include=cost,defaultPrice,vendorItems,inventoryLines. We are also requesting that the product’s cost, default price, the vendors it’s listed under, and the inventory lines be included, which returns information such as the quantity on hand and the location of that stock. You can find all the different objects you can include in your requests in the documentation.
These include statements can also be linked to getting even more information
https://cloudapi.inflowinventory.com/{{companyId}}/sales-orders?include=lines.product.category
Here, include=lines.product.category returns not only the individual product lines on the sales order (include=lines), but also the product information (include=lines.product) such as product name, item type, barcode, etc. Going one step further, adding the .category also returns the category object that this product belongs to!
Questions/Support
If you have any questions about using the API or run into any issues, get in touch with the inFlow team.

0 Comments