Purchase Orders in Fleetio are designed to help standardize parts procurement through a purchasing workflow and vendor history tracking. For more information, check out our help center article.
Attributes
Name | Req?/Editable? | Description |
---|---|---|
approved_at | N/N | Date when the purchase order was approved |
approved_by | N/N | Name of the contact/user who approved the purchase order |
closed_at | N/N | Date when the purchase order was closed |
closed_by | N/N | Name of the contact/user who closed the purchase order |
created_at | N/N | Date when the purchase order was created |
created_by | N/N | Name of the contact/user who created the purchase order |
description | N/Y | Open text field for purchase order description. |
discount | N/Y | The discount amount. This field should be present when discount_type is set to fixed . |
discount_percentage | N/Y | The discount percentage. Should be present when discount_type is set to percentage . |
discount_type | N/Y | Valid values are percentage and fixed . |
label_list | N/Y | A comma separated list of tags/labels for the work order. The only delimiter allowed is a comma. Please remove any commas from your labels before saving the work order. Sample value: "High Priority,Truck,Repair/Maintenance" |
number | N*/Y | Purchase order number. Must be unique across your account. You can either generate your own or leave it blank and have Fleetio generate one for you. Fleetio will simply use the next number in the sequence based on your existing work orders. This becomes the unique identifier, even in endpoints. Id is never used. |
part_location_id | N*/Y | The part location ID associated with this purchase order. Only optional in draft state. |
purchase_order_line_items_attributes | N/N | Line item data for this purchase order. Note that you can either specify the line item data as a nested attribute, or hit the PurchaseOrderLineItem endpoint independently. |
purchased_at | N/N | Date when the purchase order was purchased |
purchased_by | N/N | Name of the contact/user who purchased the purchase order |
received_full_at | N/N | Date when the purchase order was fully received |
received_full_by | N/N | Name of the contact/user who fully received the purchase order |
received_partial_at | N/N | Date when the purchase order was first partially received |
received_partial_by | N/N | Name of the contact/user who first partially received the purchase order |
shipping | N/Y | The amount for shipping |
state | N/N | The state this purchase order is in. This value cannot be edited directly. To change the purchase order's state, you will have to use the appropriate of the API endpoints. Possible state values are: draft , pending_approval , approved , rejected , purchased , received_partial , received_full , and closed . |
tax_1 | N/Y | The amount for the Tax 1 line item. Use this if tax_1_type is set to fixed. |
tax_1_percentage | N/Y | The percentage for tax 1. Use this if tax_1_type is set to percentage. |
tax_1_type | N/Y | Can be either fixed or percentage . |
tax_2 | N/Y | Amount for the Tax 2 line item. Note that having this field enabled is an account level setting. |
tax_2_percentage | N/Y | Percentage for the Tax 2 line item. Note that having this field enabled is an account level setting. |
tax_2_type | N/Y | Can be either fixed or percentage . Note that having this field enabled is an account level setting. |
vendor_id | N*/Y | Id of the associated vendor. Only optional in draft state. |
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
In order to transition between purchase order states, you must call the appropriate API endpoints with the PATCH method. Currently, 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. 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 |