> 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-payment.md).

# Save a Cash Payment

Saves a **cash payment voucher** in Logic ERP: money paid **out of a cash account** to one or more accounts – a supplier, an employee, an expense head, another account. You name the cash account and list the accounts paid with their amounts; Logic ERP credits the cash account with the total, debits each account, numbers the voucher and returns its number. The payments 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 Receipt](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/accounts/push/save-a-cash-receipt.md) (money received into 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 payments: `ActUserCode` must be a **cash** account; tax deducted at source (**TDS**) is taken off the cash paid; the configuration can refuse a payment that would leave the cash account short; and it can ask for **currency denominations**, which the API cannot send.

### **Endpoint**

| Name          | Detail                                    |
| ------------- | ----------------------------------------- |
| Address       | `https://your-server/api/SaveCashPayment` |
| 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 paid from, 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 payment: a value above `0` refuses the request. Leave it out.                                                                                                                                                  |
| `Bank_Charges_AccountCode` | text   | No                                     | empty      | Ignored on a cash payment.                                                                                                                                                                                                           |
| `Bank_Charges_ActCode`     | number | No                                     | –          | Ignored.                                                                                                                                                                                                                             |
| `ListAccounts`             | list   | Yes                                    | empty list | The accounts paid, one entry per line of the voucher – see below.                                                                                                                                                                    |

**Request fields – `ListAccounts`**

| Field                 | Type   | Required | Default  | Meaning                                                                                                                                                                                                                                                                                                                                                                 |
| --------------------- | ------ | -------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `AccountCode`         | text   | Yes      | –        | The account paid (debited), by its account code in Logic ERP. Any type of account is accepted: supplier, customer, employee, expense, another cash or bank account.                                                                                                                                                                                                     |
| `Amount`              | number | Yes      | `0`      | The amount paid to this account. Must be above `0`.                                                                                                                                                                                                                                                                                                                     |
| `Discount`            | number | No       | `0`      | A discount 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    | A reference number for the line (for example a slip or receipt number), up to 25 characters. 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 reference 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 payment. 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` | The amount TDS is worked out on, when it should differ from `Amount`. Used only when `AccountCode` is linked to a TDS type in Logic ERP; `0` or left out means `Amount`.                                                                                                                                                                                                |

### **Rules Logic ERP applies**

* **Debit and credit.** Each account in `ListAccounts` is **debited** with its `Amount` plus its `Discount`. The cash account is **credited** with the total of all amounts, less any TDS deducted, and the discount account 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) entry: its full amount stays open in the account's ledger, to be adjusted against bills later in Logic ERP.
* **TDS.** When an account in `ListAccounts` is linked to a TDS type in Logic ERP (any TDS type except one set up for TDS on goods), Logic ERP deducts TDS automatically on `Amount_For_TDS_Calc` (or `Amount`) at the type's rate – the type's higher rate above its limit when the type has a minimum limit and `Amount` is above it – plus the type's surcharge and cess. For a TDS type set up as TDS under GST, the account's GST state decides: in your company's GST state the cess and additional cess are added and no surcharge, in another state the surcharge only; an account with no GST state in Logic ERP gets the type's usual rates. The account is still debited with the full `Amount`; the TDS accounts of the type are credited with the tax and the cash account with the rest. The TDS is rounded when the configuration says so, and it is not linked to earlier entries of the account. Accounts without a TDS link are not affected and `Amount_For_TDS_Calc` is ignored for them.
* **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 payments name, per branch, a **cash payment configuration**. From it Logic ERP applies: the numbering, TDS rounding, the discount account, the cash account limit check, the cash-short 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 credited to the discount account named in the configuration, which must be an income or expense 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.
* **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.
* **Cash short.** When the configuration does not allow the cash account to go short, a payment that would take the cash account's balance on the voucher date (in that branch) below zero is refused with `Cash Short.... Cannot allow saving.`
* **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: `PY`, the voucher date as `yyyyMMdd`, then the next number for that day in the branch, for example `PY202611051`. A configuration with a numbering prefix gives numbers like `PYMUM-2611-14` instead: `PY`, 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.
* **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, so a voucher for an earlier year cannot be sent. 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 payment 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 payments.

### **Example request**

```json
{
  "BranchCode": 2,
  "BranchShortName": "",
  "ActUserCode": "CASH01",
  "VoucherDate": "2026-11-05",
  "Narration": "Petty cash payments – Karol Bagh store",
  "Remarks_1": "Week 45",
  "Remarks_2": "",
  "ListAccounts": [
    {
      "AccountCode": "EXP-FRT",
      "Amount": 1250.00,
      "Discount": 0,
      "Narration": "Freight on inward parcels",
      "DD_Cheque_No": "SLIP-2211",
      "DD_Cheque_Date": "2026-11-05",
      "CompanyName": "",
      "Cost_Center": "",
      "Amount_For_TDS_Calc": 0
    },
    {
      "AccountCode": "SUP0148",
      "Amount": 4800.00,
      "Discount": 0,
      "Narration": "Advance for tailoring job work",
      "DD_Cheque_No": "",
      "DD_Cheque_Date": "",
      "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 payment of ₹1.00 from the cash account `1` to the test party `APITESTS01`. Set `VoucherDate` to today's date and keep the small amount and the "API TEST" values.

## Save a Cash Payment

> Saves a cash payment voucher in Logic ERP: money paid out of a cash account to one or more accounts – a supplier, an employee, an expense head, another account. You name the cash account and list the accounts paid with their amounts; Logic ERP credits the cash account with the total, debits each account, numbers the voucher and returns its number. The payments 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":{"/SaveCashPayment":{"post":{"tags":["Accounts - Push"],"operationId":"SaveCashPayment","summary":"Save a Cash Payment","description":"Saves a cash payment voucher in Logic ERP: money paid out of a cash account to one or more accounts – a supplier, an employee, an expense head, another account. You name the cash account and list the accounts paid with their amounts; Logic ERP credits the cash account with the total, debits each account, numbers the voucher and returns its number. The payments 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 paid from, 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 paid (debited), by its account code in Logic ERP. Any type of account is accepted: supplier, customer, employee, expense, another cash or bank account."},"Amount":{"type":"number","description":"The amount paid to this account. Must be above `0`."},"Discount":{"type":"integer","description":"A discount 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":"A reference number for the line (for example a slip or receipt number), up to 25 characters. 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 reference 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":"The amount TDS is worked out on, when it should differ from `Amount`. Used only when `AccountCode` is linked to a TDS type in Logic ERP; `0` or left out means `Amount`."}},"required":["AccountCode","Amount"]},"description":"The accounts paid, 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 `PY202611051`. `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 `PY202611051`. `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": "PY202611051",
  "Status": true,
  "Message": "",
  "LastSavedCode": 48213,
  "request_ID": "3b8f0c52-7d1e-4a96-b0e4-5c2a9f81d6e7"
}
```

### **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 number is already saved for the account on the cash payment shown.                                                                                                     | Check whether the payment 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 or expense 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 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.   |
| `Cash/Bank Account Balance Not Within Limit. Exceeding by Rs…`                                        | The configuration's limit check is on and this payment would take the cash account's balance beyond the limit set for it.                                                   | Send a smaller payment, or ask your Logic ERP team.                             |
| `Cash Short.... Cannot allow saving.`                                                                 | The configuration does not allow the cash account to go short, and this payment would take its balance on the voucher date below zero.                                      | Send a smaller payment, or ask your Logic ERP team.                             |
| `Cost Center selection required..... Please select cost center...`                                    | The configuration makes a cost centre compulsory and the line has none.                                                                                                     | Send `Cost_Center`.                                                             |
| `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.                                  |
| `Invalid Payment Method : …`                                                                          | `PaymentMethod` is not one of the listed values.                                                                                                                            | Leave it out, or send a listed value.                                           |
| `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.                                   |
| 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). 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-payment.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.
