Routes
Purchase Orders
State
Change PO State
Updates the state of the specified PO.
Important Note: Currently POs can only move forward one state per state change request.
Parameters:
| Parameter | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
| poID | path | integer | yes | Purchase Order identifier | |
| newState | body | string | yes | All PO states: 0 (setup), 1–96 (custom), 97 (ready_to_receive), 98 (partially_received), 99 (fully_received), 100 (closed), 101 (disapproved). API accepts numbers, standard names, or custom_step_N | |
| reason | body | string | no | Optional note (max 500 chars) |
Responses:
-
200 OK: State changed.
-
400 Bad Request: Invalid transition or failed validation.
-
404 Not Found: PO not found.
Response data:
| Property | Description |
|---|---|
| success | Boolean, if this operation was successful |
| state | JSON object describing current state. |
| previousState | JSON object describing previous state. |
| validNextStates | JSON object with a list of possible next states. |
patch/v2/po/{poID}/state
Request
- Base URL{{server}}:{{port}}
- AuthHTTP basic
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Response
200 OK
Changes
No recorded changes to this operation across all 4 revisions of this API.