# Retrieving Items in Transaction Scope

### Data Retrieval Methods

#### Get Single Transaction-Scope Item

* **Description:** Retrieves a specific transaction-scope item using the get function, requiring both a transaction key and an item key (UUID, ExternalID, or InternalID).
* **Syntax:**

  ```javascript
  pepperi.api.transactionScopeItems.get({
    transaction: { UUID: "<transaction UUID>" },
    item: { UUID: "<item UUID>" }, // or { ExternalID: "" } or { InternalID: 123 }
    fields: ["Price", "Item.Name"]
  });
  ```
* **Example:**

  ```javascript
  pepperi.api.transactionScopeItems.get({
    transaction: { UUID: "txn123e-74ac-4041-8bb1-a76a3b5e78d8" },
    item: { UUID: "itm456f-74ac-4041-8bb1-a76a3b5e78d9" },
    fields: ["Price", "Item.Name"]
  });
  ```
* **Returns:**

  ```json
  {
    "success": true,
    "object": {
      "UUID": "aefb523e-74ac-4041-8bb1-a76a3b5e78d8",
      "Price": 123.4,
      "Item.Name": "Item AB Test1"
    }
  }
  ```

#### Search List of Transaction-Scope Items by Filter

* **Description:** Retrieves multiple transaction-scope items using the search function, available from CPI 16. Requires a transaction key and supports filters, sorting, page size, and page number.
* **Syntax:**

  ```javascript
  pepperi.api.transactionScopeItems.search({
    transaction: { UUID: "<transaction UUID>" },
    fields: ["UUID", "ItemExternalID", "MyTSA"],
    filter: { <filter object> },
    sorting: [{ Field: "<fieldName>", Ascending: <boolean> }],
    pageSize: <number>,
    page: <number>
  });
  ```
* **Example:**

  ```javascript
  pepperi.api.transactionScopeItems.search({
    transaction: { UUID: "txn123e-74ac-4041-8bb1-a76a3b5e78d8" },
    fields: ["UUID", "ItemExternalID", "MyTSA"],
    filter: {
      "Operation": "AND",
      "LeftNode": { "ApiName": "APIName1", "Operation": ">", "Values": ["7"] },
      "RightNode": { "ApiName": "ApiName2", "Operation": "InTheLast", "Values": ["4", "Weeks"] }
    },
    sorting: [{ "Field": "MyTSA", "Ascending": true }, { "Field": "MyTSA2", "Ascending": true }],
    pageSize: 1000,
    page: 1
  });
  ```
* **Returns:**

  ```json
  {
    "success": true,
    "objects": [
      {
        "UUID": "aefb523e-74ac-4041-8bb1-a76a3b5e78d8",
        "ItemExternalID": "abc123",
        "MyTSA": 12.8
      },
      {
        "UUID": "aefb5346-74ac-4041-8bb1-a76a3b5e734h",
        "ItemExternalID": "abc456",
        "MyTSA": 34.5
      }
    ]
  }
  ```

{% hint style="warning" %}
**Note:** Supported from CPI 16 only.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.pepperi.com/retrieving-data-1/retrieving-transactions-items.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
