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

# Save a Sale Challan Return

Creates a **sale challan return** in Logic ERP: goods that a customer sends back after they were delivered on a sale challan (for example goods on approval that were not kept). The return is saved as a challan in a **challan-return series**, and the goods come **back into your branch's stock**. Like a challan, it is not a sale document: no sale return or credit note is raised until the return is converted into a sale return.

### **Endpoint**

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

Also accepted: `https://your-server/api/SaveInvoice` with `"Doc_Type": "CHR"` 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 return 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`.

### **How a challan return links to a challan**

* This endpoint takes **no reference to the original challan**. The return is tied to the **customer** (`PartyUserCode`), not to a particular challan, and the goods are received into a lot of the item that Logic ERP picks (see the rules). Send the same party as on the challan.
* The return's own number is returned in `Invoice_No`, and its internal number in `LastSavedCode`.
* To raise the **sale return** (credit note) for the goods later, send that `LastSavedCode` as `Doc_Code` to [Save a Sale Return Against a Sale Challan Return](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/sale/push/save-a-sale-return-against-a-sale-challan-return.md). A return saved by mistake can be cancelled with [Cancel a Sale Challan Return](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/sale/push/cancel-a-sale-challan-return.md).

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

Compared with [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), which sells goods and books the sale:

* Stock comes **in** instead of going out, and stock on hand is never checked.
* The document goes into a **challan series marked for challan returns**; `BillSeries` cannot be left empty unless your API site has a default series for this endpoint.
* Lines of the **same item at the same rate are combined** into one line.
* `TenderDetails`, `BillingAddress` and `ShippingAddress` are ignored, and no TCS is worked out. `Token_No` is accepted.
* With your API site's "order number" setting on, `OrderNo` must be unique among the **challan returns** of the party.

### **Request fields**

| Field                                                                                                                                                                                                            | Type                           | Required  | Default                    | Meaning                                                                                                                                                                                                                           |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | --------- | -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `BranchCode`                                                                                                                                                                                                     | number                         | No        | `0`                        | The branch receiving the goods, 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                           | **Yes**\* | –                          | Name of a **challan series marked for challan returns** in that branch. \*May be left out only when your API site has a default series for this endpoint. A name that is not found is refused – see the rules.                    |
| `Bill_Number`                                                                                                                                                                                                    | number                         | No        | `0`                        | A fixed number in `BillSeries`. `0` = next number. A number already used in that series in the branch is refused.                                                                                                                 |
| `Bill_Date`                                                                                                                                                                                                      | date                           | No        | today                      | Date of the return, `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; saved as the return's document number and returned in `Invoice_No`.                                                                                                                                     |
| `OrderNo`                                                                                                                                                                                                        | text                           | No\*      | empty                      | Your return reference / the customer's order number. \*Required and unique per party when your API site's order number setting is on. Also used to find the lot (see the rules). Returned in `PartyOrderNo`.                      |
| `OrderDate`                                                                                                                                                                                                      | date                           | No        | empty                      | Date of that order.                                                                                                                                                                                                               |
| `Order_Id`                                                                                                                                                                                                       | text                           | No        | empty                      | A further reference; filled from `OrderNo` when your API site is set to copy it.                                                                                                                                                  |
| `Token_No`                                                                                                                                                                                                       | text                           | No        | empty                      | A token number stored on the return.                                                                                                                                                                                              |
| `Sale_BillNo`, `Sale_Bill_Date`                                                                                                                                                                                  | text, date                     | No        | empty                      | A reference bill number and date, for example the customer's return note.                                                                                                                                                         |
| `Challan_No`, `Challan_Date`                                                                                                                                                                                     | text, date                     | No        | empty                      | A reference challan number and date (for example the original challan number, as text). Stored only – not used to link anything.                                                                                                  |
| `Godown_Name`                                                                                                                                                                                                    | text                           | No        | empty                      | Godown the goods come back into, by name. Must exist. Used when your API site has no default godown for returns.                                                                                                                  |
| `PaymentMode`                                                                                                                                                                                                    | text                           | No        | credit                     | `CASH` or `CREDIT`, in capitals. `CASH` saves the return 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`, `TransporterName`, `Tax_Form_Name`, `CostCenter`                                                                                                                                                    | text                           | No        | defaults                   | Agent, transporter, tax form and cost centre by name. Each must exist. The transporter defaults to the party's.                                                                                                                   |
| `TransportMode`, `GRNo`, `GRDate`                                                                                                                                                                                | text, text, date               | No        | empty                      | Transport mode, LR / GR number and date.                                                                                                                                                                                          |
| `WayBillNo`                                                                                                                                                                                                      | text                           | No        | empty                      | A way bill of this branch that is not finalised; it is linked to the return. A finalised way bill is refused.                                                                                                                     |
| `Tax_Region`                                                                                                                                                                                                     | text                           | No        | party, else series default | Tax region by its name in Logic ERP. Must exist.                                                                                                                                                                                  |
| `GST_State_Code`                                                                                                                                                                                                 | text                           | No        | empty                      | GST state code stored on the return.                                                                                                                                                                                              |
| `CurrencyName`, `ExchangeRate`                                                                                                                                                                                   | text, number                   | No        | empty, `0`                 | Foreign currency by name, with its rate (more than `0`).                                                                                                                                                                          |
| `CreditDays`                                                                                                                                                                                                     | number                         | No        | Logic ERP's default        | Used when more than `0`.                                                                                                                                                                                                          |
| `DeliveryAt`, `DeliveryAdd1`, `DeliveryAdd2`, `Cases`, `Weight`, `PVTMark`, `Insurance_Policy_No`                                                                                                                | text                           | No        | empty                      | Delivery and packing details.                                                                                                                                                                                                     |
| `Remarks1`, `Remarks2`, `Remarks3`                                                                                                                                                                               | text                           | No        | series default remarks     | Remarks.                                                                                                                                                                                                                          |
| `Declaration_No`, `DeclarationNo`                                                                                                                                                                                | text                           | No        | empty                      | Declaration number (`Declaration_No` wins when both are sent).                                                                                                                                                                    |
| `CD_P`, `TD_P`, `SpCD_P`                                                                                                                                                                                         | number                         | No        | `0`                        | Return-level CD %, TD % and special CD %; used when more than `0`, and for every line without its own.                                                                                                                            |
| `Freight`, `Handling`, `SpDiscountRs`, `Adjustment_Rs`                                                                                                                                                           | number                         | No        | `0`                        | Amounts in ₹; used when more than `0`.                                                                                                                                                                                            |
| `Ext_NetSale_Value`                                                                                                                                                                                              | number                         | No        | `0`                        | If not `0`, Logic ERP's net amount must equal it 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** for the return – found or created as described in the rules.                                                                                                                                                |
| `LstItems`                                                                                                                                                                                                       | list                           | **Yes**   | –                          | The items returned. See below.                                                                                                                                                                                                    |
| `DisplayError`                                                                                                                                                                                                   | text                           | No        | `"0"`                      | `"1"` = 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. Otherwise ignored.                                                                                                                                                 |
| `TenderDetails`, `BillingAddress`, `ShippingAddress`, `Doc_Type`, `Doc_Code`, `STBranchCode`, `InvoiceType`, `EntrySource`                                                                                       | –                              | No        | –                          | **Ignored** by this endpoint.                                                                                                                                                                                                     |

**`LstItems`**

| 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)). |
| `AddlItemCode`                                                                                                     | text   | Yes, or `LogicUserCode` | empty                            | The item's additional code / barcode. Used when `LogicUserCode` is empty or not found.                                                                                                                 |
| `Quantity`                                                                                                         | number | **Yes**                 | –                                | Quantity returned; more than `0`.                                                                                                                                                                      |
| `Rate`                                                                                                             | number | No                      | rate from the series' price list | Rate per unit in ₹; used when more than `0`. Send a `Rate` on every line or on none – a request that mixes them is refused (see the rules).                                                            |
| `Mrp`                                                                                                              | number | No                      | the lot's MRP                    | Used when more than `0`.                                                                                                                                                                               |
| `Lot_No`                                                                                                           | text   | No\*                    | empty                            | Lot (batch) number of the goods returned. If filled, it must exist for the item. \*Used to choose the lot only when your API site requires lot numbers on returns – see the rules.                     |
| `CD_P`, `TD_P`                                                                                                     | number | No                      | return-level value               | Line CD % and TD %; used when more than `0`.                                                                                                                                                           |
| `SPCD_P`                                                                                                           | number | No                      | return-level value               | Line special CD %; used when more than `0`.                                                                                                                                                            |
| `Scheme_Rs`, `AdjustItem_Rs`                                                                                       | number | No                      | `0`                              | Scheme discount and rate adjustment in ₹ for the line; used when more than `0`.                                                                                                                        |
| `ItemDescription`                                                                                                  | text   | No                      | empty                            | Description printed for the line.                                                                                                                                                                      |
| `SchemePerUnit`, `LabourPerUnit`, `AdjustmentPerUnit`, `AdjustmentRs`, `GodownName`, `Production_Unit`, `SaleOrSR` | –      | No                      | –                                | **Ignored** by this endpoint.                                                                                                                                                                          |

### **Rules Logic ERP applies**

**Party, branch, series**

* 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.
* The branch is `BranchCode`, else `BranchShortName`; the financial year comes from `Bill_Date`.
* `BillSeries` must be a challan series of the branch that is **marked for challan returns**; a name that is **not found** is refused with `Bill Series : … Not found for Branch Code :… in API Parameter..`. Left empty, the request fails unless your API site has a default series; Logic ERP then uses the challan series linked to the party, if that series is marked for challan returns, else the default series – check `Invoice_No` in the answer.

**Lines and lots**

* Lines of the **same item at the same `Rate`** are combined into one line with the total quantity. The lot number, description and MRP of the **first** such line are kept; the discounts of the **last** one are used.
* **Lot of the returned goods.**
  * If your API site is set to require lot numbers on returns, Logic ERP looks the lot up for each line: first among lots on **sale challans** with this `OrderNo` (this financial year: this branch first, then any branch), then by `Lot_No` for the item (this year and branch, then this branch, then this year). An empty `Lot_No` takes the most recent lot of the item. No lot found stops the request.
  * Otherwise `Lot_No` is only checked to exist; Logic ERP receives the goods into a lot of the item it picks itself. The item must have at least one lot in Logic ERP (it must have been purchased or received before).
* Stock on hand is not checked on a return. The goods go into the default return godown set in your API site, else `Godown_Name`.
* `Rate`, `Mrp` and the discounts you send are used when more than `0`; otherwise the series' price list and item defaults apply. Schemes are applied, then totals and taxes from the tax region: `Tax_Region` when sent, otherwise the party's (for this branch, else its own), otherwise the series default.

**Order number**

* With your API site's "order number" setting on, `OrderNo` is required and must not already be used on another **challan return** of the same party in the same branch. It is checked again while saving.

**Retail customer**

* If `RCU_Mem_Number`, `RCU_Mobile_No` or `RCU_Email` is filled, the return is linked to a retail customer, found by membership series + number or by mobile number, and **created** from the `RCU_` fields if not found. `RCU_Mem_Prefix`, `RCU_Mobile_No` and `RCU_First_Name` are then required.

**Saving**

* The return is saved in one step; on any failure nothing is saved (a retail customer created on the way is kept).
* If your API site is set to **save in the background**, the answer comes back at once with `Status: false`, an empty `Message` and a `request_ID`; look the result up by that ID with the `TokenStatus` endpoint.
* If your API site only **stores** requests for later processing, the answer is *Request is pending for processing...* with `Status: false` – stored, not refused.

> **Lines with and without `Rate`.** When at least one line has a `Rate` above `0`, every line must have one: a line with `Rate` `0` stops the request before anything is saved, with *Rate is sent on some lines but not for Item Code : …. Send a Rate on every line or on none..* Send a `Rate` on every line, or on none.

> **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": "CHRT",
  "Bill_Date": "2026-10-30",
  "OrderNo": "RET-2291",
  "Challan_No": "DCH-214",
  "Challan_Date": "2026-10-28",
  "Remarks1": "Approval goods returned",
  "LstItems": [
    { "LogicUserCode": "SHRT-BLU-M", "Quantity": 4, "Rate": 450.00 },
    { "LogicUserCode": "KRT-WHT-L", "Quantity": 2, "Rate": 799.00 }
  ]
}
```

### **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 takes back one pair of the test item `APITEST0001` and sends `Tax_Region` because the test customer has none; each send creates one more test challan return.

## Save a Sale Challan Return

> Creates a sale challan return in Logic ERP: goods that a customer sends back after they were delivered on a sale challan (for example goods on approval that were not kept). The return is saved as a challan in a challan-return series, and the goods come back into your branch's stock. Like a challan, it is not a sale document: no sale return or credit note is raised until the return is converted into a sale return.

```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":{"/SaveSaleChallanReturn":{"post":{"tags":["Sale - Push"],"operationId":"SaveSaleChallanReturn","summary":"Save a Sale Challan Return","description":"Creates a sale challan return in Logic ERP: goods that a customer sends back after they were delivered on a sale challan (for example goods on approval that were not kept). The return is saved as a challan in a challan-return series, and the goods come back into your branch's stock. Like a challan, it is not a sale document: no sale return or credit note is raised until the return is converted into a sale return.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"BranchCode":{"type":"integer","description":"The branch receiving the goods, 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 challan series marked for challan returns in that branch. *May be left out only when your API site has a default series for this endpoint. A name that is not found is refused – see the rules."},"Bill_Date":{"type":"string","description":"Date of the return, `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":"Your return reference / the customer's order number. *Required and unique per party when your API site's order number setting is on. Also used to find the lot (see the rules). Returned in `PartyOrderNo`."},"Remarks1":{"type":"string","description":"Remarks."},"Tax_Region":{"type":"string","description":"Tax region by its name in Logic ERP. Must exist."},"LstItems":{"type":"array","items":{"type":"object","properties":{"LogicUserCode":{"type":"string","description":"The item code shown in Logic ERP (`UserCode` in Get Item Master)."},"Quantity":{"type":"integer","description":"Quantity returned; more than `0`."},"Rate":{"type":"integer","description":"Rate per unit in ₹; used when more than `0`. Send a `Rate` on every line or on none – a request that mixes them is refused (see the rules)."}}},"description":"The items returned. See 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 number given, for example `CHRT-37`, 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 return 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. - CHRT-37` followed by ` Doc Date - 30/10/2026` on a new line."},"LastSavedCode":{"type":"integer","description":"Logic ERP's internal number of the challan return. Send it as `Doc_Code` to raise the sale return against it, or use it to cancel the return."},"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 return 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. - CHRT-37` followed by `Doc Date - 30/10/2026` on a new line. |
| `LastSavedCode` | number       | Logic ERP's internal number of the challan return. Send it as `Doc_Code` to raise the sale return against it, or use it to cancel the return.                                                                    |
| `request_ID`    | text         | The ID of this request – quote it to support.                                                                                                                                                                    |
| `Invoice_No`    | text         | The number given, for example `CHRT-37`, 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": "CHRT-37",
  "Order_No": "",
  "PartyOrderNo": "RET-2291",
  "Status": true,
  "Message": "",
  "LastSavedCode": 51903,
  "request_ID": "a91c47d2-0e6b-4b8e-8f35-2c7d9e41b6f0"
}
```

### **Messages you may see**

All with `Status: false`. Text in `…` is replaced by the value concerned. Where 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                                                                                                     |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `Party GST State and Company/Branch GST State cannot be same for IGST. Please check.`                                                                                                                                                               | The tax region used (the party's, else the series default) is an IGST region, but the party is in the branch's own GST state. | Send `Tax_Region` with the right region (for example `CGST/SGST`), or set the party's tax region in Logic ERP. |
| `Party Code Not Set in API Request for Sale Return...`                                                                                                                                                                                              | `PartyUserCode` is empty.                                                                                                     | Send the party code.                                                                                           |
| `Unable to Retrieve Accounts...`                                                                                                                                                                                                                    | No account has that party code.                                                                                               | Send an existing party code.                                                                                   |
| `Party_User_Code : … is not a Customer / Supplier / Cash account..Please Check...`                                                                                                                                                                  | The party code belongs to another kind of account (for example a bank or expense account).                                    | Send the code of a customer, supplier or cash account.                                                         |
| `Bill Series Cannot be blank...`                                                                                                                                                                                                                    | No `BillSeries` and no default series for this endpoint.                                                                      | Send a challan-return series.                                                                                  |
| `Bill Series : … Not found for Branch Code :… in API Parameter..`, `Default Bill Series Not Set for Branch Code :…`                                                                                                                                 | The `BillSeries` sent is not a challan-return series of the branch, or no usable series was found.                            | Send a challan series of the branch that is marked for challan returns.                                        |
| `Cannot allow Bill Saving If Bill Number defined without Bill Series....`                                                                                                                                                                           | `Bill_Number` without `BillSeries`.                                                                                           | Send both, or neither.                                                                                         |
| `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 : …`, `LogicUserCode Or EAN Code Cannot Blank!!`                                                                                                                                                                   | Unknown item code, or a line with no code.                                                                                    | Check the code with Get Item Master.                                                                           |
| `Unable to found LotNo : … againts EAN/Item Code : …`                                                                                                                                                                                               | `Lot_No` does not exist for the item.                                                                                         | Send an existing lot number, or leave it out.                                                                  |
| `Lot Number : '…' for Item : '…' not found..`                                                                                                                                                                                                       | Lot numbers are required on returns and no lot was found.                                                                     | Send the lot number of the goods sold.                                                                         |
| `Stock not available for Item Code : … Quantity : … Search Key : …`                                                                                                                                                                                 | The item has no lot in Logic ERP.                                                                                             | Check the item.                                                                                                |
| `Rate is sent on some lines but not for Item Code : …. Send a Rate on every line or on none..`                                                                                                                                                      | Some lines have a `Rate` and this one has none.                                                                               | Send a `Rate` on every line, or on none.                                                                       |
| `Unable to Save Bill for Item Code : … Quantity : … and Billing Qty : … due to Stock not available.`, `Unable to Save Invoice for Item Code : … Org Quantity : …` (followed by `Stock In Hand : …` on a new line)                                   | The quantity picked up for an item differs from what you sent.                                                                | Check the item and quantity; contact support with the `request_ID`.                                            |
| `Order No. Cannot be blank....`, `Order No. already exists for same Customer.Please Check`                                                                                                                                                          | The order number setting is on and `OrderNo` is empty or already used on a challan return of this party.                      | Send a new `OrderNo`.                                                                                          |
| `Invalid Godown Name [….]. Please Check...`                                                                                                                                                                                                         | `Godown_Name` not found.                                                                                                      | Use a godown name from Logic ERP.                                                                              |
| `Unable to found Tax Region : …`, `Invalid Agent [….] .Please Check`, `Invalid Tax Form [….] .Please Check`, `Unable to found Cost Center [….] .Please Check`, `Transporter Name [ … ] not found. Please Check...`, `Unable to found A/E Party : …` | A name or code sent does not exist in Logic ERP.                                                                              | Use the value exactly as in Logic ERP.                                                                         |
| `Currency Name : … not found...Please Check...`, `Exchange Rate not Defined for Currency Name :…...Please Check...`                                                                                                                                 | Unknown currency, or no rate.                                                                                                 | Fix the currency fields.                                                                                       |
| `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.                                                                                            | Ask the Logic ERP user to unblock the party.                                                                   |
| `Net Value cannot match with External Net Value...`                                                                                                                                                                                                 | `Ext_NetSale_Value` differs from Logic ERP's net amount.                                                                      | Check rates and discounts, or send `0`.                                                                        |
| `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.                                                                                       | Complete the `RCU_` fields, or leave them all empty.                                                           |
| `Request is pending for processing...`                                                                                                                                                                                                              | Your API site stores requests for later processing.                                                                           | Not an error: keep the `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.
* Lines are kept as sent (not combined), and every line field, including `SchemePerUnit`, `LabourPerUnit`, `AdjustmentPerUnit` and `AdjustmentRs`, is used.
* The lot is always looked up – by `OrderNo` on sale invoices, then by `Lot_No` – and the goods go into the godown of that lot unless a default return godown applies. With lot numbers required on returns, an empty `Lot_No` fails with *Invalid Lot Nummber In request Payload...*; a lot not found fails with *Unable to find available stock/lot for Item Code : …*.
* `BillSeries` may be empty when a default series exists; the party-linked series is not used. A `BillSeries` that is not found is refused, as above. `Bill_Number` and `Request_ID` are ignored, and nothing is saved in the background.
* Other messages: `Unable to found PartyUserCode : …`, `Party_User_Code cannot be blank...`, `No Item Found!!`, `Unable to find Item. Logic User Code : …`, `Quantity cannot be blank. Logic User 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-return.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.
