> 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-delivery-orders.md).

# Get Delivery Orders

Returns your **delivery orders** that still have goods **pending** to be delivered, each with its **header** (delivery order number and date, branch, party, the sale order it was made from) and its **pending item lines** (item, lot, pending quantity, MRP, packing, box and bin). It also reports delivery orders that were **deleted**. Use it to pick and pack against delivery orders in your own system – normally by asking only for delivery orders **added or changed** since your last call.

### **Endpoint**

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

Also accepted: `https://your-server/api/GetDelvieryOrder` (misspelt), which works the same way.

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 a delivery order was saved, edited or deleted – not the delivery order date). Not used with `Doc_Codes` or with a bookmark. Leave both out (or send `null`) when you do not want a period. Write them as `yyyy-MM-dd`.      |
| `Doc_Codes`          | text   | No       | empty   | Logic ERP's internal delivery order numbers (`Doc_Code` in the response), separated by commas, for example `"5346,5353"`. Returns these delivery orders (if they still have pending goods) and reports those of them that were deleted; the bookmark is ignored. Numbers and commas only. |
| `Branch_Codes_From`  | text   | No       | empty   | Branch codes separated by commas, for example `"2,5"`. Only delivery orders of these branches are returned (deleted ones included), in every kind of request. Numbers and commas only – anything else is refused.                                                                         |
| `Doc_Num_Like`       | text   | No       | empty   | Only delivery orders whose number starts with this text, written prefix-number, for example `"MDO-"`. Used with the bookmark or a period.                                                                                                                                                 |

Field names are matched without regard to upper or lower case. Other fields in the request are ignored.

### **Rules Logic ERP applies**

* **Only pending goods.** A delivery order is returned only with its lines that still have a quantity pending, and `Quantity` is that **pending** quantity. A delivery order with nothing pending any more (for example fully billed) is not returned at all – it simply stops appearing. Delivery orders still waiting for approval are not returned.
* **Deleted delivery orders** in the batch (or named in `Doc_Codes`, or changed in the period) are returned with `Action_Code` `"2"`, their number, date and branch, empty or `null` other fields and an empty `LstItems`. Remove them from your system.
* With a bookmark, each call reads up to **200 change-log lines** and returns the delivery orders they belong to. When none of them can be returned (for example because none has pending goods any more), you get `"No Pending Delivery Order found..."` with `Status: true` and a **higher** `LastGlobalModifyCode` – store it and call again. You have caught up when you get the same message and `LastGlobalModifyCode` is the value you sent.
* **A delivery order can come back in a later batch.** Every save adds a line to the change log, so a delivery order edited after your bookmark is returned again with its current pending lines. Update it in your system; do not add it a second time.
* **Not split by financial year.** Delivery orders are not kept per financial year, and those of every year are returned. The internal number of a deleted delivery order can later be given to a new one, so after an `Action_Code` `"2"` treat a later record with the same `Doc_Code` as a new delivery order. The change-log problem with earlier financial years that affects some other endpoints does not apply here.
* **A period request** returns delivery orders that were saved or changed in the period, whatever their own date. Dates sent with a bookmark or with `Doc_Codes` are not used.
* With `Doc_Codes` and with a period request, `LastGlobalModifyCode` comes back as `0` – do not store it.
* **Your Logic ERP team can limit this endpoint** in the API site setup to certain branches, party groups and delivery order prefixes, and chooses between bin-wise and other delivery orders (you receive one kind only, never both) and between the normal lines and the lines of completed packing. Delivery orders outside these settings are never returned, whatever you send; deleted delivery orders are filtered by branch and prefix only.
* **Packing slips** are kept with delivery orders but are returned only when the site is set to return the lines of completed packing, and then only packing slips made against a sale order. A packing slip saved with Save a Packing Slip Against a Sale Order is not returned on the normal setting.
* **Lines can be combined.** Depending on the API site setup, lines of the same item with the same lot MRP, or with the same item MRP, are returned as one line with the quantities added; with either of these settings every line has `DO_Txn_Code` `0`. Otherwise there is one entry per delivery order line.
* Every line must find its sale order line, reservation, lot, item, item group records (company, colour, pack) and the sale order's party and currency; a line that cannot is left out. In normal use these records always exist.
* Delivery orders are returned in order of `Doc_Code`, with the deleted ones after the others.
* Dates in the response are text `dd/MM/yyyy`, for example `19/10/2026`.

### **Example request**

Next batch after your stored bookmark:

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

Two delivery orders by their internal numbers:

```json
{
  "GlobalModifyCode": 0,
  "DateFrom": null,
  "DateTo": null,
  "Doc_Codes": "5346,5353"
}
```

### **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 Delivery Orders

> Returns your delivery orders that still have goods pending to be delivered, each with its header (delivery order number and date, branch, party, the sale order it was made from) and its pending item lines (item, lot, pending quantity, MRP, packing, box and bin). It also reports delivery orders that were deleted. Use it to pick and pack against delivery orders in your own system – normally by asking only for delivery orders added or changed since your last call.

```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":{"/GetDeliveryOrder":{"post":{"tags":["Orders - Pull"],"operationId":"GetDeliveryOrder","summary":"Get Delivery Orders","description":"Returns your delivery orders that still have goods pending to be delivered, each with its header (delivery order number and date, branch, party, the sale order it was made from) and its pending item lines (item, lot, pending quantity, MRP, packing, box and bin). It also reports delivery orders that were deleted. Use it to pick and pack against delivery orders in your own system – normally by asking only for delivery orders added or changed since your last call.","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 a delivery order was saved, edited or deleted – not the delivery order date). Not used with `Doc_Codes` or with a bookmark. Leave both out (or send `null`) when you do not want a period. Write them as `yyyy-MM-dd`."},"DateTo":{"type":"string","nullable":true,"description":"With `GlobalModifyCode` `0`: a period of changes (the day a delivery order was saved, edited or deleted – not the delivery order date). Not used with `Doc_Codes` or with a bookmark. Leave both out (or send `null`) when you do not want a period. Write them as `yyyy-MM-dd`."},"Doc_Codes":{"type":"string","description":"Logic ERP's internal delivery order numbers (`Doc_Code` in the response), separated by commas, for example `\"5346,5353\"`. Returns these delivery orders (if they still have pending goods) and reports those of them that were deleted; the bookmark is ignored. Numbers and commas only."},"Branch_Codes_From":{"type":"string","description":"Branch codes separated by commas, for example `\"2,5\"`. Only delivery orders of these branches are returned (deleted ones included), in every kind of request. Numbers and commas only – anything else is refused."},"Doc_Num_Like":{"type":"string","description":"Only delivery orders whose number starts with this text, written prefix-number, for example `\"MDO-\"`. Used with the bookmark or a period."}}}}}},"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":{"DisplayError":{"type":"string","description":"Always `\"\"`. Ignore them."},"Doc_Type":{"type":"string","description":"Always `\"\"`. Ignore them."},"Doc_Code":{"type":"integer","description":"Logic ERP's internal delivery order number. Use it in `Doc_Codes`."},"Doc_Prefix":{"type":"string","description":"Delivery order prefix, for example `MDO`."},"Doc_Number":{"type":"integer","description":"Delivery order number within the prefix."},"DO_Date":{"type":"string","description":"Delivery order date, `dd/MM/yyyy`."},"DO_Branch_Code":{"type":"integer","description":"Code of the delivery order's branch."},"BranchCode_To":{"type":"integer","description":"Always `0`. Ignore them."},"PartyUserCode":{"type":"string","description":"Code of the sale order's party as shown in Logic ERP."},"SO_Head_Code":{"type":"integer","description":"Logic ERP's internal number of the sale order the delivery order was made from (`Vouch_Code` in Get Sale Orders)."},"SO_No":{"type":"string","description":"That sale order's number as stored, for example `MSO 187`."},"SO_Date":{"type":"string","description":"That sale order's date, `dd/MM/yyyy`."},"Customer_Name":{"type":"string","nullable":true,"description":"Name of the sale order's party as kept in Logic ERP. `null` on a deleted delivery order."},"SO_Delivery_Date":{"type":"string","nullable":true,"description":"Delivery date of the sale order lines behind the delivery order – with several lines, the earliest date set on them – `dd/MM/yyyy`; `\"\"` when none is set; `null` on a deleted delivery order."},"Action_Code":{"type":"string","description":"The latest change: `\"0\"` = added, `\"1\"` = modified, `\"2\"` = deleted; empty when the delivery order has no change-log line."},"Logic_User_Name":{"type":"string","description":"The Logic ERP user who made the latest change."},"CurrencyName":{"type":"string","description":"Currency of the sale order, for example `INR`."},"ExchangeRate":{"type":"number","description":"Exchange rate of that currency; `1` for rupees."},"PickListDocCode":{"type":"integer","description":"Always `0`. Ignore them."},"LstItems":{"type":"array","items":{"type":"object","properties":{"ItemDetCode":{"type":"integer","description":"Logic ERP's internal item number."},"DO_Txn_Code":{"type":"integer","description":"Logic ERP's internal delivery order line number; `0` when your setup combines lines (see the rules)."},"Lot_Code":{"type":"integer","description":"Internal number of the lot reserved for the line."},"AddlItemCode":{"type":"string","description":"The item's additional code, for example a barcode."},"LogicUser_Code":{"type":"string","description":"Item code as shown in Logic ERP (`UserCode` in Get Item Master)."},"Packing_Box_No":{"type":"string","description":"Box number(s) the goods are packed in; empty when not packed."},"Packing_Box_Weight":{"type":"number","description":"Always `0`."},"Quantity":{"type":"number","description":"Quantity still pending on the line."},"Packing":{"type":"string","description":"Packing description from the item master, for example `PCS`."},"Packing_CF1":{"type":"number","description":"The item's first conversion factor and its description."},"Packing_CF1_Desc":{"type":"string","description":"The item's first conversion factor and its description."},"MRP":{"type":"number","description":"MRP in the item master."},"Lot_MRP":{"type":"number","description":"MRP of the reserved lot."},"BinCode":{"type":"integer","description":"The bin the goods are reserved in, when your setup uses bin-wise delivery orders; otherwise `0` and `\"\"`."},"BinName":{"type":"string","description":"The bin the goods are reserved in, when your setup uses bin-wise delivery orders; otherwise `0` and `\"\"`."},"ItemType":{"type":"string","nullable":true,"description":"Always `null`. Ignore it."}}},"description":"The pending 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 delivery order:

| Field                              | Type   | Meaning                                                                                                                                                                                                                                           |
| ---------------------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Doc_Code`                         | number | Logic ERP's internal delivery order number. Use it in `Doc_Codes`.                                                                                                                                                                                |
| `Doc_Prefix`                       | text   | Delivery order prefix, for example `MDO`.                                                                                                                                                                                                         |
| `Doc_Number`                       | number | Delivery order number within the prefix.                                                                                                                                                                                                          |
| `DO_Date`                          | date   | Delivery order date, `dd/MM/yyyy`.                                                                                                                                                                                                                |
| `DO_Branch_Code`                   | number | Code of the delivery order's branch.                                                                                                                                                                                                              |
| `PartyUserCode`                    | text   | Code of the sale order's party as shown in Logic ERP.                                                                                                                                                                                             |
| `SO_Head_Code`                     | number | Logic ERP's internal number of the sale order the delivery order was made from (`Vouch_Code` in [Get Sale Orders](https://kb.logicerp.com/logic-erp-learning-hub-tutorials-and-best-practices/api-documentation/orders/pull/get-sale-orders.md)). |
| `SO_No`                            | text   | That sale order's number as stored, for example `MSO 187`.                                                                                                                                                                                        |
| `SO_Date`                          | date   | That sale order's date, `dd/MM/yyyy`.                                                                                                                                                                                                             |
| `Customer_Name`                    | text   | Name of the sale order's party as kept in Logic ERP. `null` on a deleted delivery order.                                                                                                                                                          |
| `SO_Delivery_Date`                 | date   | Delivery date of the sale order lines behind the delivery order – with several lines, the earliest date set on them – `dd/MM/yyyy`; `""` when none is set; `null` on a deleted delivery order.                                                    |
| `Action_Code`                      | text   | The latest change: `"0"` = added, `"1"` = modified, `"2"` = deleted; empty when the delivery order has no change-log line.                                                                                                                        |
| `Logic_User_Name`                  | text   | The Logic ERP user who made the latest change.                                                                                                                                                                                                    |
| `CurrencyName`                     | text   | Currency of the sale order, for example `INR`.                                                                                                                                                                                                    |
| `ExchangeRate`                     | number | Exchange rate of that currency; `1` for rupees.                                                                                                                                                                                                   |
| `DisplayError`, `Doc_Type`         | text   | Always `""`. Ignore them.                                                                                                                                                                                                                         |
| `BranchCode_To`, `PickListDocCode` | number | Always `0`. Ignore them.                                                                                                                                                                                                                          |
| `LstItems`                         | list   | The pending item lines. See below.                                                                                                                                                                                                                |

When a delivery order holds lines of several sale orders, the sale-order fields are those of its last line.

**`LstItems`** — one entry per pending line (or per combined line, see the rules):

| Field                             | Type         | Meaning                                                                                                                                                                                           |
| --------------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DO_Txn_Code`                     | number       | Logic ERP's internal delivery order line number; `0` when your setup combines lines (see the rules).                                                                                              |
| `ItemDetCode`                     | number       | Logic ERP's internal item number.                                                                                                                                                                 |
| `Lot_Code`                        | number       | Internal number of the lot reserved for the line.                                                                                                                                                 |
| `AddlItemCode`                    | text         | The item's additional code, for example a barcode.                                                                                                                                                |
| `LogicUser_Code`                  | 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)). |
| `Quantity`                        | number       | Quantity still pending on the line.                                                                                                                                                               |
| `Packing`                         | text         | Packing description from the item master, for example `PCS`.                                                                                                                                      |
| `Packing_CF1`, `Packing_CF1_Desc` | number, text | The item's first conversion factor and its description.                                                                                                                                           |
| `MRP`                             | number       | MRP in the item master.                                                                                                                                                                           |
| `Lot_MRP`                         | number       | MRP of the reserved lot.                                                                                                                                                                          |
| `Packing_Box_No`                  | text         | Box number(s) the goods are packed in; empty when not packed.                                                                                                                                     |
| `Packing_Box_Weight`              | number       | Always `0`.                                                                                                                                                                                       |
| `BinCode`, `BinName`              | number, text | The bin the goods are reserved in, when your setup uses bin-wise delivery orders; otherwise `0` and `""`.                                                                                         |
| `ItemType`                        | –            | Always `null`. Ignore it.                                                                                                                                                                         |

### **Example response**

```json
{
  "GetData": [
    {
      "DisplayError": "",
      "Doc_Type": "",
      "Doc_Code": 5346,
      "Doc_Prefix": "MDO",
      "Doc_Number": 80,
      "DO_Date": "19/10/2026",
      "DO_Branch_Code": 2,
      "BranchCode_To": 0,
      "PartyUserCode": "C1045",
      "SO_Head_Code": 487042,
      "SO_No": "MSO 187",
      "SO_Date": "19/10/2026",
      "Customer_Name": "SHARMA FASHIONS - LUDHIANA",
      "SO_Delivery_Date": "25/10/2026",
      "Action_Code": "0",
      "Logic_User_Name": "RAMESH",
      "CurrencyName": "INR",
      "ExchangeRate": 1.0,
      "PickListDocCode": 0,
      "LstItems": [
        {
          "ItemDetCode": 24805,
          "DO_Txn_Code": 44800,
          "Lot_Code": 55453,
          "AddlItemCode": "8901234567012",
          "LogicUser_Code": "KUR-1001-M",
          "Packing_Box_No": "",
          "Packing_Box_Weight": 0.0,
          "Quantity": 10.0,
          "Packing": "PCS",
          "Packing_CF1": 1.0,
          "Packing_CF1_Desc": "SIZE",
          "MRP": 1499.0,
          "Lot_MRP": 1499.0,
          "BinCode": 0,
          "BinName": "",
          "ItemType": null
        }
      ]
    },
    {
      "DisplayError": "",
      "Doc_Type": "",
      "Doc_Code": 5301,
      "Doc_Prefix": "MDO",
      "Doc_Number": 61,
      "DO_Date": "07/10/2026",
      "DO_Branch_Code": 2,
      "BranchCode_To": 0,
      "PartyUserCode": "",
      "SO_Head_Code": 0,
      "SO_No": "",
      "SO_Date": null,
      "Customer_Name": null,
      "SO_Delivery_Date": null,
      "Action_Code": "2",
      "Logic_User_Name": null,
      "CurrencyName": null,
      "ExchangeRate": 0.0,
      "PickListDocCode": 0,
      "LstItems": []
    }
  ],
  "Status": true,
  "Message": "",
  "LastGlobalModifyCode": 10764,
  "resultSize": "2 KB"
}
```

### **Messages you may see**

| Message                                                                                                         | Meaning                                                                                                                                                                                                                     | What to do                                                                                                                                              |
| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *No Pending Delivery Order found...* (with `Status: true`)                                                      | Nothing has been added to the change log after your bookmark; or the delivery orders in the batch, the period or your `Doc_Codes` have no pending goods, are outside your filters or the API site setup, or were not found. | With a bookmark: store the `LastGlobalModifyCode` (it is higher when lines were read) and call again; when it equals what you sent, you are up to date. |
| `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 them 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-delivery-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.
