> 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/masters/pull/get-item-sets.md).

# Get Item Sets

Returns **item sets** – fixed bundles of items sold or packed together, such as a size set (one piece each of S, M, L, XL) or a combo pack – with the items and quantities in each set. Use it to look up a set by its number, or to copy all your sets into your own system.

Two endpoints return this data:

| Endpoint       | Use it to                                                                                       |
| -------------- | ----------------------------------------------------------------------------------------------- |
| `PullSetItems` | **Recommended.** Look a set up by its number (`SetCode_ID`), or read all sets in batches.       |
| `GetSetItems`  | Look up **one set by its name or user-defined code** only. It reads `SetCode` and nothing else. |

Both return the same record shape. (When the caller is the Logic WMS mobile app, `GetSetItems` returns a different answer meant for that app; this page describes the answer for every other API site.)

### **Endpoint**

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

The response is 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). These endpoints **do not use the change log**: `GlobalModifyCode` here is a set-number bookmark of their own (see below), and `Doc_Codes`, `Doc_Num_Like` and the branch fields are not read.

### **Request fields – PullSetItems**

| Field                | Type   | Required                                                                                 | Default | Meaning                                                                                             |
| -------------------- | ------ | ---------------------------------------------------------------------------------------- | ------- | --------------------------------------------------------------------------------------------------- |
| `SetCode`            | text   | One of `SetCode`, `UDSetCode`, `SetName`, `SetCode_ID` or `GlobalModifyCode` is required | empty   | The set's name or its user-defined set code (the code or barcode entered for the set in Logic ERP). |
| `UDSetCode`          | text   |                                                                                          | empty   | Same as `SetCode`. Ignored when `SetCode` is filled.                                                |
| `SetName`            | text   |                                                                                          | empty   | The set's name or its user-defined set code.                                                        |
| `SetCode_ID`         | number |                                                                                          | `0`     | Logic ERP's number for the set (`SetCode` in the response). Send a positive number.                 |
| `GlobalModifyCode`   | number |                                                                                          | `0`     | Bookmark: return sets whose Logic ERP number is **greater than** this. See "Reading all sets".      |
| `DateFrom`, `DateTo` | date   | No                                                                                       | empty   | Not used – they are ignored.                                                                        |

### **Request fields – GetSetItems**

| Field     | Type | Required | Default | Meaning                                      |
| --------- | ---- | -------- | ------- | -------------------------------------------- |
| `SetCode` | text | Yes      | –       | The set's name or its user-defined set code. |

Any other field sent to `GetSetItems` is ignored.

### **Rules Logic ERP applies**

* **Look up by number:** `SetCode_ID` returns that set with its items.
* **Look up by name or user-defined code** (`SetCode`, `UDSetCode`, `SetName`): returns the set whose name or user-defined code is exactly the value you sent.
* Each response holds at most **100 item lines** in total (not 100 sets), taken in order of the set's Logic ERP number.
* Item quantities are whole numbers; a fractional quantity in a set is rounded.
* There is no branch filter.

#### **Reading all sets**

1. Send `"GlobalModifyCode": 1` (a request with nothing filled is refused; Logic ERP's set numbers start above 1).
2. Store `LastGlobalModifyCode` from the response – it is the number of the last set returned.
3. Send that number as `GlobalModifyCode` to get the next sets.
4. When there are no more sets, the response has `Status: false`, a message starting `Unable to found Sets` and `LastGlobalModifyCode: 0`. Stop there and **keep your stored bookmark** – do not store the `0`.

* **The 100-line boundary.** When reading with the bookmark, a set is not split between responses: if a response reaches the 100-line limit, its last set is left out and `LastGlobalModifyCode` is the set before it, so that set comes whole in the next call. Only a single set with more than 100 item lines is still cut at 100 lines.

Sets are not returned again when they are edited later – the bookmark only moves forward through set numbers.

### **Example request**

One set by its number:

```json
{
  "SetCode_ID": 1537,
  "SetCode": "",
  "SetName": "",
  "UDSetCode": "",
  "GlobalModifyCode": 0
}
```

The next batch of sets after the stored bookmark `1536`:

```json
{
  "SetCode_ID": 0,
  "GlobalModifyCode": 1536
}
```

### **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**. Look a set up by `SetCode_ID`, `SetName` or `SetCode` here. Do not send `"GlobalModifyCode": -1` here – it changes what the sandbox has marked as already sent.

## Get Item Sets

> Returns item sets – fixed bundles of items sold or packed together, such as a size set (one piece each of S, M, L, XL) or a combo pack – with the items and quantities in each set. Use it to look up a set by its number, or to copy all your sets into your own system.

```json
{"openapi":"3.0.3","info":{"title":"Logic ERP API","version":"1.0"},"tags":[{"name":"Masters - 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":{"/PullSetItems":{"post":{"tags":["Masters - Pull"],"operationId":"PullSetItems","summary":"Get Item Sets","description":"Returns item sets – fixed bundles of items sold or packed together, such as a size set (one piece each of S, M, L, XL) or a combo pack – with the items and quantities in each set. Use it to look up a set by its number, or to copy all your sets into your own system.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"SetCode_ID":{"type":"integer","description":"Logic ERP's number for the set (`SetCode` in the response). Send a positive number."},"SetCode":{"type":"string","description":"The set's name or its user-defined set code (the code or barcode entered for the set in Logic ERP)."},"SetName":{"type":"string","description":"The set's name or its user-defined set code."},"UDSetCode":{"type":"string","description":"Same as `SetCode`. Ignored when `SetCode` is filled."},"GlobalModifyCode":{"type":"integer","description":"Bookmark: return sets whose Logic ERP number is greater than this. See \"Reading all sets\"."},"DateFrom":{"type":"string","description":"Not used – they are ignored."},"DateTo":{"type":"string","description":"Not used – they are ignored."}}}}}},"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":{"SetCode":{"type":"integer","description":"Logic ERP's number for the set. Use it in `SetCode_ID`."},"SetName":{"type":"string","description":"Name of the set."},"UDSetCode":{"type":"string","description":"The user-defined set code. A single space (`\" \"`) when none was entered."},"ListItems":{"type":"array","items":{"type":"object","properties":{"LogicUser_Code":{"type":"string","description":"Item code, as `UserCode` in Get Item Master."},"AddItemCode":{"type":"string","description":"Item barcode / EAN, as `AddlItemCode` in Get Item Master."},"Item_Name":{"type":"string","description":"Item name including its colour, as shown in Logic ERP."},"ItemDetCode":{"type":"string","description":"Logic ERP's number for the item and size, as `ItemDetailCode` in Get Item Master (written as text here)."},"Group_Name":{"type":"string","description":"Item group at the first group level."},"Color_Name":{"type":"string","description":"Colour."},"Pack_Name":{"type":"string","description":"Size / pack."},"Qty":{"type":"integer","description":"How many of this item the set contains."}}},"description":"The items in the set – 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 record in `GetData` is one set:

| Field       | Type   | Meaning                                                                  |
| ----------- | ------ | ------------------------------------------------------------------------ |
| `SetCode`   | number | Logic ERP's number for the set. Use it in `SetCode_ID`.                  |
| `SetName`   | text   | Name of the set.                                                         |
| `UDSetCode` | text   | The user-defined set code. A single space (`" "`) when none was entered. |
| `ListItems` | list   | The items in the set – see below.                                        |

**`ListItems`** – one line per item in the set:

| Field            | Type   | Meaning                                                                                                                                                                       |
| ---------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LogicUser_Code` | text   | Item code, as `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). |
| `AddItemCode`    | text   | Item barcode / EAN, as `AddlItemCode` in Get Item Master.                                                                                                                     |
| `Item_Name`      | text   | Item name including its colour, as shown in Logic ERP.                                                                                                                        |
| `ItemDetCode`    | text   | Logic ERP's number for the item and size, as `ItemDetailCode` in Get Item Master (written as text here).                                                                      |
| `Group_Name`     | text   | Item group at the first group level.                                                                                                                                          |
| `Color_Name`     | text   | Colour.                                                                                                                                                                       |
| `Pack_Name`      | text   | Size / pack.                                                                                                                                                                  |
| `Qty`            | number | How many of this item the set contains.                                                                                                                                       |

### **Example response**

```json
{
  "GetData": [
    {
      "SetCode": 1537,
      "SetName": "KURTA SET 5",
      "UDSetCode": "KS5",
      "ListItems": [
        {
          "LogicUser_Code": "10421",
          "AddItemCode": "8901234561029",
          "Item_Name": "KURTA KRT1042 BLUE",
          "ItemDetCode": "3326",
          "Group_Name": "KURTAS",
          "Color_Name": "BLUE",
          "Pack_Name": "M",
          "Qty": 1
        },
        {
          "LogicUser_Code": "10422",
          "AddItemCode": "8901234561036",
          "Item_Name": "KURTA KRT1042 BLUE",
          "ItemDetCode": "3327",
          "Group_Name": "KURTAS",
          "Color_Name": "BLUE",
          "Pack_Name": "L",
          "Qty": 1
        }
      ]
    }
  ],
  "Status": true,
  "Message": "Success",
  "LastGlobalModifyCode": 1537,
  "resultSize": "1 KB"
}
```

### **Messages you may see**

| Message                                           | Meaning                                                                                                                                          | What to do                                                                            |
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------- |
| `Success` (with `Status: true`)                   | Sets were found.                                                                                                                                 | –                                                                                     |
| `Invalid Set Code/Name...` (with `Status: false`) | Nothing to look for: no `SetCode`, `UDSetCode`, `SetName`, `SetCode_ID` or `GlobalModifyCode` was sent (for `GetSetItems`: `SetCode` was empty). | Fill `SetCode_ID` or `GlobalModifyCode`.                                              |
| `Unable to found Sets` (with `Status: false`)     | No set matches – or, when reading with the bookmark, there are no more sets.                                                                     | Check the number; when reading with the bookmark, stop and keep your stored bookmark. |
| Another text with `Status: false`                 | The request could not be processed.                                                                                                              | If it continues, send the text to your Logic ERP support team.                        |


---

# 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/masters/pull/get-item-sets.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.
