> 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/sale/push/save-retail-footfalls.md).

# Save Retail Footfalls

Records **footfalls** – the number of people who walked into a store – in Logic ERP, by branch, date and hour, so that Logic ERP's sale-analysis reports can compare visitors with bills. Send one or many counts in one call. Use it when the visitor count comes from a door counter, a camera system or another app instead of being keyed in at the store.

### **Endpoint**

| Name          | Detail                                        |
| ------------- | --------------------------------------------- |
| Address       | `https://your-server/api/SaveRetailFootFalls` |
| Method        | `POST`                                        |
| Authorization | Basic Auth                                    |

The response and the messages every endpoint can return are explained in [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).

### **Request fields**

The body is a **list** (a JSON array) of counts, even for one count; a single count sent without the `[ ]` is answered with the "no body" message (``Payload Request Can`t be null. Please Check...``, followed by a code in brackets) and `Status: false`. Field names are matched without regard to upper or lower case. Each count:

| Field              | Type   | Required | Default | Meaning                                                                                                                                                                                                                          |
| ------------------ | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BranchCode`       | number | Yes      | `0`     | Logic ERP's code of the store (`Branch_Code` in [Get Branch Info](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-branch-info.md)). Must be a branch that exists. |
| `FootFallDate`     | date   | Yes      | none    | The day of the visits, `yyyy-MM-dd`. Any date is accepted – past, future, or outside the financial years of the company.                                                                                                         |
| `FootFallTime`     | number | No       | `0`     | The **hour** of the visits, `1` to `23` (for example `14` for 2 pm to 3 pm). `0`, a negative number or leaving it out means "the hour at which Logic ERP receives the request". A value above `23` is refused.                   |
| `FootFallCategory` | text   | No       | empty   | Who visited: `MALE`, `MEN` or `MENS` for men, `FEMALE`, `WOMEN` or `WOMENS` for women, `KID` or `KIDS` for kids – in any capitals. Anything else, or empty, records the visitors **without a category**.                         |
| `Count`            | number | Yes      | `0`     | How many people walked in. `0` or a negative number is refused.                                                                                                                                                                  |

### **Rules Logic ERP applies**

* **One record per visitor.** Logic ERP stores each visitor separately, so a `Count` of `25` adds 25 footfalls. Send the count for the period, not each visit.
* **Nothing is replaced and nothing is checked for duplicates.** Every call adds to the footfalls already recorded for that branch, day and hour. Sending the same request twice counts the visitors twice, so do not re-send a request that answered `Status: true`, and send each hour's count once (or only the visitors added since your last call).
* **The time.** The visitors are recorded at the hour you send, with the minutes and seconds of (about) the moment Logic ERP processes the request; all visitors of one count get the same time. Reports that show footfalls by hour use the hour.
* **All or nothing.** Every count in the list is checked first; the first count that fails a check stops the request with its message, which does not say which count it was, and nothing is saved. The counts are then saved together: if one fails while saving, none are kept.
* An empty list (`[]`) saves nothing and answers `Status: true`.
* Footfalls are not tied to a financial year, so the date decides nothing beyond the day reported.

### **Example request**

Two hours of door-counter readings for one store:

```json
[
  {
    "BranchCode": 4,
    "FootFallDate": "2026-10-28",
    "FootFallTime": 11,
    "Count": 18
  },
  {
    "BranchCode": 4,
    "FootFallDate": "2026-10-28",
    "FootFallTime": 12,
    "Count": 27
  }
]
```

### **Test it**

Send a request to the Logic ERP **sandbox** (a test company) from this page: open the block below, enter the sandbox user name and password (ask your Logic ERP support team), change the request if you like, and press **Test it**. This really saves in the sandbox, so use test values like the example. Each send adds the footfalls again – there is no duplicate check.

## Save Retail Footfalls

> Records footfalls – the number of people who walked into a store – in Logic ERP, by branch, date and hour, so that Logic ERP's sale-analysis reports can compare visitors with bills. Send one or many counts in one call. Use it when the visitor count comes from a door counter, a camera system or another app instead of being keyed in at the store.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Sale - Push"}],"servers":[{"url":"https://demo.logicerp.com/api","description":"Logic ERP sandbox (test company)"}],"security":[{"basicAuth":[]}],"components":{"securitySchemes":{"basicAuth":{"type":"http","scheme":"basic","description":"The user name and password of your API site."}}},"paths":{"/SaveRetailFootFalls":{"post":{"tags":["Sale - Push"],"operationId":"SaveRetailFootFalls","summary":"Save Retail Footfalls","description":"Records footfalls – the number of people who walked into a store – in Logic ERP, by branch, date and hour, so that Logic ERP's sale-analysis reports can compare visitors with bills. Send one or many counts in one call. Use it when the visitor count comes from a door counter, a camera system or another app instead of being keyed in at the store.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"BranchCode":{"type":"integer","description":"Logic ERP's code of the store (`Branch_Code` in Get Branch Info). Must be a branch that exists."},"FootFallDate":{"type":"string","description":"The day of the visits, `yyyy-MM-dd`. Any date is accepted – past, future, or outside the financial years of the company."},"FootFallTime":{"type":"integer","description":"The hour of the visits, `1` to `23` (for example `14` for 2 pm to 3 pm). `0`, a negative number or leaving it out means \"the hour at which Logic ERP receives the request\". A value above `23` is refused."},"FootFallCategory":{"type":"string","description":"Who visited: `MALE`, `MEN` or `MENS` for men, `FEMALE`, `WOMEN` or `WOMENS` for women, `KID` or `KIDS` for kids – in any capitals. Anything else, or empty, records the visitors without a category."},"Count":{"type":"integer","description":"How many people walked in. `0` or a negative number is refused."}}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"Status":{"type":"boolean","description":"See the Status rules on this page."},"Message":{"type":"string","description":"Why the call failed, or a note. The reason may be followed by technical detail - read the first line."},"LastSavedCode":{"type":"integer","description":"See this page."},"request_ID":{"type":"string","description":"Logic ERP request number of this call."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response**

* `Status` – `true` when the footfalls were saved.
* `Message` – `Success` when saved; otherwise the reason (see below).
* `LastSavedCode` – always `0`.
* `request_ID` – the ID of this request – quote it to support.

### **Example response**

```json
{
  "Status": true,
  "Message": "Success",
  "LastSavedCode": 0,
  "request_ID": "8d41b7e2-3c05-4a9f-b6e1-0f2d7c9a5e34"
}
```

### **Messages you may see**

Nothing is saved when `Status` is `false`.

| Message                                                 | Meaning                                                                                | What to do                                                               |
| ------------------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `Invalid Branch Code...`                                | A count had `BranchCode` `0` or left out.                                              | Send the branch code for every count.                                    |
| `Branch Code ( … ) not exists in Database...`           | A count's `BranchCode` is not a branch in Logic ERP (the message shows the code sent). | Use a code from Get Branch Info.                                         |
| `Foot Fall Date not Defined...`                         | A count's `FootFallDate` was empty, left out or not a date.                            | Send the date as `yyyy-MM-dd`.                                           |
| `Foot Fall Count not Defined...`                        | A count's `Count` was `0`, negative or left out.                                       | Leave counts of zero out of the list.                                    |
| `Invalid Foot Fall Time ( … ). Hour must be 0 to 23...` | A count's `FootFallTime` is more than `23`.                                            | Send the hour as `0` to `23`.                                            |
| A technical error (with `Status: false`)                | Saving failed.                                                                         | Send the request again; if it repeats, send the `request_ID` to support. |


---

# 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/sale/push/save-retail-footfalls.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.
