> Markdown versions of all pages of this connector library are available by appending `.md` to the page URL. For the full index of connectors, see [llms.txt](https://connectors.appmixer.com/llms.txt).

# appmixer.xero.accounting.FindPurchaseOrders

- Component: `appmixer.xero.accounting.FindPurchaseOrders`
- Kind: Action
- Version: 1.0.0
- Visibility: Public
- Connector: [appmixer.xero 2.3.0](https://connectors.appmixer.com/connector/appmixer.xero/2.3.0.md)
- Component page: <https://connectors.appmixer.com/connector/appmixer.xero/2.3.0/component/appmixer.xero.accounting.FindPurchaseOrders>

Find purchase orders. Optionally filter by status or date range.

## Input ports

### Port `in`

| Field | Type | Description |
| --- | --- | --- |
| Tenant ID (`tenantId`) | text | - |
| `Status` | select | Filter by purchase order status. |
| Date From (`DateFrom`) | date-time | Filter by purchase orders with a date on or after this date – YYYY-MM-DD |
| Date To (`DateTo`) | date-time | Filter by purchase orders with a date on or before this date – YYYY-MM-DD |
| Output Type (`outputType`) | select | Choose whether you want to receive the result set as one complete list, or one item at a time or stream the items to a file. For large datasets, streaming the rows to a file is the most efficient method. |

## Output ports

### Port `out`

Variables are loaded dynamically from `/component/appmixer/xero/accounting/FindPurchaseOrders?outPort=out&ignoreAuth=true`.

### Port `notFound`

_No fields defined for this port._

## Full metadata (component.json)

```json
{
  "name": "appmixer.xero.accounting.FindPurchaseOrders",
  "author": "Appmixer <info@appmixer.com>",
  "description": "Find purchase orders. Optionally filter by status or date range.",
  "version": "1.0.0",
  "private": false,
  "auth": {
    "service": "appmixer:xero",
    "scope": [
      "accounting.invoices.read"
    ]
  },
  "quota": {
    "manager": "appmixer:xero:accounting",
    "resources": "requests",
    "scope": {
      "userId": "{{userId}}"
    }
  },
  "inPorts": [
    {
      "name": "in",
      "schema": {
        "type": "object",
        "properties": {
          "tenantId": {
            "type": "string"
          },
          "Status": {
            "type": "string"
          },
          "DateFrom": {
            "type": "string",
            "format": "date"
          },
          "DateTo": {
            "type": "string",
            "format": "date"
          },
          "outputType": {
            "type": "string"
          }
        },
        "required": [
          "tenantId"
        ]
      },
      "inspector": {
        "inputs": {
          "tenantId": {
            "type": "text",
            "label": "Tenant ID",
            "index": 1,
            "source": {
              "url": "/component/appmixer/xero/accounting/ListTenants?outPort=tenants",
              "data": {
                "transform": "./transformers#tenantsToSelectArray"
              }
            }
          },
          "Status": {
            "type": "select",
            "label": "Status",
            "tooltip": "Filter by purchase order status.",
            "index": 2,
            "options": [
              {
                "clearItem": true,
                "label": "-- All --"
              },
              {
                "label": "Draft",
                "value": "DRAFT"
              },
              {
                "label": "Submitted",
                "value": "SUBMITTED"
              },
              {
                "label": "Authorised",
                "value": "AUTHORISED"
              },
              {
                "label": "Billed",
                "value": "BILLED"
              },
              {
                "label": "Deleted",
                "value": "DELETED"
              }
            ]
          },
          "DateFrom": {
            "type": "date-time",
            "config": {
              "format": "YYYY-MM-DD",
              "enableTime": false
            },
            "label": "Date From",
            "tooltip": "Filter by purchase orders with a date on or after this date – YYYY-MM-DD",
            "index": 3
          },
          "DateTo": {
            "type": "date-time",
            "config": {
              "format": "YYYY-MM-DD",
              "enableTime": false
            },
            "label": "Date To",
            "tooltip": "Filter by purchase orders with a date on or before this date – YYYY-MM-DD",
            "index": 4
          },
          "outputType": {
            "type": "select",
            "label": "Output Type",
            "index": 5,
            "defaultValue": "items",
            "tooltip": "Choose whether you want to receive the result set as one complete list, or one item at a time or stream the items to a file. For large datasets, streaming the rows to a file is the most efficient method.",
            "options": [
              {
                "label": "All at once",
                "value": "items"
              },
              {
                "label": "One at a time",
                "value": "item"
              },
              {
                "label": "File",
                "value": "file"
              }
            ]
          }
        }
      }
    }
  ],
  "outPorts": [
    {
      "name": "out",
      "source": {
        "url": "/component/appmixer/xero/accounting/FindPurchaseOrders?outPort=out&ignoreAuth=true",
        "data": {
          "properties": {
            "generateOutputPortOptions": true
          },
          "messages": {
            "in/outputType": "inputs/in/outputType",
            "in/tenantId": "dummy"
          }
        }
      }
    },
    {
      "name": "notFound"
    }
  ],
  "icon": "(data URI omitted)"
}
```
