> 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-a-sale-challan.md).

# Save a Sale Challan

Creates a **sale challan** in Logic ERP. A sale challan (delivery challan) records goods sent to a customer **without raising a sale invoice** – for approval, on consignment, or ahead of billing. The goods leave your branch's stock and the challan carries rates, discounts and amounts, but it is not a sale invoice: the sale is billed later, when the challan is converted into a sale invoice in Logic ERP. Use this endpoint when your system dispatches goods first and bills them later; use [Save a Sale Invoice](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/sale/push/save-a-sale-invoice.md) when the goods are billed at once.

### **Endpoint**

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

Also accepted: `https://your-server/api/SaveInvoice` with `"Doc_Type": "CH"` in the request – it is handled exactly like this endpoint.

The response envelope, branches, dates 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).

Send one challan per request. Field names are matched without regard to upper/lower case; fields not listed below are ignored. Do not send `null` for `LogicUserCode` or `AddlItemCode`; send `""` or leave the field out.

### **How it differs from Save a Sale Invoice**

The request is the same shape as for Save a Sale Invoice. What changes:

* The document is saved in a **sale-challan series** (`BillSeries`), not a sale-invoice series, and is numbered in that series.
* No TCS is worked out on a challan.
* Your API site's "order number must be filled and unique" setting is **not** applied to challans: `OrderNo` is stored but never checked.
* A challan is never exported automatically as a stock transfer.
* There is no endpoint to bill a challan: it is converted into a sale invoice in Logic ERP. A challan saved by mistake can be cancelled with [Cancel a Sale Challan](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/sale/push/cancel-a-sale-challan.md), sending the `LastSavedCode` returned here as `DocCode`.

### **Request fields**

| Field                                                                                                                                                                                                            | Type                           | Required | Default                    | Meaning                                                                                                                                                                                                                                                                                         |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | -------- | -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BranchCode`                                                                                                                                                                                                     | number                         | No       | `0`                        | The branch issuing the challan, 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`. With neither, Logic ERP falls back to a default branch – always send one.                                                                                                                                                     |
| `PartyUserCode`                                                                                                                                                                                                  | text                           | **Yes**  | –                          | The customer's **party code** (`User_Code` in [Get Party Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-party-master.md)). Must already exist.                                                                          |
| `BillSeries`                                                                                                                                                                                                     | text                           | No\*     | see rules                  | Name of a **sale-challan series** of that branch, for example `"DCH"`. \*If you leave it out, Logic ERP uses the challan series linked to the party, then the default series set for this endpoint in your API site; with none of these the request fails. A name that is not found is refused. |
| `Bill_Number`                                                                                                                                                                                                    | number                         | No       | `0`                        | A fixed challan number in `BillSeries`. `0` = Logic ERP gives the next number. Needs `BillSeries`. A number already used in that series in the branch is refused.                                                                                                                               |
| `Bill_Date`                                                                                                                                                                                                      | date                           | No       | today                      | Challan date, `yyyy-MM-dd`. It also decides the financial year. A value that is not a date is ignored (today is used).                                                                                                                                                                          |
| `Ext_Bill_No`                                                                                                                                                                                                    | text                           | No       | empty                      | Your own document number. When filled, it is saved as the challan's document number and returned in `Invoice_No`.                                                                                                                                                                               |
| `OrderNo`                                                                                                                                                                                                        | text                           | No       | empty                      | The customer's order number. Stored on the challan and returned in `PartyOrderNo`; not checked.                                                                                                                                                                                                 |
| `OrderDate`                                                                                                                                                                                                      | date                           | No       | empty                      | Date of the customer's order.                                                                                                                                                                                                                                                                   |
| `Order_Id`                                                                                                                                                                                                       | text                           | No       | empty                      | A further order reference. If your API site is set to copy the order number, `OrderNo` is copied into it.                                                                                                                                                                                       |
| `Sale_BillNo`, `Sale_Bill_Date`                                                                                                                                                                                  | text, date                     | No       | empty                      | A reference bill number and date stored on the challan.                                                                                                                                                                                                                                         |
| `Challan_No`, `Challan_Date`                                                                                                                                                                                     | text, date                     | No       | empty                      | A reference challan number and date stored on the challan (for example your dispatch note). They do not set the challan's own number.                                                                                                                                                           |
| `PaymentMode`                                                                                                                                                                                                    | text                           | No       | credit                     | `CASH` or `CREDIT`, in capitals. `CASH` saves the challan in cash mode, with the series' default customer as customer.                                                                                                                                                                          |
| `ActEntryPartyUserCode`                                                                                                                                                                                          | text                           | No       | the party                  | A different party code for the accounting entry. Must exist.                                                                                                                                                                                                                                    |
| `AgentName`                                                                                                                                                                                                      | text                           | No       | default agent              | Agent or broker, by name as in Logic ERP. Must exist.                                                                                                                                                                                                                                           |
| `TransporterName`                                                                                                                                                                                                | text                           | No       | the party's transporter    | Transporter, by name. Must exist.                                                                                                                                                                                                                                                               |
| `TransportMode`                                                                                                                                                                                                  | text                           | No       | empty                      | Mode of transport.                                                                                                                                                                                                                                                                              |
| `GRNo`, `GRDate`                                                                                                                                                                                                 | text, date                     | No       | empty                      | Goods-receipt (LR / GR) number and date.                                                                                                                                                                                                                                                        |
| `WayBillNo`                                                                                                                                                                                                      | text                           | No       | empty                      | A way bill of this branch that is not finalised; it is linked to the challan. A finalised way bill is refused.                                                                                                                                                                                  |
| `Tax_Region`                                                                                                                                                                                                     | text                           | No       | party, else series default | Tax region by its name in Logic ERP, for example `"GST (INCL.)"`. Must exist.                                                                                                                                                                                                                   |
| `GST_State_Code`                                                                                                                                                                                                 | text                           | No       | empty                      | GST state code for the place of supply. Used only when your API site is set to accept it; otherwise ignored.                                                                                                                                                                                    |
| `Tax_Form_Name`                                                                                                                                                                                                  | text                           | No       | empty                      | Tax form by name. Must exist.                                                                                                                                                                                                                                                                   |
| `CostCenter`                                                                                                                                                                                                     | text                           | No       | empty                      | Cost centre by name. Must exist.                                                                                                                                                                                                                                                                |
| `CurrencyName`, `ExchangeRate`                                                                                                                                                                                   | text, number                   | No       | empty, `0`                 | Foreign currency by name, with its rate (more than `0`).                                                                                                                                                                                                                                        |
| `Godown_Name`                                                                                                                                                                                                    | text                           | No       | empty                      | Godown to issue the stock from, by name. Must exist.                                                                                                                                                                                                                                            |
| `CreditDays`                                                                                                                                                                                                     | number                         | No       | Logic ERP's default        | Credit days; used when more than `0`.                                                                                                                                                                                                                                                           |
| `DeliveryAt`, `DeliveryAdd1`, `DeliveryAdd2`                                                                                                                                                                     | text                           | No       | empty                      | Delivery place and address lines.                                                                                                                                                                                                                                                               |
| `Cases`, `Weight`, `PVTMark`                                                                                                                                                                                     | text                           | No       | empty                      | Number of cases, weight and private mark.                                                                                                                                                                                                                                                       |
| `Remarks1`, `Remarks2`, `Remarks3`                                                                                                                                                                               | text                           | No       | series default remarks     | Remarks.                                                                                                                                                                                                                                                                                        |
| `Insurance_Policy_No`                                                                                                                                                                                            | text                           | No       | empty                      | Insurance policy number.                                                                                                                                                                                                                                                                        |
| `Declaration_No`, `DeclarationNo`                                                                                                                                                                                | text                           | No       | empty                      | Declaration number (two spellings; `Declaration_No` wins when both are sent).                                                                                                                                                                                                                   |
| `CD_P`, `TD_P`, `SpCD_P`                                                                                                                                                                                         | number                         | No       | `0`                        | Challan-level CD %, TD % and special CD %. Used when more than `0`; they also apply to every line that has none of its own.                                                                                                                                                                     |
| `Freight`, `Handling`, `SpDiscountRs`, `Adjustment_Rs`                                                                                                                                                           | number                         | No       | `0`                        | Freight, handling, special discount and adjustment in ₹. Used when more than `0`.                                                                                                                                                                                                               |
| `Ext_NetSale_Value`                                                                                                                                                                                              | number                         | No       | `0`                        | If not `0`, the challan's net amount worked out by Logic ERP must equal this value exactly, or nothing is saved.                                                                                                                                                                                |
| `RCU_Mem_Prefix`, `RCU_Mem_Number`, `RCU_Mobile_No`, `RCU_Email`, `RCU_First_Name`, `RCU_Last_Name`, `RCU_City`, `RCU_State`, `RCU_Country`, `RCU_PinCode`, `RCU_GST_No`, `Billing_Address1`, `Billing_Address2` | text (`RCU_Mem_Number` number) | No       | empty                      | A **retail customer** (member) for the challan – see the rules.                                                                                                                                                                                                                                 |
| `BillingAddress`, `ShippingAddress`                                                                                                                                                                              | object                         | No       | empty                      | Billing and shipping address printed on the challan. See the table below.                                                                                                                                                                                                                       |
| `LstItems`                                                                                                                                                                                                       | list                           | **Yes**  | –                          | The items. See the table below.                                                                                                                                                                                                                                                                 |
| `TenderDetails`                                                                                                                                                                                                  | list                           | No       | empty                      | How the challan is paid, if at all. See the table below.                                                                                                                                                                                                                                        |
| `DisplayError`                                                                                                                                                                                                   | text                           | No       | `"0"`                      | `"1"` = put the full technical error text in `Message` when something fails.                                                                                                                                                                                                                    |
| `Request_ID`                                                                                                                                                                                                     | text                           | No       | empty                      | Only for API sites set to store requests for later processing (see the rules). Otherwise ignored.                                                                                                                                                                                               |
| `Doc_Type`, `Doc_Code`, `STBranchCode`, `Token_No`, `InvoiceType`, `EntrySource`                                                                                                                                 | –                              | No       | –                          | **Ignored** by this endpoint.                                                                                                                                                                                                                                                                   |

**`LstItems`** — one entry per line. Lines are kept as sent; the same item may appear on several lines.

| Field                                                | Type   | Required                | Default                          | Meaning                                                                                                                                                                                                                                  |
| ---------------------------------------------------- | ------ | ----------------------- | -------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LogicUserCode`                                      | text   | Yes, or `AddlItemCode`  | empty                            | The **item code** shown in Logic ERP (`UserCode` in [Get Item Master](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/masters/pull/get-item-master.md)). Upper/lower case does not matter. |
| `AddlItemCode`                                       | text   | Yes, or `LogicUserCode` | empty                            | The item's additional code / barcode (`AddlItemCode` in Get Item Master). Used when `LogicUserCode` is empty or not found. When `LogicUserCode` is empty, any other barcode stored for the item is also accepted.                        |
| `Quantity`                                           | number | **Yes**                 | –                                | Quantity; must be more than `0`.                                                                                                                                                                                                         |
| `Rate`                                               | number | No                      | rate from the series' price list | Rate per unit in ₹. Used when more than `0`.                                                                                                                                                                                             |
| `Mrp`                                                | number | No                      | the lot's MRP                    | MRP; used when more than `0`.                                                                                                                                                                                                            |
| `Lot_No`                                             | text   | No                      | empty                            | A lot (batch) number. It must exist for the item, but it does **not** choose the lot: Logic ERP picks the stock itself. An unknown lot number is refused.                                                                                |
| `GodownName`                                         | text   | No                      | `Godown_Name`                    | Godown to issue this line from, by name. Must exist.                                                                                                                                                                                     |
| `CD_P`, `TD_P`, `SPCD_P`                             | number | No                      | challan-level value              | Line CD %, TD % and special CD %; used when more than `0`.                                                                                                                                                                               |
| `Scheme_Rs`, `SchemePerUnit`                         | number | No                      | `0`                              | Scheme discount in ₹ for the line / per unit.                                                                                                                                                                                            |
| `AdjustItem_Rs`, `AdjustmentRs`, `AdjustmentPerUnit` | number | No                      | `0`                              | Rate adjustments for the line / per unit.                                                                                                                                                                                                |
| `LabourPerUnit`                                      | number | No                      | branch-party-item default        | Labour per unit.                                                                                                                                                                                                                         |
| `ItemDescription`                                    | text   | No                      | empty                            | A description printed for the line.                                                                                                                                                                                                      |
| `Production_Unit`, `SaleOrSR`                        | –      | No                      | –                                | **Ignored.**                                                                                                                                                                                                                             |

**`BillingAddress`, `ShippingAddress`** — each has `Mobile_No`, `Contact_Person_Name`, `Company_Name`, `Address_1`, `Address_2`, `Location_Name`, `City_Name`, `State_Name`, `Country_Name`, `Pin_Code`, `Email_Id`, `Phone_Number` (all text). An address is saved only if at least one of contact person, address lines, city, company, country, state, location or mobile is filled. When `State_Name` matches a state in Logic ERP, the country is taken from that state.

**`TenderDetails`** — optional payment lines:

| Field           | Type   | Meaning                                                                                                      |
| --------------- | ------ | ------------------------------------------------------------------------------------------------------------ |
| `TenderType`    | text   | `CASH`, `CREDIT`, `CARD` or `GV` (gift voucher); upper/lower case does not matter. Other values are ignored. |
| `Amount`        | number | Amount in ₹ for this tender.                                                                                 |
| `CardName`      | text   | For `CARD`: the card name as set up in Logic ERP. Must exist.                                                |
| `CardNo`        | text   | For `CARD`: the card number; required. A new number is added to Logic ERP's card list.                       |
| `GiftVoucherNo` | text   | For `GV`: the gift voucher number.                                                                           |

### **Rules Logic ERP applies**

**Party, branch and date**

* The party is found by its code exactly as sent. It must be a customer, supplier or cash account; any other account is refused. A party locked for billing is refused, and so is a customer over the credit limit (when credit-limit checking is on in Logic ERP).
* The branch is `BranchCode`, else `BranchShortName`. The financial year comes from `Bill_Date`; without a valid `Bill_Date` the challan is dated today.

**Series and number**

* `BillSeries` is looked up among the **sale-challan series of the branch**; a name that is **not found** is refused with `Bill Series : … Not found for Branch Code :… in API Parameter..`. If it is empty, Logic ERP uses the challan series linked to the party in Logic ERP, then the default series set for this endpoint in your API site. Only when none exists does the request fail. Check `Invoice_No` in the answer.
* With `Bill_Number` the challan gets that number; without it, the next free number of the series. `Ext_Bill_No`, when sent, becomes the document number shown in Logic ERP and returned in `Invoice_No`.

**Items and stock**

* Each item is found by `LogicUserCode`, else `AddlItemCode`. An unknown code stops the request.
* Logic ERP picks the lots to issue from at the branch (in `GodownName` / `Godown_Name` when sent). When Logic ERP is set not to allow negative stock, only **lots that have stock** are used, and if the stock is short for any item nothing is saved and the message names the item, the quantity asked for and the quantity found. When negative stock is allowed, stock is not checked.
* `Rate`, `Mrp` and the line discounts are used when more than `0`; otherwise the series' price list and the item's defaults apply. Lines are kept as sent.
* Schemes set up in Logic ERP are applied to the challan, then totals and taxes are worked out from the tax region: `Tax_Region` when sent, otherwise the tax region set for the party (for this branch, else the party's own), otherwise the series default.

**Retail customer**

* If `RCU_Mem_Number`, `RCU_Mobile_No` or `RCU_Email` is filled, the challan is linked to a retail customer. `RCU_Mem_Prefix`, `RCU_Mobile_No` and `RCU_First_Name` are then required. The customer is found by membership series + number (when `RCU_Mem_Number` is filled) or by mobile number; if none is found, a **new retail customer is created** from the `RCU_` fields, with `Billing_Address1` / `Billing_Address2` as its address. Depending on your setup, the e-mail or the mobile number is that customer's ID and must then be filled.

**Saving**

* The challan is saved in one step: if anything fails, no challan is saved. A retail customer or card number created on the way is kept.
* Your API site can be set to **save in the background**. Then the answer comes back at once with `Status: false`, an empty `Message` and a `request_ID`; the challan is saved a moment later. Look the result up by that `request_ID` with the `TokenStatus` endpoint.
* Your API site can be set to only **store** requests for a separate processing program. Then the answer is `Status: false` with *Request is pending for processing...* – the request was stored, not refused. The processing program sends it again with `Request_ID`; a request already processed returns its stored answer.

> **Known issue – an apostrophe in a code or name.** Codes and names you send (party code, series, lot number, order number, tax region, godown, agent, transporter, cost centre, currency and so on) are looked up exactly as typed. An apostrophe (`'`) in any of them, for example `D'SOUZA`, makes the request fail with a database error. Leave apostrophes out of codes and names you send.

### **Example request**

```json
{
  "BranchCode": 2,
  "PartyUserCode": "C1045",
  "BillSeries": "DCH",
  "Bill_Date": "2026-10-28",
  "OrderNo": "PO-7781",
  "OrderDate": "2026-10-27",
  "TransporterName": "SHIV ROADLINES",
  "GRNo": "GR-5521",
  "GRDate": "2026-10-28",
  "Remarks1": "Sent on approval",
  "LstItems": [
    { "LogicUserCode": "SHRT-BLU-M", "Quantity": 10, "Rate": 450.00 },
    { "AddlItemCode": "8901234567012", "Quantity": 5, "Rate": 0, "ItemDescription": "Cotton kurta, white" }
  ]
}
```

### **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. The example sends one pair of the test item `APITEST0001` on a challan; each send creates one more test challan.

## Save a Sale Challan

> Creates a sale challan in Logic ERP. A sale challan (delivery challan) records goods sent to a customer without raising a sale invoice – for approval, on consignment, or ahead of billing. The goods leave your branch's stock and the challan carries rates, discounts and amounts, but it is not a sale invoice: the sale is billed later, when the challan is converted into a sale invoice in Logic ERP. Use this endpoint when your system dispatches goods first and bills them later; use Save a Sale Invoice when the goods are billed at once.

```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":{"/SaveSaleChallanInvoice":{"post":{"tags":["Sale - Push"],"operationId":"SaveSaleChallanInvoice","summary":"Save a Sale Challan","description":"Creates a sale challan in Logic ERP. A sale challan (delivery challan) records goods sent to a customer without raising a sale invoice – for approval, on consignment, or ahead of billing. The goods leave your branch's stock and the challan carries rates, discounts and amounts, but it is not a sale invoice: the sale is billed later, when the challan is converted into a sale invoice in Logic ERP. Use this endpoint when your system dispatches goods first and bills them later; use Save a Sale Invoice when the goods are billed at once.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"BranchCode":{"type":"integer","description":"The branch issuing the challan, by Logic ERP's branch number (`Branch_Code` in Get Branch Info)."},"PartyUserCode":{"type":"string","description":"The customer's party code (`User_Code` in Get Party Master). Must already exist."},"BillSeries":{"type":"string","description":"Name of a sale-challan series of that branch, for example `\"DCH\"`. *If you leave it out, Logic ERP uses the challan series linked to the party, then the default series set for this endpoint in your API site; with none of these the request fails. A name that is not found is refused."},"Bill_Date":{"type":"string","description":"Challan date, `yyyy-MM-dd`. It also decides the financial year. A value that is not a date is ignored (today is used)."},"OrderNo":{"type":"string","description":"The customer's order number. Stored on the challan and returned in `PartyOrderNo`; not checked."},"Remarks1":{"type":"string","description":"Remarks."},"LstItems":{"type":"array","items":{"type":"object","properties":{"LogicUserCode":{"type":"string","description":"The item code shown in Logic ERP (`UserCode` in Get Item Master). Upper/lower case does not matter."},"Quantity":{"type":"integer","description":"Quantity; must be more than `0`."},"Rate":{"type":"integer","description":"Rate per unit in ₹. Used when more than `0`."}}},"description":"The items. See the table below."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status and Message.","content":{"application/json":{"schema":{"type":"object","properties":{"PrintFile":{"type":"string","description":"Always empty."},"Invoice_No":{"type":"string","description":"The challan number given, for example `DCH-214`, or your `Ext_Bill_No`."},"Order_No":{"type":"string","description":"Always empty for this endpoint."},"PartyOrderNo":{"type":"string","description":"The `OrderNo` you sent."},"Status":{"type":"boolean","description":"`true` = the challan was saved."},"Message":{"type":"string","description":"Why it failed. On success it is empty – or, if your API user's Logic ERP rights show the document number after saving, text such as `Saved Doc No. - DCH-214` followed by ` Doc Date - 28/10/2026` on a new line."},"LastSavedCode":{"type":"integer","description":"Logic ERP's internal number of the challan. Use it to cancel the challan, or to find it in the sale challans you pull."},"request_ID":{"type":"string","description":"The ID of this request – quote it to support."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response**

| Field           | Type         | Meaning                                                                                                                                                                                                          |
| --------------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Status`        | true / false | `true` = the challan was saved.                                                                                                                                                                                  |
| `Message`       | text         | Why it failed. On success it is empty – or, if your API user's Logic ERP rights show the document number after saving, text such as `Saved Doc No. - DCH-214` followed by `Doc Date - 28/10/2026` on a new line. |
| `LastSavedCode` | number       | Logic ERP's internal number of the challan. Use it to cancel the challan, or to find it in the sale challans you pull.                                                                                           |
| `request_ID`    | text         | The ID of this request – quote it to support.                                                                                                                                                                    |
| `Invoice_No`    | text         | The challan number given, for example `DCH-214`, or your `Ext_Bill_No`.                                                                                                                                          |
| `PartyOrderNo`  | text         | The `OrderNo` you sent.                                                                                                                                                                                          |
| `Order_No`      | text         | Always empty for this endpoint.                                                                                                                                                                                  |
| `PrintFile`     | text         | Always empty.                                                                                                                                                                                                    |

### **Example response**

```json
{
  "PrintFile": "",
  "Invoice_No": "DCH-214",
  "Order_No": "",
  "PartyOrderNo": "PO-7781",
  "Status": true,
  "Message": "",
  "LastSavedCode": 51872,
  "request_ID": "3b6f0d2e-8c41-4f7a-9d2b-5e1a7c9f0a13"
}
```

### **Messages you may see**

All with `Status: false`. Text in `…` is replaced by the value concerned. When the reason comes from an error inside Logic ERP it may be followed by technical detail – read the first line.

| Message                                                                                                                                                                                                                     | Meaning                                                                                                                                                               | What to do                                                                                                                               |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `Unable to Retrieve Accounts...`                                                                                                                                                                                            | `PartyUserCode` is empty or no account has that code.                                                                                                                 | Send an existing party code.                                                                                                             |
| `Party_User_Code : … is not a Customer / Supplier / Cash account..Please Check...`                                                                                                                                          | `PartyUserCode` belongs to another kind of account (for example a bank or expense account).                                                                           | Send the code of a customer, supplier or cash account.                                                                                   |
| `No financial year covers the date ….`                                                                                                                                                                                      | No financial year in Logic ERP covers `Bill_Date`.                                                                                                                    | Check the date, or ask your Logic ERP team to create the year.                                                                           |
| `Bill Series : … Not found for Branch Code :… in API Parameter..`                                                                                                                                                           | The `BillSeries` sent is not a sale-challan series of that branch.                                                                                                    | Send a sale-challan series of that branch.                                                                                               |
| `Default Bill Series Not Set for Branch Code :…`                                                                                                                                                                            | No `BillSeries`, and no party-linked or default series.                                                                                                               | Send `BillSeries`, or ask your Logic ERP team to set a default.                                                                          |
| `Cannot allow Bill Saving If Bill Number defined without Bill Series....`                                                                                                                                                   | `Bill_Number` without `BillSeries`.                                                                                                                                   | Send both, or neither.                                                                                                                   |
| `Bill No. [….] against Branch Code : … already exists...Please Check..`                                                                                                                                                     | That challan number is already used in the series.                                                                                                                    | Send another number, or leave `Bill_Number` at `0`.                                                                                      |
| `No Item Present..`                                                                                                                                                                                                         | `LstItems` is empty or missing.                                                                                                                                       | Send at least one line.                                                                                                                  |
| `Invalid Item Qty : … for Item Code : … EAN Code : …`                                                                                                                                                                       | A quantity of `0` or less.                                                                                                                                            | Send a positive quantity.                                                                                                                |
| `Invalid LogicUserCode / EANCode : …`                                                                                                                                                                                       | The item code / barcode is not in Logic ERP.                                                                                                                          | Check the code with Get Item Master.                                                                                                     |
| `LogicUserCode Or EAN Code Cannot Blank!!`                                                                                                                                                                                  | A line has neither code.                                                                                                                                              | Fill one of them.                                                                                                                        |
| `Unable to found LotNo : … againts EAN/Item Code : …`                                                                                                                                                                       | A line's `Lot_No` does not exist for the item.                                                                                                                        | Send an existing lot number, or leave `Lot_No` out.                                                                                      |
| `Stock not available for Item Code : … Quantity : … and Billing Qty : …`                                                                                                                                                    | Not enough stock at the branch (or godown) for that item.                                                                                                             | Reduce the quantity or move stock first.                                                                                                 |
| `Invalid Godown Name [….]. Please Check...`, `Invalid Godown Name : …`                                                                                                                                                      | `Godown_Name` / `GodownName` not found.                                                                                                                               | Use a godown name from Logic ERP.                                                                                                        |
| `Unable to found Tax Region : …`                                                                                                                                                                                            | `Tax_Region` not found.                                                                                                                                               | Use the exact tax region name.                                                                                                           |
| `Invalid Agent [….] .Please Check`, `Invalid Tax Form [….] .Please Check`, `Unable to found Cost Center [….] .Please Check`, `Transporter Name [ … ] not found. Please Check...`                                            | A name sent does not exist in Logic ERP.                                                                                                                              | Use the name exactly as in Logic ERP.                                                                                                    |
| `Unable to found A/E Party : …`                                                                                                                                                                                             | `ActEntryPartyUserCode` not found.                                                                                                                                    | Send an existing party code.                                                                                                             |
| `Currency Name : … not found...Please Check...`, `Exchange Rate not Defined for Currency Name :…...Please Check...`                                                                                                         | Unknown currency, or no rate.                                                                                                                                         | Send an existing currency with `ExchangeRate` above `0`.                                                                                 |
| `Way Bill No. :… not found In Branch Code : …`, `Way Bill No. :… is already Finalized..Please Check`                                                                                                                        | The way bill does not exist in the branch, or it is already finalised.                                                                                                | Send an open way bill of the branch, or leave `WayBillNo` out.                                                                           |
| `Sale Bill Locked against Party(Setup New Accounts)`                                                                                                                                                                        | Billing is blocked for this party in Logic ERP.                                                                                                                       | Ask the Logic ERP user to unblock the party.                                                                                             |
| `The Above Customer has crossed the Credit Limit....Cannot Continue`                                                                                                                                                        | The party is over its credit limit.                                                                                                                                   | Settle dues or raise the limit in Logic ERP.                                                                                             |
| `Net Value cannot match with External Net Value...`                                                                                                                                                                         | `Ext_NetSale_Value` differs from Logic ERP's net amount.                                                                                                              | Check rates, discounts and taxes, or leave the field at `0`.                                                                             |
| `Card Name [ … ] not found. Please Check...`, `Credit Card Number Cannot be Blank..`                                                                                                                                        | A `CARD` tender with an unknown card name or no number. The second reason comes after a line of technical text – look for it in the message rather than at its start. | Fix the tender line.                                                                                                                     |
| `Please Define Customer Membership Series to Continue...`, `Please Define Mobile No. to Continue...`, `Customer First Name not defined...Please Check..`, `Mobile Number cannot be blank...`, `EMail id cannot be blank...` | Retail-customer details are incomplete.                                                                                                                               | Fill `RCU_Mem_Prefix`, `RCU_Mobile_No`, `RCU_First_Name` (and the e-mail if that is your customer ID), or leave all `RCU_` fields empty. |
| `Request is pending for processing...`                                                                                                                                                                                      | Your API site stores requests for later processing.                                                                                                                   | Not an error: keep the `request_ID`.                                                                                                     |
| *(empty, `Status: false`)*                                                                                                                                                                                                  | Your API site saves in the background (see the rules).                                                                                                                | Look the request up by `request_ID`.                                                                                                     |

### **If your API site uses the newer save routine**

Your Logic ERP team can switch this endpoint to a newer save routine. It takes the same request, with these differences:

* The financial year is taken from `Bill_Date` (from `Sale_Bill_Date` only when `Bill_Date` is not a date; today when both are empty). A `Bill_Date` inside a locked period is refused.
* `Bill_Number` and `Request_ID` are ignored, and the request is never saved in the background.
* `Lot_No` is honoured: stock is taken from that lot only. Otherwise the newest lot with stock is used first.
* The party-linked series is not used: without `BillSeries` the default series of your API site is taken. A `BillSeries` that is not found is refused, as above.
* No retail customer is linked to a challan, and the order number setting is applied to challans.
* `GST_State_Code` is always stored when sent.
* A line with `"SaleOrSR": "SR"` is taken back into stock instead of being issued.
* Different messages: `Unable to found PartyUserCode : …`, `Party_User_Code cannot be blank...`, `Default Bill Series Not Set for Branch Code : …`, `No Item Found!!`, `Unable to find Item. Logic User Code : …`, `Quantity cannot be blank. Logic User Code : …`, `Unable to find available stock/lot for Item Code : …`, `Entry/Modification is locked for this period....`, `Unable to Save Sale Bill...`.


---

# 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-a-sale-challan.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.
