
API integration in plain words
An API is a door through which programs exchange data. It removes manual file swapping.
Programmers say "API" all the time, while managers are too shy to ask what it means. The idea is actually simple: an API is a set of rules by which one program asks another for data or sends data to it. In stock counting it removes the need to upload files back and forth by hand. Below: what an API is, what data travels during a count and when it beats exchanging files.
What an API is
Picture a restaurant. You (one program) place an order with the waiter (the API), the waiter carries it to the kitchen (a second program) and brings back the finished dish. You never enter the kitchen, and the waiter accepts only what is on the menu. An API works the same way: one program sends another only permitted requests and gets an answer. The request usually travels over the internet as plain text in a format called JSON.
What data travels in a stock count
A count involves two flows:
- Before counting, your system (1C, an ERP or a website) sends the counting software a list of items: article, name, code, balance.
- During or after the count, the counting software returns the result: counted quantity, time, worker.
Session status travels too: "started", "finished". The benefit is clear: no manual list upload, codes are not damaged by copying (leading zeros survive), the risk of counting against a stale list falls, and the result reaches the books within minutes. The connection should exist only between your system and the counting software: it is protected by a token and not left open to everyone.
A few terms
When talking to a developer you will often hear these words:
- Endpoint: the exact address a request is sent to, for example the "get the item list" address.
- Token: a long secret string by which a program identifies itself. Treat it like a password: do not paste it in chats, do not write it in an open file, replace it when someone leaves.
- Webhook: a "the work is done" message. When a session closes, the counting software signals your address by itself, so there is no need to ask "finished yet?" every minute.
- JSON: a text format that writes data as "key: value" pairs, in effect a text version of an Excel table.
- Rate limit: how many requests you may send per minute. Go over it and the system stops answering for a while.
- Error codes: 200 "all fine", 401 "no access", 404 "not found", 500 "server error".
File or API: which do you need
An example. An online shop has two warehouses. Every morning the system sends the counting software balances that reflect yesterday's sales, a storekeeper counts thirty or forty positions, the differences return to the system in the evening and the manager gets a task to review them. With files, someone would upload and download by hand every day; with an API, a person only counts and approves.
A file is enough when you count once or twice a year, have one warehouse and one person uploads the list in ten minutes. An API is better when cycle counts run daily or weekly, there are several warehouses or branches, an online shop's stock changes hourly, or manual transfer often causes mistakes.
Consider the cost too. Setting up and testing an API takes developer time, and afterwards it must be maintained: when either side changes, the connection has to be updated. For a small business, exchanging files is often cheaper and more reliable.
A checklist before launch
Before briefing a developer, prepare answers to these questions:
- Which way does the data go: the list from your system to the counting software, and the result back?
- Which fields are needed: article, code, name, balance, unit, zone?
- How often: once before the count or every hour?
- What happens on error: should a request be repeated if the connection drops, and how do you avoid receiving one result twice?
- Testing: will it be tried on a copy first rather than on the live database?
- Whom do you contact if the system stops working?
Conclusion
An API is not magic but a plain agreement: who sends what to whom, in which form and when. Its value shows where counts are frequent and data is plentiful. It is wise to prove the process with files first. If you would rather hand the count to specialists, StockCheck delivers the result as Excel, PDF or a file for 1C.