> 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/orders/pull/get-sale-orders.md).

# Get Sale Orders

Returns your **sale orders** from Logic ERP, each with its **header** (party, branch, agent, amounts, the party's own order number, delivery and billing address) and its **item lines** (item, lot, ordered quantity, rate and discount percentages). Use it to copy new and changed sale orders into your own system – normally by asking only for orders **added or changed** since your last call – or to fetch particular orders by Logic ERP's internal number.

### **Endpoint**

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

The response and the common request fields are explained in [How Every API Call Works](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/how-every-api-call-works.md).

### **Request fields**

| Field                | Type   | Required | Default | Meaning                                                                                                                                                                                                                                                                                                                                                        |
| -------------------- | ------ | -------- | ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `GlobalModifyCode`   | number | No       | `0`     | Your bookmark in the change log, as described in How Every API Call Works: `0` = from the start (or a period, with `DateFrom`/`DateTo`), a number = only changes after it, `-1` = Logic ERP keeps the bookmark for you.                                                                                                                                        |
| `DateFrom`, `DateTo` | date   | No       | empty   | With `GlobalModifyCode` `0`: a period of **changes** (the day an order was saved or edited, not the order date). Leave both out (or send `null`) when you are not asking for a period; with a bookmark they are not checked. Write them as `yyyy-MM-dd`.                                                                                                       |
| `Doc_Codes`          | text   | No       | empty   | Logic ERP's internal order numbers (`Vouch_Code` in the response), separated by commas, for example `"486988,486989"`. Returns exactly these orders; the bookmark and period are ignored. Numbers and commas only.                                                                                                                                             |
| `Branch_Codes_From`  | text   | No       | empty   | Branch codes separated by commas, for example `"2,5"`. Only orders of these branches are returned, in every kind of request. Numbers and commas only.                                                                                                                                                                                                          |
| `Doc_Num_Like`       | text   | No       | empty   | Only orders whose number starts with this text. Used with the bookmark or a period. Send the prefix, for example `"GSO"`: sale order numbers are kept in the change log as prefix and number joined by a space or a `-` depending on how the order was saved, so `"GSO-"` can find nothing. A short text also matches longer prefixes that start the same way. |

Field names are matched without regard to upper or lower case. Other fields in the request (for example `ApprovalFilter` or `PartyUserCode`) are ignored.

### **Rules Logic ERP applies**

* **One change log for sale orders.** With a bookmark, each call reads up to **200 change-log lines** and returns the orders they belong to. When none of them can be returned (for example because of `Branch_Codes_From`), you get `"No Record Found."` with `Status: true` and a **higher** `LastGlobalModifyCode` – store it and call again. You have caught up when the message is `"No Sale Order found..."` and `LastGlobalModifyCode` is the value you sent.
* **An order can come back in a later batch.** Every save of an order adds a line to the change log, so an order edited after your bookmark is returned again with its current details. Update it in your system; do not add it a second time.
* **Not split by financial year.** Sale orders are not kept per financial year, so `Vouch_Code` identifies an order without a year, and orders of every year are returned. The change-log problem with earlier financial years that affects some other endpoints does not apply here.
* **What is returned.** Every order in the batch is returned whether it is approved or still waiting for approval, and whether or not it has been delivered or billed. Nothing in the response says whether an order is approved, and approving an order does not send it to you again. `Quantity` on a line is the quantity **ordered**; the quantity still pending is not returned.
* **Cancelled orders and lines.** Cancelled lines are left out. An order that is cancelled – as a whole, or because every line is cancelled – comes back as a header-only record with `"Action_Code": "D"` and an empty `ListItems`; it carries only `Vouch_Code`, `Order_Prefix`, `Order_Number`, `Order_No`, `Order_Date`, the party, the branch and `Party_Order_No`. Mark the order as cancelled in your system.
* Orders **deleted** in Logic ERP are not returned, so a deletion does not reach you through this endpoint.
* With `Doc_Codes` and with a period request, `LastGlobalModifyCode` comes back as `0` – do not store it.
* `DateFrom` and `DateTo` only select changes for a period request; they never filter on the order date, and they are ignored when `Doc_Codes` is filled.
* Every line must find its item in Logic ERP, and the order its party, agent, branch and currency. A line that cannot is left out. In normal use these records always exist.
* Orders and their lines are not returned in any guaranteed order.
* Dates in the response are text `dd/MM/yyyy`, for example `03/10/2026`.

> **Known issue – your Logic ERP team's branch, account-group and prefix limits are not applied.** The API site setup offers these limits for sale orders, but this endpoint ignores them: orders of every branch, party and prefix are returned. Use `Branch_Codes_From` and `Doc_Num_Like` to narrow the request yourself.

### **Example request**

Next batch after your stored bookmark:

```json
{
  "GlobalModifyCode": 10800,
  "DateFrom": null,
  "DateTo": null,
  "Doc_Codes": "",
  "Branch_Codes_From": ""
}
```

Two orders by their internal numbers:

```json
{
  "GlobalModifyCode": 0,
  "DateFrom": null,
  "DateTo": null,
  "Doc_Codes": "486988,486989"
}
```

### **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**. The example asks for the first batch of the change log; send the `LastGlobalModifyCode` you get back to see the next batch. Do not send `"GlobalModifyCode": -1` here – it changes what the sandbox has marked as already sent.

## Get Sale Orders

> Returns your sale orders from Logic ERP, each with its header (party, branch, agent, amounts, the party's own order number, delivery and billing address) and its item lines (item, lot, ordered quantity, rate and discount percentages). Use it to copy new and changed sale orders into your own system – normally by asking only for orders added or changed since your last call – or to fetch particular orders by Logic ERP's internal number.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Orders - Pull"}],"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":{"/GetSaleOrder":{"post":{"tags":["Orders - Pull"],"operationId":"GetSaleOrder","summary":"Get Sale Orders","description":"Returns your sale orders from Logic ERP, each with its header (party, branch, agent, amounts, the party's own order number, delivery and billing address) and its item lines (item, lot, ordered quantity, rate and discount percentages). Use it to copy new and changed sale orders into your own system – normally by asking only for orders added or changed since your last call – or to fetch particular orders by Logic ERP's internal number.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"GlobalModifyCode":{"type":"integer","description":"Your bookmark in the change log, as described in How Every API Call Works: `0` = from the start (or a period, with `DateFrom`/`DateTo`), a number = only changes after it, `-1` = Logic ERP keeps the bookmark for you."},"DateFrom":{"type":"string","nullable":true,"description":"With `GlobalModifyCode` `0`: a period of changes (the day an order was saved or edited, not the order date). Leave both out (or send `null`) when you are not asking for a period; with a bookmark they are not checked. Write them as `yyyy-MM-dd`."},"DateTo":{"type":"string","nullable":true,"description":"With `GlobalModifyCode` `0`: a period of changes (the day an order was saved or edited, not the order date). Leave both out (or send `null`) when you are not asking for a period; with a bookmark they are not checked. Write them as `yyyy-MM-dd`."},"Doc_Codes":{"type":"string","description":"Logic ERP's internal order numbers (`Vouch_Code` in the response), separated by commas, for example `\"486988,486989\"`. Returns exactly these orders; the bookmark and period are ignored. Numbers and commas only."},"Branch_Codes_From":{"type":"string","description":"Branch codes separated by commas, for example `\"2,5\"`. Only orders of these branches are returned, in every kind of request. Numbers and commas only."},"Doc_Num_Like":{"type":"string","description":"Only orders whose number starts with this text. Used with the bookmark or a period. Send the prefix, for example `\"GSO\"`: sale order numbers are kept in the change log as prefix and number joined by a space or a `-` depending on how the order was saved, so `\"GSO-\"` can find nothing. A short text also matches longer prefixes that start the same way."}}}}}},"responses":{"200":{"description":"Always HTTP 200. Check Status, Message and GetData.","content":{"application/json":{"schema":{"type":"object","properties":{"GetData":{"type":"array","items":{"type":"object","properties":{"Vouch_Code":{"type":"integer","description":"Logic ERP's internal order number. Use it in `Doc_Codes`."},"Order_Prefix":{"type":"string","description":"Order prefix, for example `GSO`."},"Order_Number":{"type":"integer","description":"Order number within the prefix."},"Order_No":{"type":"string","description":"Prefix and number joined by the separator your Logic ERP team set in the API site setup, for example `GSO-8`; with no separator set, `GSO8`. The separator can be any text, even a letter – do not split `Order_No`; use `Order_Prefix` and `Order_Number`."},"Order_Date":{"type":"string","description":"Order date, `dd/MM/yyyy`."},"Valid_Date":{"type":"string","description":"Date the order is valid until, `dd/MM/yyyy`."},"Party_Name":{"type":"string","description":"Name of the party (customer) as kept in Logic ERP, usually with its city, for example `SHREE GANESH TEXTILES -LUDHIANA`. There may be several spaces before the `-`."},"Party_User_Code":{"type":"string","description":"Code of the party as shown in Logic ERP."},"Agent_Name":{"type":"string","description":"The order's agent or salesman, or `NIL`."},"Branch_Code":{"type":"integer","description":"Code of the order's branch."},"Branch_Name":{"type":"string","description":"Name and short name of that branch."},"Branch_Short_Name":{"type":"string","description":"Name and short name of that branch."},"Exchange_Rate":{"type":"number","description":"Exchange rate of the order's currency; `1` for rupees."},"Currency_Name":{"type":"string","description":"Currency, for example `INR`."},"Order_Amount":{"type":"number","description":"Order value before taxes, in the order's currency."},"Net_Order_Amount":{"type":"number","description":"Order total."},"Party_Order_No":{"type":"string","description":"The party's own order number, as typed on the order."},"Action_Code":{"type":"string","description":"The order's latest change: `N` = added, `M` = modified; `D` = cancelled (header-only record, see the rules). Empty when the order has no change-log line."},"ClassSaveRetvDeliveryAddress":{"type":"string","nullable":true,"description":"Always `null`. Ignore it."},"Shipping_Addres":{"type":"object","properties":{"Code":{"type":"integer","description":"Logic ERP's internal address number; `0` when there is no such address."},"Cust_Code":{"type":"integer","description":"Internal number of the customer the address belongs to; `0` when not linked."},"Contact_Person_Name":{"type":"string","description":"Contact person."},"Phone_Number":{"type":"string","description":"Phone, mobile and e-mail at the address."},"Address_1":{"type":"string","description":"Address lines."},"Address_2":{"type":"string","description":"Address lines."},"Driving_Directions":{"type":"string","description":"Directions."},"City_Name":{"type":"string","description":"City, state, country and PIN code."},"Code_Type":{"type":"string","description":"Kind of address, as stored."},"Country_Name":{"type":"string","description":"City, state, country and PIN code."},"Email_Id":{"type":"string","description":"Phone, mobile and e-mail at the address."},"Location_Code":{"type":"integer","description":"Location, when used."},"Mobile_No":{"type":"string","description":"Phone, mobile and e-mail at the address."},"Pin_Code":{"type":"string","description":"City, state, country and PIN code."},"State_Name":{"type":"string","description":"City, state, country and PIN code."},"Company_Name":{"type":"string","description":"Company name at the address."},"Latitude":{"type":"string","description":"Map position, when kept."},"Longitude":{"type":"string","description":"Map position, when kept."},"Address_ID":{"type":"string","description":"Logic ERP's address ID and the ID your system gave the address, if any."},"Complete_Address":{"type":"string","description":"The full address in one text, when kept."},"External_Address_Id":{"type":"string","description":"Logic ERP's address ID and the ID your system gave the address, if any."},"Location_Name":{"type":"string","description":"Location, when used."},"State_Code":{"type":"integer","description":"Internal number of the state."},"Country_Code":{"type":"integer","description":"Always `0`."},"DisplayAddress":{"type":"string","description":"Mobile number and contact person joined with `-`."},"DeleteAddress":{"type":"boolean","description":"Always `false` here – ignore."},"SameAsShippingAddress":{"type":"boolean","description":"Always `false` here – ignore."},"Gst_No":{"type":"string","description":"GSTIN at the address."}},"description":"The delivery address on the order (the name is spelt this way); `null` when the order has no address details. See below."},"Billing_Address":{"type":"object","properties":{"Code":{"type":"integer","description":"Logic ERP's internal address number; `0` when there is no such address."},"Cust_Code":{"type":"integer","description":"Internal number of the customer the address belongs to; `0` when not linked."},"Contact_Person_Name":{"type":"string","description":"Contact person."},"Phone_Number":{"type":"string","description":"Phone, mobile and e-mail at the address."},"Address_1":{"type":"string","description":"Address lines."},"Address_2":{"type":"string","description":"Address lines."},"Driving_Directions":{"type":"string","description":"Directions."},"City_Name":{"type":"string","description":"City, state, country and PIN code."},"Code_Type":{"type":"string","description":"Kind of address, as stored."},"Country_Name":{"type":"string","description":"City, state, country and PIN code."},"Email_Id":{"type":"string","description":"Phone, mobile and e-mail at the address."},"Location_Code":{"type":"integer","description":"Location, when used."},"Mobile_No":{"type":"string","description":"Phone, mobile and e-mail at the address."},"Pin_Code":{"type":"string","description":"City, state, country and PIN code."},"State_Name":{"type":"string","description":"City, state, country and PIN code."},"Company_Name":{"type":"string","description":"Company name at the address."},"Latitude":{"type":"string","description":"Map position, when kept."},"Longitude":{"type":"string","description":"Map position, when kept."},"Address_ID":{"type":"string","nullable":true,"description":"Logic ERP's address ID and the ID your system gave the address, if any."},"Complete_Address":{"type":"string","description":"The full address in one text, when kept."},"External_Address_Id":{"type":"string","description":"Logic ERP's address ID and the ID your system gave the address, if any."},"Location_Name":{"type":"string","nullable":true,"description":"Location, when used."},"State_Code":{"type":"integer","description":"Internal number of the state."},"Country_Code":{"type":"integer","description":"Always `0`."},"DisplayAddress":{"type":"string","description":"Mobile number and contact person joined with `-`."},"DeleteAddress":{"type":"boolean","description":"Always `false` here – ignore."},"SameAsShippingAddress":{"type":"boolean","description":"Always `false` here – ignore."},"Gst_No":{"type":"string","nullable":true,"description":"GSTIN at the address."}},"description":"The billing address on the order; `null` when the order has no address details. See below."},"ListItems":{"type":"array","items":{"type":"object","properties":{"SoTxnCode":{"type":"integer","description":"Logic ERP's internal line number."},"ItemCode":{"type":"string","description":"Item code as shown in Logic ERP (`UserCode` in Get Item Master)."},"EAN_Code":{"type":"string","description":"The item's additional code, for example a barcode."},"Lot_Number":{"type":"string","description":"Lot number named on the line; empty when none."},"Quantity":{"type":"number","description":"Quantity ordered."},"Rate":{"type":"number","description":"Rate on the line."},"CD_P":{"type":"number","description":"Cash discount and trade discount percentages on the line."},"TD_P":{"type":"number","description":"Cash discount and trade discount percentages on the line."}}},"description":"The item lines. See below."}}},"nullable":true,"description":"The records found; null when the call failed or nothing was found - read Message."},"Status":{"type":"boolean","description":"See the Status rules on this page and on How Every API Call Works."},"Message":{"type":"string","description":"Why the call failed, or a note. The reason may be followed by technical detail - read the first line."},"LastGlobalModifyCode":{"type":"integer","description":"The change-log bookmark (see How Every API Call Works)."},"resultSize":{"type":"string","description":"Size of the answer, for example \"2 KB\"."}}}}}},"401":{"description":"No login was sent."}}}}}}
```

### **Response fields**

Each item in `GetData` is one sale order:

| Field                              | Type   | Meaning                                                                                                                                                                                                                                                     |
| ---------------------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Vouch_Code`                       | number | Logic ERP's internal order number. Use it in `Doc_Codes`.                                                                                                                                                                                                   |
| `Order_Prefix`                     | text   | Order prefix, for example `GSO`.                                                                                                                                                                                                                            |
| `Order_Number`                     | number | Order number within the prefix.                                                                                                                                                                                                                             |
| `Order_No`                         | text   | Prefix and number joined by the separator your Logic ERP team set in the API site setup, for example `GSO-8`; with no separator set, `GSO8`. The separator can be any text, even a letter – do not split `Order_No`; use `Order_Prefix` and `Order_Number`. |
| `Order_Date`                       | date   | Order date, `dd/MM/yyyy`.                                                                                                                                                                                                                                   |
| `Valid_Date`                       | date   | Date the order is valid until, `dd/MM/yyyy`.                                                                                                                                                                                                                |
| `Party_Name`                       | text   | Name of the party (customer) as kept in Logic ERP, usually with its city, for example `SHREE GANESH TEXTILES -LUDHIANA`. There may be several spaces before the `-`.                                                                                        |
| `Party_User_Code`                  | text   | Code of the party as shown in Logic ERP.                                                                                                                                                                                                                    |
| `Agent_Name`                       | text   | The order's agent or salesman, or `NIL`.                                                                                                                                                                                                                    |
| `Branch_Code`                      | number | Code of the order's branch.                                                                                                                                                                                                                                 |
| `Branch_Name`, `Branch_Short_Name` | text   | Name and short name of that branch.                                                                                                                                                                                                                         |
| `Exchange_Rate`                    | number | Exchange rate of the order's currency; `1` for rupees.                                                                                                                                                                                                      |
| `Currency_Name`                    | text   | Currency, for example `INR`.                                                                                                                                                                                                                                |
| `Order_Amount`                     | number | Order value before taxes, in the order's currency.                                                                                                                                                                                                          |
| `Net_Order_Amount`                 | number | Order total.                                                                                                                                                                                                                                                |
| `Party_Order_No`                   | text   | The party's own order number, as typed on the order.                                                                                                                                                                                                        |
| `Action_Code`                      | text   | The order's latest change: `N` = added, `M` = modified; `D` = cancelled (header-only record, see the rules). Empty when the order has no change-log line.                                                                                                   |
| `ClassSaveRetvDeliveryAddress`     | –      | Always `null`. Ignore it.                                                                                                                                                                                                                                   |
| `Shipping_Addres`                  | object | The delivery address on the order (the name is spelt this way); `null` when the order has no address details. See below.                                                                                                                                    |
| `Billing_Address`                  | object | The billing address on the order; `null` when the order has no address details. See below.                                                                                                                                                                  |
| `ListItems`                        | list   | The item lines. See below.                                                                                                                                                                                                                                  |

**`Shipping_Addres` and `Billing_Address`** — when the order has address details but not this address, the object is present with empty texts, `0` numbers and `null` for `Address_ID`, `Location_Name` and `Gst_No`:

| Field                                                 | Type         | Meaning                                                                      |
| ----------------------------------------------------- | ------------ | ---------------------------------------------------------------------------- |
| `Code`                                                | number       | Logic ERP's internal address number; `0` when there is no such address.      |
| `Cust_Code`                                           | number       | Internal number of the customer the address belongs to; `0` when not linked. |
| `Contact_Person_Name`                                 | text         | Contact person.                                                              |
| `Phone_Number`, `Mobile_No`, `Email_Id`               | text         | Phone, mobile and e-mail at the address.                                     |
| `Company_Name`                                        | text         | Company name at the address.                                                 |
| `Address_1`, `Address_2`                              | text         | Address lines.                                                               |
| `Complete_Address`                                    | text         | The full address in one text, when kept.                                     |
| `Driving_Directions`                                  | text         | Directions.                                                                  |
| `City_Name`, `State_Name`, `Country_Name`, `Pin_Code` | text         | City, state, country and PIN code.                                           |
| `State_Code`                                          | number       | Internal number of the state.                                                |
| `Country_Code`                                        | number       | Always `0`.                                                                  |
| `Location_Code`, `Location_Name`                      | number, text | Location, when used.                                                         |
| `Latitude`, `Longitude`                               | text         | Map position, when kept.                                                     |
| `Address_ID`, `External_Address_Id`                   | text         | Logic ERP's address ID and the ID your system gave the address, if any.      |
| `Gst_No`                                              | text         | GSTIN at the address.                                                        |
| `Code_Type`                                           | text         | Kind of address, as stored.                                                  |
| `DisplayAddress`                                      | text         | Mobile number and contact person joined with `-`.                            |
| `DeleteAddress`, `SameAsShippingAddress`              | true / false | Always `false` here – ignore.                                                |

**`ListItems`** — one entry per order line:

| Field          | Type   | Meaning                                                                                                                                                                                           |
| -------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `SoTxnCode`    | number | Logic ERP's internal line number.                                                                                                                                                                 |
| `ItemCode`     | text   | Item code as 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)). |
| `EAN_Code`     | text   | The item's additional code, for example a barcode.                                                                                                                                                |
| `Lot_Number`   | text   | Lot number named on the line; empty when none.                                                                                                                                                    |
| `Quantity`     | number | Quantity ordered.                                                                                                                                                                                 |
| `Rate`         | number | Rate on the line.                                                                                                                                                                                 |
| `CD_P`, `TD_P` | number | Cash discount and trade discount percentages on the line.                                                                                                                                         |

### **Example response**

```json
{
  "GetData": [
    {
      "Vouch_Code": 486988,
      "Order_Prefix": "GSO",
      "Order_Number": 8,
      "Order_No": "GSO-8",
      "Order_Date": "03/10/2026",
      "Valid_Date": "02/11/2026",
      "Party_Name": "SHREE GANESH TEXTILES -LUDHIANA",
      "Party_User_Code": "C1045",
      "Agent_Name": "NIL",
      "Branch_Code": 2,
      "Branch_Name": "LUDHIANA MAIN",
      "Branch_Short_Name": "LDH",
      "Exchange_Rate": 1.0,
      "Currency_Name": "INR",
      "Order_Amount": 2400.0,
      "Net_Order_Amount": 2520.0,
      "Party_Order_No": "PO-7781",
      "Action_Code": "N",
      "ClassSaveRetvDeliveryAddress": null,
      "Shipping_Addres": {
        "Code": 9861, "Cust_Code": 0, "Contact_Person_Name": "Ravi Arora", "Phone_Number": "",
        "Address_1": "12, Mall Road", "Address_2": "Near Clock Tower", "Driving_Directions": "", "City_Name": "LUDHIANA",
        "Code_Type": "TXN", "Country_Name": "INDIA", "Email_Id": "", "Location_Code": 0, "Mobile_No": "9814000000",
        "Pin_Code": "141001", "State_Name": "PUNJAB", "Company_Name": "SHREE GANESH TEXTILES", "Latitude": "", "Longitude": "",
        "Address_ID": "e82bb9b592044c3a90ba35c27705c29e", "Complete_Address": "", "External_Address_Id": "",
        "Location_Name": "MALL ROAD", "State_Code": 3, "Country_Code": 0, "DisplayAddress": "9814000000-Ravi Arora",
        "DeleteAddress": false, "SameAsShippingAddress": false, "Gst_No": "03ABCDE1234F1Z5"
      },
      "Billing_Address": {
        "Code": 0, "Cust_Code": 0, "Contact_Person_Name": "", "Phone_Number": "", "Address_1": "", "Address_2": "",
        "Driving_Directions": "", "City_Name": "", "Code_Type": "", "Country_Name": "", "Email_Id": "", "Location_Code": 0,
        "Mobile_No": "", "Pin_Code": "", "State_Name": "", "Company_Name": "", "Latitude": "", "Longitude": "",
        "Address_ID": null, "Complete_Address": "", "External_Address_Id": "", "Location_Name": null, "State_Code": 0,
        "Country_Code": 0, "DisplayAddress": "-", "DeleteAddress": false, "SameAsShippingAddress": false, "Gst_No": null
      },
      "ListItems": [
        {
          "SoTxnCode": 15410,
          "ItemCode": "KUR-1001-M",
          "EAN_Code": "8901234567012",
          "Lot_Number": "",
          "Quantity": 2.0,
          "Rate": 1200.0,
          "CD_P": 0.0,
          "TD_P": 0.0
        }
      ]
    }
  ],
  "Status": true,
  "Message": "",
  "LastGlobalModifyCode": 12698,
  "resultSize": "2 KB"
}
```

### **Messages you may see**

| Message                                                                                                         | Meaning                                                                                                                                                                                                            | What to do                                                                                            |
| --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------- |
| *No Sale Order found...* (with `Status: true`)                                                                  | Nothing has been added to the change log after your bookmark.                                                                                                                                                      | You are up to date. Call again later with the same bookmark.                                          |
| *No Record Found.* (with `Status: true`)                                                                        | Change-log lines were found but no order could be returned – for example all were of other branches or deleted orders – or no order was saved or changed in the period, or the `Doc_Codes` you sent found nothing. | With a bookmark: store the new `LastGlobalModifyCode` and call again. Otherwise: check what you sent. |
| `Request cannot be processed. API Template is marked as In-Active in the configuration.` (with `Status: false`) | Your Logic ERP team has switched this endpoint off for your API site.                                                                                                                                              | Ask your Logic ERP support team.                                                                      |
| `Invalid code in list: '…'. Only numeric codes are allowed.` (with `Status: false`)                             | `Doc_Codes` or `Branch_Codes_From` contains something other than numbers and commas.                                                                                                                               | Send codes as numbers separated by commas.                                                            |


---

# 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/orders/pull/get-sale-orders.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.
