# Report purchase orders by issue date

```http
POST https://secure.yoprint.com/v1/api/store/{team_slug}/report/purchase_order
```

- API version: v1
- Operation ID: `v1_public_report_purchase_order`
- Section: Reports › [Reports](https://developer.yoprint.com/reference/reports.md)
- Web page: https://developer.yoprint.com/reference/reports/v1-report-purchase-order/
- Authentication: `Authorization: Bearer YOUR_API_KEY`

Returns every purchase order issued in the period, in full. Amounts (`calc_subtotal`, `calc_tax`, `calc_total`) are decimal strings with 4 decimal places (`"125.0000"`).

## Permission

Needs the View Reports permission. Otherwise 403 with a bare `{ "message": "Insufficient Permission" }` (no `success` or `error` envelope).

## Business rules

- A purchase order is in the period when its issue date is between `start_date` and `end_date`, inclusive.

## Path parameters

- `team_slug` (string, required): Your team slug, shown as Team ID next to your API key in Profile. Example `your-team`.

## Request body

Content type `application/json`, required.

Fields:

- `end_date` (string (date-time), required): End of the period (ISO 8601), inclusive: send `23:59:59` to include the whole last day. In UTC, like `start_date` (an offset is dropped, not applied).
- `start_date` (string (date-time), required): Start of the period (ISO 8601), inclusive, to the second: send the start of the day. Send it in UTC (`Z`): the date and time are compared with UTC as written and any offset is dropped, so `2026-10-01T00:00:00-05:00` means midnight UTC.

### Example request

```bash
curl -X POST 'https://secure.yoprint.com/v1/api/store/your-team/report/purchase_order' \
  -H 'Authorization: Bearer YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'X-Yoprint-Decimal-Format: exact-v1' \
  -H 'Content-Type: application/json' \
  -d '{
    "end_date": "2026-11-30T23:59:59Z",
    "start_date": "2026-11-01T00:00:00Z"
  }'
```

## Response

`200` Successful response.

Fields:

- `data` (array of objects, required)
  - Each item:
    - `calc_subtotal` (string | null, optional): Subtotal, 4 decimal places. A decimal string, such as `"125.0000"`; parse it as a decimal.
    - `calc_tax` (string | null, optional): Tax. A decimal string, such as `"0.0000"`; parse it as a decimal.
    - `calc_total` (string | null, optional): Total. A decimal string, such as `"125.0000"`; parse it as a decimal.
    - `due_date` (string (date-time) | null, optional): Due date. ISO 8601 with offset, or null.
    - `id` (string, optional): The purchase order.
    - `issue_date` (string (date-time) | null, optional): Issue date. ISO 8601 with offset, or null.
    - `name` (string | null, optional)
    - `pdf_url` (any, optional): PDF link with its own access token.
    - `scoped_id` (string | null, optional): The PO number.
    - `status_id` (string | null, optional): The PO status.
    - `tax_mode` (string | null, optional)
    - `tax_rate` (string | null, optional): Tax rate. A decimal string, such as `"24.00000000"`; parse it as a decimal.
    - `vendor_id` (string | null, optional): The vendor.
    - `warehouse_id` (string | null, optional): The warehouse.
- `status` (integer, required)
- `success` (boolean, required)

Example response:

```json
{
  "data": [
    {
      "calc_subtotal": "125.0000",
      "calc_tax": "0.0000",
      "calc_total": "125.0000",
      "due_date": "2026-11-03T00:00:00+00:00",
      "id": "7vsJXKGghZrXt6",
      "issue_date": "2026-11-02T00:00:00+00:00",
      "name": "Blanks for SO1001",
      "scoped_id": "PO0042",
      "status_id": "25xgwxzs4paoV2",
      "tax_mode": null,
      "tax_rate": null,
      "vendor_id": "bWecZtQvmMt3Cw",
      "warehouse_id": null
    }
  ],
  "status": 200,
  "success": true
}
```

## Errors

- `401` The API key is missing or wrong (`unauthenticated`).
- `403` You are not allowed to do this. `api_access_not_in_plan`: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only `{"message": "Insufficient Permission"}`. Other refusals use the error envelope, with `unauthorized` or `user_is_not_authorized`.
  - When: Your role lacks View Reports. Fix: Ask the team owner to turn on View Reports for your permission group.
- `404` Not found. `page_not_found`: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. `code: null`, with a message that starts "No query results for": there is no record with that id.
- `422` The request was refused and changed nothing. `validation_failed` lists what to fix in `error.fields`; other codes name a business rule, explained in `error.message`. A few checks answer with only `{"message": "..."}`. An operation that calls another service (a payment provider, a carrier, an accounting app) can answer `connect_timeout` ("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.
  - When: `start_date` or `end_date` is missing or not ISO 8601. Fix: Send both as ISO 8601 date-times.

## Notes

- There is no paging: the whole period comes back in one response. Ask for a month or less at a time.

## Related

- [Report sales orders by issue date](https://developer.yoprint.com/reference/reports/v1-report-sales-order.md): `POST /v1/api/store/{team_slug}/report/sales_order`
