> 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/accounts/push/save-a-cash-receipt.md).

# Save a Cash Receipt

Saves a **cash receipt voucher** in Logic ERP: money received **into a cash account** from one or more accounts – a customer paying in cash, a refund from a supplier, any other receipt. You name the cash account and list the accounts the money came from with their amounts; Logic ERP debits the cash account with the total, credits each account, numbers the voucher and returns its number. The receipts are saved **on account** – they are not adjusted against bills.

This is one of four related endpoints that share the same request. The others are [Save a Cash Payment](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/accounts/push/save-a-cash-payment.md) (money paid out of a cash account), [Save a Bank Payment](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/accounts/push/save-a-bank-payment.md) and [Save a Bank Receipt](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/accounts/push/save-a-bank-receipt.md). What is particular to cash receipts: `ActUserCode` must be a **cash** account; the accounts in `ListAccounts` are **credited**; the configuration can keep a register of **receipt numbers** and can ask for **currency denominations** (which the API cannot send); and no TDS or tax collected at source (TCS) is worked out on the lines.

### **Endpoint**

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

The response envelope, branches, dates, queueing and the common messages 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**

Field names are not case-sensitive. Codes and names must match what is stored in Logic ERP: capitals do not matter and spaces at the end are ignored, but a space at the start makes the value not found.

| Field                      | Type   | Required                               | Default    | Meaning                                                                                                                                                                                                                              |
| -------------------------- | ------ | -------------------------------------- | ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `BranchCode`               | number | Yes, unless you send `BranchShortName` | `0`        | The branch the voucher belongs to, by Logic ERP's branch number (`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)). |
| `BranchShortName`          | text   | No                                     | empty      | The branch by its short name, used only when `BranchCode` is `0` or less. Note the spelling: no underscore, unlike some other endpoints. With neither field, the request is refused.                                                 |
| `ActUserCode`              | text   | Yes                                    | –          | The **cash account** the money is received into, by its account code in Logic ERP. It must be an account of the type *Cash*; a bank or any other account is refused.                                                                 |
| `VoucherDate`              | date   | No                                     | today      | The voucher date, `yyyy-MM-dd`. It must fall in the **current** financial year.                                                                                                                                                      |
| `Narration`                | text   | No                                     | none       | Narration of the cash account's line, up to 250 characters.                                                                                                                                                                          |
| `Remarks_1`, `Remarks_2`   | text   | No                                     | empty      | Remarks 1 and 2 of the voucher, up to 30 characters each. Spaces at the ends are removed.                                                                                                                                            |
| `Bank_Charges`             | number | No                                     | `0`        | Not allowed on a cash receipt: a value above `0` refuses the request. Leave it out.                                                                                                                                                  |
| `Bank_Charges_AccountCode` | text   | No                                     | empty      | Ignored on a cash receipt.                                                                                                                                                                                                           |
| `Bank_Charges_ActCode`     | number | No                                     | –          | Ignored.                                                                                                                                                                                                                             |
| `ListAccounts`             | list   | Yes                                    | empty list | The accounts the money came from, one entry per line of the voucher – see below.                                                                                                                                                     |

**Request fields – `ListAccounts`**

| Field                 | Type   | Required | Default  | Meaning                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------- | ------ | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccountCode`         | text   | Yes      | –        | The account the money came from (credited), by its account code in Logic ERP. Any type of account is accepted: customer, supplier, employee, income, another cash or bank account.                                                                                                                                                                                      |
| `Amount`              | number | Yes      | `0`      | The amount received from this account. Must be above `0`.                                                                                                                                                                                                                                                                                                               |
| `Discount`            | number | No       | `0`      | A discount allowed on this line, `0` or more. It needs a discount account in the configuration – see the rules.                                                                                                                                                                                                                                                         |
| `Narration`           | text   | No       | none     | Narration of this line, up to 250 characters.                                                                                                                                                                                                                                                                                                                           |
| `DD_Cheque_No`        | text   | No       | empty    | The receipt number you gave the customer, up to 25 characters (up to 15 when the configuration keeps a receipt-number register – see the rules). It becomes the line's reference number in the account's ledger; when empty, the voucher number is used.                                                                                                                |
| `DD_Cheque_Date`      | date   | No       | none     | A date stored with the receipt number, `yyyy-MM-dd`. A value that is not a date is ignored without a message.                                                                                                                                                                                                                                                           |
| `PaymentMethod`       | text   | No       | `Cheque` | Stored with the line only; it has no effect on a cash receipt. If you send it, it must be one of `D.D.`, `Cheque`, `Transfer`, `Pay Order`, `Cash`, `UPI`, `NEFT`, `RTGS` (capitals and spaces around it do not matter) – any other value refuses the request. `Cash` is allowed only on a line whose `AccountCode` is a cash account; on any other line it is refused. |
| `CompanyName`         | text   | No       | none     | A company from Logic ERP's company master, by its exact name, recorded on the line for company-wise accounts.                                                                                                                                                                                                                                                           |
| `Cost_Center`         | text   | No       | none     | A cost centre, by its name in Logic ERP, recorded on the line.                                                                                                                                                                                                                                                                                                          |
| `Amount_For_TDS_Calc` | number | No       | `Amount` | Ignored on a cash receipt.                                                                                                                                                                                                                                                                                                                                              |

### **Rules Logic ERP applies**

* **Debit and credit.** The cash account is **debited** with the total of all amounts. Each account in `ListAccounts` is **credited** with its `Amount` plus its `Discount`, and the discount account is debited with the total discount. You do not send the cash side, and there is nothing to balance.
* **How accounts are found.** `ActUserCode` is looked up among cash accounts by account code. `AccountCode` is looked up among all accounts by account code. A line whose `AccountCode` is the cash account itself is refused.
* **No bill-wise adjustment.** There is no field for bills. Every line is saved as an unadjusted (on-account) receipt: its full amount stays open in the account's ledger, to be adjusted against the customer's bills later in Logic ERP.
* **Narration and remarks.** `Narration` (top level) goes on the cash account's line; each line's `Narration` on that account's line. `Remarks_1` and `Remarks_2` are saved on the voucher.
* **Configuration.** Your API site's settings for cash receipts name, per branch, a **cash receipt configuration**. From it Logic ERP applies: the numbering, the receipt-number register, the discount account, the cash account limit check, the currency-denomination option, and the option that makes a cost centre compulsory (checked on every line). Its other options are not applied, and the series chosen in the settings has no effect. When no settings are saved for the branch, none of these options applies and the voucher is numbered day-wise.
* **Discount.** A line's `Discount` is debited to the discount account named in the configuration, which must be an income, expense or liability account. When the configuration names none – also when no settings are saved for the branch – a request with a `Discount` above `0` is refused with `Discount account is not set in the cash / bank configuration`. A negative `Discount` is refused.
* **TDS and TCS.** No TDS or tax collected at source (TCS) is worked out on a cash receipt, also for an account linked to a TDS or TCS type in Logic ERP: no tax lines are added to the voucher. `Amount_For_TDS_Calc` is ignored.
* **Limit check.** When the configuration's limit check is on and a limit is set for the cash account in Logic ERP, a voucher that would take the account's balance beyond that limit is refused with the *Not Within Limit* message.
* **Currency denominations.** When the configuration asks for currency denominations, every request is refused with `Cash denominations are required by the cash / bank configuration and cannot be sent through the API`, because the API has no denomination fields. Ask your Logic ERP team to choose, for your API site, a configuration that does not ask for denominations.
* **Number.** Day-wise by default: `CR`, the voucher date as `yyyyMMdd`, then the next number for that day in the branch, for example `CR202611053`. A configuration with a numbering prefix gives numbers like `CRMUM-2611-14` instead: `CR`, the prefix, an optional year / month / day part, and the next number of that series in the branch, so numbering starts again with each new date part and each financial year.
* **Receipt-number register.** When the configuration keeps a register of receipt numbers, each line's `DD_Cheque_No` (when sent) is added to it. It must then be at most 15 characters. The register itself is not checked: a receipt number already used for another account can be saved again (see *Duplicates*).
* **Date and financial year.** The voucher is saved in the financial year of the day the request arrives. A `VoucherDate` outside that year is refused. The request is also refused when `VoucherDate` is on or before the lock date in the access rights of the Logic ERP user linked to your API site.
* **Duplicates.** A line's `DD_Cheque_No`, when sent, is checked: the same number twice for one account in a request is refused, and so is a number already saved for that account on a cash receipt of the same branch in the financial year the voucher is saved in. Lines without `DD_Cheque_No` are not checked, so a request without it that succeeds always saves a new voucher. Check `Status` before you resend.
* **All or nothing.** The voucher and all its lines are saved together. If anything fails, nothing is saved.
* **Switching off.** Your support team can switch this endpoint off per branch. Then nothing is saved and the answer has `Status: true` with the *In-Active* sentence in `Message` (as explained in How Every API Call Works).
* Your Logic ERP licence must include the API for cash receipts.

### **Example request**

```json
{
  "BranchCode": 2,
  "BranchShortName": "",
  "ActUserCode": "CASH01",
  "VoucherDate": "2026-11-05",
  "Narration": "Cash collected at counter",
  "Remarks_1": "Collection run 3",
  "Remarks_2": "",
  "ListAccounts": [
    {
      "AccountCode": "CU20417",
      "Amount": 3500.00,
      "Discount": 0,
      "Narration": "Part payment against November bills",
      "DD_Cheque_No": "RC-5521",
      "DD_Cheque_Date": "2026-11-05",
      "CompanyName": "",
      "Cost_Center": "",
      "Amount_For_TDS_Calc": 0
    }
  ]
}
```

### **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: each send saves a new cash receipt of ₹2.00 into the cash account `1` from the test party `APITESTS01`. Set `VoucherDate` to today's date and keep the small amount and the "API TEST" values.

## Save a Cash Receipt

> Saves a cash receipt voucher in Logic ERP: money received into a cash account from one or more accounts – a customer paying in cash, a refund from a supplier, any other receipt. You name the cash account and list the accounts the money came from with their amounts; Logic ERP debits the cash account with the total, credits each account, numbers the voucher and returns its number. The receipts are saved on account – they are not adjusted against bills.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Accounts - 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":{"/SaveCashReceipt":{"post":{"tags":["Accounts - Push"],"operationId":"SaveCashReceipt","summary":"Save a Cash Receipt","description":"Saves a cash receipt voucher in Logic ERP: money received into a cash account from one or more accounts – a customer paying in cash, a refund from a supplier, any other receipt. You name the cash account and list the accounts the money came from with their amounts; Logic ERP debits the cash account with the total, credits each account, numbers the voucher and returns its number. The receipts are saved on account – they are not adjusted against bills.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"BranchCode":{"type":"integer","description":"The branch the voucher belongs to, by Logic ERP's branch number (`Branch_Code` in Get Branch Info)."},"BranchShortName":{"type":"string","description":"The branch by its short name, used only when `BranchCode` is `0` or less. Note the spelling: no underscore, unlike some other endpoints. With neither field, the request is refused."},"ActUserCode":{"type":"string","description":"The cash account the money is received into, by its account code in Logic ERP. It must be an account of the type Cash; a bank or any other account is refused."},"VoucherDate":{"type":"string","description":"The voucher date, `yyyy-MM-dd`. It must fall in the current financial year."},"Narration":{"type":"string","description":"Narration of the cash account's line, up to 250 characters."},"Remarks_1":{"type":"string","description":"Remarks 1 and 2 of the voucher, up to 30 characters each. Spaces at the ends are removed."},"Remarks_2":{"type":"string","description":"Remarks 1 and 2 of the voucher, up to 30 characters each. Spaces at the ends are removed."},"ListAccounts":{"type":"array","items":{"type":"object","properties":{"AccountCode":{"type":"string","description":"The account the money came from (credited), by its account code in Logic ERP. Any type of account is accepted: customer, supplier, employee, income, another cash or bank account."},"Amount":{"type":"number","description":"The amount received from this account. Must be above `0`."},"Discount":{"type":"integer","description":"A discount allowed on this line, `0` or more. It needs a discount account in the configuration – see the rules."},"Narration":{"type":"string","description":"Narration of this line, up to 250 characters."},"DD_Cheque_No":{"type":"string","description":"The receipt number you gave the customer, up to 25 characters (up to 15 when the configuration keeps a receipt-number register – see the rules). It becomes the line's reference number in the account's ledger; when empty, the voucher number is used."},"DD_Cheque_Date":{"type":"string","description":"A date stored with the receipt number, `yyyy-MM-dd`. A value that is not a date is ignored without a message."},"CompanyName":{"type":"string","description":"A company from Logic ERP's company master, by its exact name, recorded on the line for company-wise accounts."},"Cost_Center":{"type":"string","description":"A cost centre, by its name in Logic ERP, recorded on the line."},"Amount_For_TDS_Calc":{"type":"integer","description":"Ignored on a cash receipt."}},"required":["AccountCode","Amount"]},"description":"The accounts the money came from, one entry per line of the voucher – see below."}},"required":["ActUserCode","ListAccounts"]}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"LastSavedDocNo":{"type":"string","description":"The voucher number, for example `CR202611053`. `null` when not saved."},"Status":{"type":"boolean","description":"`true` when the voucher was saved. Also `true`, with nothing saved, when the endpoint is switched off – see above."},"Message":{"type":"string","description":"Empty when saved; the reason when not saved."},"LastSavedCode":{"type":"integer","description":"Logic ERP's internal number of the new voucher; `0` when not saved."},"request_ID":{"type":"string","description":"The ID of this request – quote it to support. Empty when the request was refused before saving started (an unknown `BranchShortName`)."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response**

| Field            | Type         | Meaning                                                                                                                                |
| ---------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
| `Status`         | true / false | `true` when the voucher was saved. Also `true`, with nothing saved, when the endpoint is switched off – see above.                     |
| `Message`        | text         | Empty when saved; the reason when not saved.                                                                                           |
| `LastSavedCode`  | number       | Logic ERP's internal number of the new voucher; `0` when not saved.                                                                    |
| `LastSavedDocNo` | text         | The voucher number, for example `CR202611053`. `null` when not saved.                                                                  |
| `request_ID`     | text         | The ID of this request – quote it to support. Empty when the request was refused before saving started (an unknown `BranchShortName`). |

### **Example response**

```json
{
  "LastSavedDocNo": "CR202611053",
  "Status": true,
  "Message": "",
  "LastSavedCode": 48219,
  "request_ID": "a07d4e1c-92b5-4f3a-8c61-0e5b7d2f94ab"
}
```

### **Messages you may see**

| Message                                                                                               | Meaning                                                                                                                                                                                | What to do                                                                      |
| ----------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- |
| `Invalid Voucher Date...`                                                                             | `VoucherDate` is not a date.                                                                                                                                                           | Send `yyyy-MM-dd`.                                                              |
| `Please Define Cash Account User Code (ActUserCode) to Continue...`                                   | `ActUserCode` is empty.                                                                                                                                                                | Send the cash account's code.                                                   |
| `Invalid Account User Code : …`                                                                       | No cash account has that code (also when the code is a bank or other account).                                                                                                         | Send the code of an account of the type *Cash*.                                 |
| `Invalid Amount againts Account Code : …`                                                             | A line has `Amount` `0` or less (the code shown is that line's `AccountCode`).                                                                                                         | Send an amount above `0`.                                                       |
| `Invalid Discount against Account Code : …`                                                           | A line has a negative `Discount`.                                                                                                                                                      | Send `0` or more.                                                               |
| `ListAccounts is required`                                                                            | `ListAccounts` is empty or `null`.                                                                                                                                                     | Send at least one line.                                                         |
| `Invalid Account Code...`                                                                             | A line has no `AccountCode`.                                                                                                                                                           | Send the account code.                                                          |
| `Invalid Account Code : …`                                                                            | No account has that code.                                                                                                                                                              | Send the code exactly as in Logic ERP.                                          |
| `Account Code cannot be the cash / bank account itself : …`                                           | A line's `AccountCode` is the cash account of `ActUserCode`.                                                                                                                           | Leave that line out.                                                            |
| `Invalid Company Name : …`                                                                            | No company has that name.                                                                                                                                                              | Send the name exactly as in Logic ERP, or leave it empty.                       |
| `Invalid Cost Center Name : …`                                                                        | No cost centre has that name.                                                                                                                                                          | Send the name exactly as in Logic ERP, or leave it empty.                       |
| `Duplicate DD_Cheque_No : … against Account Code : …`                                                 | Two lines for the same account carry the same `DD_Cheque_No`.                                                                                                                          | Send each number once per account.                                              |
| `DD_Cheque_No : … already exists in Voucher No. … against Account Code : …`                           | That receipt number is already saved for the account on the cash receipt shown.                                                                                                        | Check whether the receipt was sent before; otherwise send another number.       |
| `Date Not Within The Current Financial Year...`                                                       | `VoucherDate` is outside the financial year of today.                                                                                                                                  | Send a date in the current financial year.                                      |
| `Bank_Charges is allowed only on bank payments`                                                       | `Bank_Charges` is above `0`.                                                                                                                                                           | Leave out `Bank_Charges`.                                                       |
| `Branch_Code or Branch_Short_Name is required.`                                                       | Neither `BranchCode` nor `BranchShortName` was sent.                                                                                                                                   | Send the branch.                                                                |
| `Discount account is not set in the cash / bank configuration`                                        | A line has a `Discount` above `0`, and the configuration names no discount account (or none that is an income, expense or liability account), or no settings are saved for the branch. | Send `Discount` as `0`, or ask your Logic ERP team to set the discount account. |
| `Cash/Bank Account Balance Not Within Limit. Exceeding by Rs…`                                        | The configuration's limit check is on and this receipt would take the cash account's balance beyond the limit set for it.                                                              | Ask your Logic ERP team.                                                        |
| `Invalid Payment Method : …`                                                                          | `PaymentMethod` is not one of the listed values.                                                                                                                                       | Leave it out, or send a listed value.                                           |
| `Please select Cash A/c...`                                                                           | A line has `PaymentMethod` `Cash`, but its `AccountCode` is not a cash account.                                                                                                        | Send another `PaymentMethod`, or leave it out.                                  |
| `Cost Center selection required..... Please select cost center...`                                    | The configuration makes a cost centre compulsory and the line has none.                                                                                                                | Send `Cost_Center`.                                                             |
| `Modification rights not available for this date.....`                                                | `VoucherDate` is on or before the lock date of the API site's Logic ERP user.                                                                                                          | Send a later date or ask your Logic ERP team.                                   |
| `Cash denominations are required by the cash / bank configuration and cannot be sent through the API` | The configuration asks for currency denominations.                                                                                                                                     | Ask your Logic ERP team to choose a configuration that does not ask for them.   |
| A message saying a field allows a maximum number of characters, followed by the value and its length  | A text value is too long (for example a remark over 30 characters, or a `DD_Cheque_No` over 25 – over 15 with the receipt-number register). Nothing was saved.                         | Shorten the value.                                                              |
| `The operation was canceled.`                                                                         | Saving stopped at a later step without a reason. Nothing was saved.                                                                                                                    | Retry once; if it repeats, send the `request_ID` to support.                    |
| `Branch_Short_Name : … not exists.`                                                                   | No branch has the `BranchShortName` you sent.                                                                                                                                          | Send the short name exactly as in Logic ERP, or send `BranchCode`.              |
| A technical error with an empty `request_ID`                                                          | The request failed before Logic ERP started to save it; nothing was saved.                                                                                                             | Send the same request again.                                                    |
| Another technical error                                                                               | Saving failed inside Logic ERP; nothing was saved.                                                                                                                                     | Retry once; 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/accounts/push/save-a-cash-receipt.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.
