---
title: "Preview Next Po Number"
method: GET
path: "/api/v1/materials/next-po-number/preview"
tags: ["v1", "Materials"]
---

# Preview Next Po Number

`GET /api/v1/materials/next-po-number/preview`

## Request

- Base URL: `https://api.jeevyfabrication.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.jeevyfabrication.com/api/v1/materials/next-po-number/preview`
- Auth: none declared

Read-only peek at what next-po-number WOULD mint, without consuming it.

Mirrors next_vendor_po_number()'s exact formatting (`<project_number>-P<seq>`,
falling back to the project id when project_number is blank) via a plain
SELECT instead of the RPC's row-locking UPDATE — no increment, no
side-effects, safe to call on every render/reopen.

Vinay reads the raised-PO count directly off this number, so a "preview"
that silently burned it (the old RaisePOConfirmModal prefetch, removed
2026-07-22 — see CLAUDE.md) made it look like dozens of POs had gone out
before a single one actually had. This is what makes a live preview safe
to bring back: `next_seq`/`project_number` are returned separately (not
just the formatted string) so the frontend can project subsequent groups'
numbers in the same raise batch without calling this once per group.

## Query parameters

- `project_id` integer, nullable

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api.md) - [All operations](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/llms.txt) - [OpenAPI document](https://skmtc.dev/jeevyfabrication/apis/bom-generation-api/revisions/ad9a01abeac9?raw)
