# Purchase Requests

`GET /accounting/purchase-requests`

Group: Accounting › Purchase Requests · Operation ID: `purchaseRequests`

Returns a list of purchase requests. Each row is the request header. For the full record with its line items use GET accounting/purchase-requests/:id, and to match on vendor, legal entity or department use POST accounting/purchase-requests/search.

[Open in the interactive reference](https://docs.api.lensing.ai/?op=purchaseRequests)

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `Api-Version` | header | `"v1"` | yes | The API version this request targets, named by its public identifier. Required on every request; omitting it, or naming a version this company does not have, is answered with 400. This document describes version `v1`. |

## Query surface

- `id` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `purchaseRequestNumber` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `status` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `currency` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `startDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `endDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `needByDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `paymentTerms` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `externalId` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- `lastModifiedDate` — filter by eq, ne, gt, gte, lt, lte, in, notIn, between, like
- Orderable: id, purchaseRequestNumber, status, currency, startDate, endDate, needByDate, totalAmount, lastModifiedDate
- Selectable: id, purchaseRequestNumber, description, internalDescription, externalMemo, status, currency, totalAmount, startDate, endDate, needByDate, paymentTerms, externalId, entityName, departmentName, lastModifiedDate

## Response

`200` Success

Under `data`, an array of purchaseRequestsRow:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | no | The unique identifier for the purchase request. |
| `purchaseRequestNumber` | string or null | no | The purchase request number, for example 'PR-1', unique across purchase requests. Absent until one has been assigned. |
| `description` | string or null | no | A description of what is being requested. It is shown to the vendor. |
| `internalDescription` | string or null | no | Internal notes on the request, not shown to the vendor. |
| `externalMemo` | string or null | no | A memo intended for the vendor. |
| `status` | string or null | no | The lifecycle and approval state, in one field. Possible values: 'pendingApproval', 'approved', 'rejected', 'closed'. This resource has no separate approvalStatus. |
| `currency` | string or null | no | The currency the request is denominated in. Format ISO 4217, for example 'USD'. Governs totalAmount and every line amount. |
| `totalAmount` | string (decimal) or null | no | The total requested amount, the sum of the line totals, in the request currency. |
| `startDate` | string (date) or null | no | The first day of the period the request covers. Format YYYY-MM-DD. |
| `endDate` | string (date) or null | no | The last day of the period the request covers. Format YYYY-MM-DD. |
| `needByDate` | string (date) or null | no | The date the goods or services are needed by. Format YYYY-MM-DD. |
| `paymentTerms` | string or null | no | The payment-terms key requested for the resulting order, for example 'net30'. |
| `externalId` | string or null | no | The identifier this request has in the upstream system that produced it. It is not unique. |
| `entityName` | string or null | no | The name of the legal entity this request belongs to. |
| `departmentName` | string or null | no | The name of the department raising the request. |
| `lastModifiedDate` | string (date-time) or null | no | The date and time the purchase request last changed, in UTC. Format YYYY-MM-DDTHH:mm:ss.sssZ. |

## Statuses

- `400` — Invalid request or business failure
- `401` — Missing or invalid access token
- `403` — Not authorized
- `404` — Not found
- `429` — Too many requests
- `500` — Internal server error
