> For the complete documentation index, see [llms.txt](https://kb.logicerp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/overview.md).

# Overview

The **Logic ERP API** lets another application exchange data with Logic ERP over the internet: a web shop, a POS, a warehouse app, a mobile app or another ERP. Every call is a simple web request that sends and receives **JSON**.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FUdXchhhnPBtZVMZNz8Md%2Fimage.png?alt=media&#x26;token=b1d53376-c3ce-4d28-b7a3-f4e6b86e19ba" alt=""><figcaption></figcaption></figure>

### **Push and Pull**

The API works in two directions:

* **Push** – your application **sends** a document or master to Logic ERP, and Logic ERP saves it exactly as if it had been entered on its own screen. Examples: save a sale invoice from your web shop, create a new item, record attendance from a gate machine.
* **Pull** – your application **fetches** data from Logic ERP. Examples: read the sale invoices saved today, read the stock in hand of a list of barcodes, read the item master to update your web shop.

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FMKCSbbK8xe231fDndvQz%2Fimage.png?alt=media&#x26;token=f28f7e36-1093-486b-818f-a4cd2c6d695c" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4031188996-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXMVkjt8zqHBQX1c9QvFS%2Fuploads%2FEkyBQfhbXkF534Sj1fB2%2Fimage.png?alt=media&#x26;token=15147ddf-2b8b-47f2-b1c5-b00eca050092" alt=""><figcaption></figcaption></figure>

### **What you need before you start**

Your Logic ERP support team sets up an **API site** for your company and gives you:

| Item                   | What it is                                                                                                                                                                               |
| ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| API address            | The address of your API site, for example `https://your-server/api/`. Each endpoint is this address followed by the endpoint name, for example `https://your-server/api/GetStockInHand`. |
| User name and password | The login for your API site. Every request must send it (see below).                                                                                                                     |
| Licensed endpoints     | The list of endpoints your licence covers. An endpoint that is not licensed answers with a licence message instead of data.                                                              |

One API site serves **one company**. If you work with more than one company, you get a separate API site (address and login) for each.

### **Sending a request**

Every endpoint is called the same way:

| Name          | Detail                                                                                                |
| ------------- | ----------------------------------------------------------------------------------------------------- |
| Method        | `POST` – for every Push and Pull endpoint                                                             |
| Address       | Your API address followed by the endpoint name, for example `https://your-server/api/SaveSaleInvoice` |
| Authorization | **Basic Auth** – the user name and password of your API site                                          |
| Content type  | `application/json`                                                                                    |
| Body          | The request JSON shown on the endpoint's page                                                         |

A request without a login is refused with **401 Unauthorized**. A request with a wrong user name or password is refused with an error response.

### **How the documentation is arranged**

The endpoints are grouped by module, the same way as the Logic ERP menu, and each module has a **Push** and a **Pull** section:

* **Masters** – items, accounts (parties), retail customers, branches, schemes and coupons
* **Sale** – sale invoices, sale returns, sale challans, stock transfer out, GR details, gift vouchers, footfalls
* **Purchase** – purchase vouchers, purchase returns, purchase challans, stock transfer in, physical verification
* **Orders** – sale orders, purchase orders and indents, delivery orders, delivery notes, packing slips
* **Inventory** – stock issue and receipt, godown transfer, stock in hand
* **Accounts** – cash and bank vouchers, journal vouchers, party ledger
* **Payroll** – attendance
* **Production** – job orders and issue for processing

Each endpoint page has the same parts: what the endpoint does, the address, every request field with its meaning, the rules Logic ERP applies, an example request, the response fields and the messages you may see.

Read [How Every API Call Works](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/how-every-api-call-works.md) first. It explains the parts that are the same for every endpoint: the response, branches and dates, fetching only new or changed records, and the common messages.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
