Purchase Order Lifecycle
A Purchase Order advances through a series of states throughout its lifecycle.
This diagram illustrates the different states in the lifecycle and the transitions between them. The most typical transition paths are shown in solid lines, while dotted lines indicate possible but less common paths.
States
State | Description |
---|---|
draft | Purchase Order is in a draft state, meaning it can be edited. |
pending_approval | Purchase Order is waiting for a somebody to approve or reject it. It cannot be edited in this state. |
rejected | Purchase Order has been rejected. It can be edited in this state. |
approved | Purchase Order has been approved. At this point, it can no longer be edited. |
purchased | Purchase Order has been purchased |
received_partial | Some line items has been partially received |
received_full | All line items have been fully received |
closed | Purchase Order is complete. The only editable fields at this point are description and labels. |
State Transitions
To transition from one state to the next, you must call the appropriate API endpoint with the PATCH
method.
info
We do not support receiving inventory in the Purchase Orders API.
The table below describes which all possible states and which endpoints you need to call to perform the transition.
caution
If you attempt to call an endpoint and the transition is impossible, you will get a HTTP 422 with an error in the response body.
Initial State | Possible Transition States | Endpoint |
---|---|---|
draft | pending_approval | /purchase_orders/:number/submit_for_approval |
approved | /purchase_orders/:number/approve | |
pending_approval | approved | /purchase_orders/:number/approve |
rejected | /purchase_orders/:number/reject | |
rejected | pending_approval | /purchase_orders/:number/submit_for_approval |
approved | /purchase_orders/:number/approve | |
approved | purchased | /purchase_orders/:number/purchase |
purchased | approved | /purchase_orders/:number/undo_purchase |
received_partial | ||
received_full | closed | /purchase_orders/:number/close |
closed |