{"_id":"598cada296193400190d879c","project":"54c0e51215af820d001a38a6","version":{"_id":"54f8de4e4339bb1900c8bffb","project":"54c0e51215af820d001a38a6","forked_from":"54f8de14c6cabe23005c02a2","__v":31,"createdAt":"2015-03-05T22:53:02.044Z","releaseDate":"2015-03-05T22:53:02.044Z","categories":["54f8de4e4339bb1900c8bffc","54f8de4e4339bb1900c8bffd","54f8de4e4339bb1900c8bffe","54f8de4e4339bb1900c8bfff","54f8de4e4339bb1900c8c000","54ff6057563d7419002d666e","55007b6ecfeeea17004717dc","5501d779f2ef1e0d003116eb","55116ef89f7c7619005f853b","554bb366f245703100ddd39f","554d226b374fec0d007e64db","555e09f18ab3180d001ac605","555e0b2b4f5e5a0d00836d77","561d1f8b92a0cc350018b24f","562a956c96b5f40d0026eb60","5654c3378a26202b00c17cb8","5697a94b0b09a41900b24546","5739d89e37b52e3200a3a3cc","57ac94252c0b220e00a94570","57ac97a1ad44fc0e003be066","57ac9a3a8f312d0e00e96c75","57ac9c187ae5c60e004ba3a3","58178bee62e4500f009404f6","581a39711a63870f008b621d","581a3b4f0c65b20f00247fcb","5926e0606c729e0f00595f95","5954033ea5bbca002d27ae91","596ce53e0aeafe00157eb1ba","596ce87a8b79f4001a8f6139","598cad2e96193400190d879a","598cbcd3dc20c6000fdfb9c3","598cbd8496193400190d8955","59fcc7c9591add0026c91457","5a020b7856ea82001c8c9342","5a09bc64a91882001c56c2ed"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1"},"category":{"_id":"598cad2e96193400190d879a","project":"54c0e51215af820d001a38a6","version":"54f8de4e4339bb1900c8bffb","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2017-08-10T18:59:58.584Z","from_sync":false,"order":12,"slug":"purchase-orders","title":"Purchase Orders"},"user":"560000e90c703d1900952ff2","__v":0,"parentDoc":null,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-08-10T19:01:54.444Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":0,"body":"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](http://help.fleetio.com/article/151-purchase-orders-overview).\n\n##Attributes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Name\",\n    \"h-1\": \"Req?/Editable?\",\n    \"h-2\": \"Description\",\n    \"6-0\": \"``description``\",\n    \"6-2\": \"Open text field for purchase order description.\",\n    \"6-1\": \"N/Y\",\n    \"0-0\": \"``approved_at``\",\n    \"0-1\": \"N/N\",\n    \"0-2\": \"Date when the purchase order was approved\",\n    \"3-0\": \"``closed_by``\",\n    \"3-1\": \"N/N\",\n    \"3-2\": \"Name of the contact/user who closed the purchase order\",\n    \"2-0\": \"``closed_at``\",\n    \"2-1\": \"N/N\",\n    \"2-2\": \"Date when the purchase order was closed\",\n    \"1-0\": \"``approved_by``\",\n    \"1-1\": \"N/N\",\n    \"1-2\": \"Name of the contact/user who approved the purchase order\",\n    \"4-0\": \"``created_at``\",\n    \"4-1\": \"N/N\",\n    \"4-2\": \"Date when the purchase order was created\",\n    \"5-0\": \"``created_by``\",\n    \"5-1\": \"N/N\",\n    \"5-2\": \"Name of the contact/user who created the purchase order\",\n    \"7-0\": \"``discount``\",\n    \"7-1\": \"N/Y\",\n    \"7-2\": \"The discount amount. This field should be present when ``discount_type`` is set to ``fixed``.\",\n    \"8-0\": \"``discount_percentage``\",\n    \"8-1\": \"N/Y\",\n    \"8-2\": \"The discount percentage. Should be present when ``discount_type`` is set to ``percentage``.\",\n    \"9-0\": \"``discount_type``\",\n    \"9-1\": \"N/Y\",\n    \"9-2\": \"Valid values are ``percentage`` and ``fixed``.\",\n    \"10-0\": \"``label_list``\",\n    \"10-1\": \"N/Y\",\n    \"10-2\": \"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\\\"``\",\n    \"11-0\": \"``number``\",\n    \"11-1\": \"N*/Y\",\n    \"11-2\": \"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.\",\n    \"14-0\": \"``purchased_at``\",\n    \"14-1\": \"N/N\",\n    \"14-2\": \"Date when the purchase order was purchased\",\n    \"15-0\": \"``purchased_by``\",\n    \"15-1\": \"N/N\",\n    \"15-2\": \"Name of the contact/user who purchased the purchase order\",\n    \"16-0\": \"``received_full_at``\",\n    \"16-1\": \"N/N\",\n    \"16-2\": \"Date when the purchase order was fully received\",\n    \"17-0\": \"``received_full_by``\",\n    \"17-1\": \"N/N\",\n    \"17-2\": \"Name of the contact/user who fully received the purchase order\",\n    \"18-0\": \"``received_partial_at``\",\n    \"18-1\": \"N/N\",\n    \"18-2\": \"Date when the purchase order was first partially received\",\n    \"19-0\": \"``received_partial_by``\",\n    \"19-1\": \"N/N\",\n    \"19-2\": \"Name of the contact/user who first partially received the purchase order\",\n    \"12-0\": \"``part_location_id``\",\n    \"12-1\": \"N*/Y\",\n    \"12-2\": \"The part location ID associated with this purchase order. Only optional in draft state.\",\n    \"20-0\": \"``shipping``\",\n    \"20-1\": \"N/Y\",\n    \"20-2\": \"The amount for shipping\",\n    \"22-0\": \"``tax_1``\",\n    \"22-1\": \"N/Y\",\n    \"22-2\": \"The amount for the Tax 1 line item. Use this if ``tax_1_type`` is set to fixed.\",\n    \"23-0\": \"``tax_1_percentage``\",\n    \"23-1\": \"N/Y\",\n    \"23-2\": \"The percentage for tax 1. Use this if ``tax_1_type`` is set to percentage.\",\n    \"24-0\": \"``tax_1_type``\",\n    \"24-1\": \"N/Y\",\n    \"24-2\": \"Can be either ``fixed`` or ``percentage``.\",\n    \"25-0\": \"``tax_2``\",\n    \"25-1\": \"N/Y\",\n    \"25-2\": \"Amount for the Tax 2 line item. Note that having this field enabled is an account level setting.\",\n    \"26-0\": \"``tax_2_percentage``\",\n    \"26-1\": \"N/Y\",\n    \"26-2\": \"Percentage for the Tax 2 line item. Note that having this field enabled is an account level setting.\",\n    \"27-0\": \"``tax_2_type``\",\n    \"27-1\": \"N/Y\",\n    \"27-2\": \"Can be either ``fixed`` or ``percentage``. Note that having this field enabled is an account level setting.\",\n    \"28-0\": \"``vendor_id``\",\n    \"28-1\": \"N*/Y\",\n    \"28-2\": \"Id of the associated vendor. Only optional in draft state.\",\n    \"21-0\": \"``state``\",\n    \"21-1\": \"N/N\",\n    \"21-2\": \"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.\\n\\nPossible state values are: ``draft``, ``pending_approval``, ``approved``, ``rejected``, ``purchased``, ``received_partial``, ``received_full``, and ``closed``.\",\n    \"13-0\": \"``purchase_order_line_items_attributes``\",\n    \"13-1\": \"N/N\",\n    \"13-2\": \"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.\"\n  },\n  \"cols\": 3,\n  \"rows\": 29\n}\n[/block]\n##States\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"State\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"``draft``\",\n    \"0-1\": \"Purchase order is in a draft state, meaning it can be edited.\",\n    \"1-0\": \"``pending_approval``\",\n    \"1-1\": \"Purchase order is waiting for a somebody to approve or reject it. It cannot be edited in this state.\",\n    \"2-0\": \"``rejected``\",\n    \"2-1\": \"Purchase order has been rejected. It can be edited in this state.\",\n    \"3-0\": \"``approved``\",\n    \"3-1\": \"Purchase order has been approved. At this point, it can no longer be edited.\",\n    \"4-0\": \"``purchased``\",\n    \"4-1\": \"Purchase order has been purchased\",\n    \"5-0\": \"``received_partial``\",\n    \"5-1\": \"Some line items has been partially received\",\n    \"6-0\": \"``received_full``\",\n    \"6-1\": \"All line items have been fully received\",\n    \"7-0\": \"``closed``\",\n    \"7-1\": \"Purchase order is complete. The only editable fields at this point are description and labels.\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]\n##State Transitions\n\nIn 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.\n\nThe 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.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"``draft``\",\n    \"h-0\": \"Initial State\",\n    \"h-1\": \"Possible Transition States\",\n    \"0-1\": \"``pending_approval``\",\n    \"h-2\": \"Endpoint\",\n    \"0-2\": \"``/purchase_orders/:number/submit_for_approval``\",\n    \"1-1\": \"``approved``\",\n    \"2-2\": \"``/purchase_orders/:number/approve``\",\n    \"2-1\": \"``approved``\",\n    \"1-2\": \"``/purchase_orders/:number/approve``\",\n    \"2-0\": \"``pending_approval``\",\n    \"3-1\": \"``rejected``\",\n    \"3-2\": \"``/purchase_orders/:number/reject``\",\n    \"4-0\": \"``rejected``\",\n    \"4-1\": \"``pending_approval``\",\n    \"4-2\": \"``/purchase_orders/:number/submit_for_approval``\",\n    \"5-1\": \"``approved``\",\n    \"5-2\": \"``/purchase_orders/:number/approve``\",\n    \"6-0\": \"``approved``\",\n    \"6-1\": \"``purchased``\",\n    \"6-2\": \"``/purchase_orders/:number/purchase``\",\n    \"8-0\": \"``received_partial``\",\n    \"9-0\": \"``received_full``\",\n    \"10-0\": \"``closed``\",\n    \"9-1\": \"``closed``\",\n    \"9-2\": \"``/purchase_orders/:number/close``\",\n    \"7-0\": \"``purchased``\",\n    \"7-1\": \"``approved``\",\n    \"7-2\": \"``/purchase_orders/:number/undo_purchase``\"\n  },\n  \"cols\": 3,\n  \"rows\": 11\n}\n[/block]","excerpt":"","slug":"reference-3","type":"basic","title":"Reference"}
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](http://help.fleetio.com/article/151-purchase-orders-overview). ##Attributes [block:parameters] { "data": { "h-0": "Name", "h-1": "Req?/Editable?", "h-2": "Description", "6-0": "``description``", "6-2": "Open text field for purchase order description.", "6-1": "N/Y", "0-0": "``approved_at``", "0-1": "N/N", "0-2": "Date when the purchase order was approved", "3-0": "``closed_by``", "3-1": "N/N", "3-2": "Name of the contact/user who closed the purchase order", "2-0": "``closed_at``", "2-1": "N/N", "2-2": "Date when the purchase order was closed", "1-0": "``approved_by``", "1-1": "N/N", "1-2": "Name of the contact/user who approved the purchase order", "4-0": "``created_at``", "4-1": "N/N", "4-2": "Date when the purchase order was created", "5-0": "``created_by``", "5-1": "N/N", "5-2": "Name of the contact/user who created the purchase order", "7-0": "``discount``", "7-1": "N/Y", "7-2": "The discount amount. This field should be present when ``discount_type`` is set to ``fixed``.", "8-0": "``discount_percentage``", "8-1": "N/Y", "8-2": "The discount percentage. Should be present when ``discount_type`` is set to ``percentage``.", "9-0": "``discount_type``", "9-1": "N/Y", "9-2": "Valid values are ``percentage`` and ``fixed``.", "10-0": "``label_list``", "10-1": "N/Y", "10-2": "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\"``", "11-0": "``number``", "11-1": "N*/Y", "11-2": "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.", "14-0": "``purchased_at``", "14-1": "N/N", "14-2": "Date when the purchase order was purchased", "15-0": "``purchased_by``", "15-1": "N/N", "15-2": "Name of the contact/user who purchased the purchase order", "16-0": "``received_full_at``", "16-1": "N/N", "16-2": "Date when the purchase order was fully received", "17-0": "``received_full_by``", "17-1": "N/N", "17-2": "Name of the contact/user who fully received the purchase order", "18-0": "``received_partial_at``", "18-1": "N/N", "18-2": "Date when the purchase order was first partially received", "19-0": "``received_partial_by``", "19-1": "N/N", "19-2": "Name of the contact/user who first partially received the purchase order", "12-0": "``part_location_id``", "12-1": "N*/Y", "12-2": "The part location ID associated with this purchase order. Only optional in draft state.", "20-0": "``shipping``", "20-1": "N/Y", "20-2": "The amount for shipping", "22-0": "``tax_1``", "22-1": "N/Y", "22-2": "The amount for the Tax 1 line item. Use this if ``tax_1_type`` is set to fixed.", "23-0": "``tax_1_percentage``", "23-1": "N/Y", "23-2": "The percentage for tax 1. Use this if ``tax_1_type`` is set to percentage.", "24-0": "``tax_1_type``", "24-1": "N/Y", "24-2": "Can be either ``fixed`` or ``percentage``.", "25-0": "``tax_2``", "25-1": "N/Y", "25-2": "Amount for the Tax 2 line item. Note that having this field enabled is an account level setting.", "26-0": "``tax_2_percentage``", "26-1": "N/Y", "26-2": "Percentage for the Tax 2 line item. Note that having this field enabled is an account level setting.", "27-0": "``tax_2_type``", "27-1": "N/Y", "27-2": "Can be either ``fixed`` or ``percentage``. Note that having this field enabled is an account level setting.", "28-0": "``vendor_id``", "28-1": "N*/Y", "28-2": "Id of the associated vendor. Only optional in draft state.", "21-0": "``state``", "21-1": "N/N", "21-2": "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.\n\nPossible state values are: ``draft``, ``pending_approval``, ``approved``, ``rejected``, ``purchased``, ``received_partial``, ``received_full``, and ``closed``.", "13-0": "``purchase_order_line_items_attributes``", "13-1": "N/N", "13-2": "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." }, "cols": 3, "rows": 29 } [/block] ##States [block:parameters] { "data": { "h-0": "State", "h-1": "Description", "0-0": "``draft``", "0-1": "Purchase order is in a draft state, meaning it can be edited.", "1-0": "``pending_approval``", "1-1": "Purchase order is waiting for a somebody to approve or reject it. It cannot be edited in this state.", "2-0": "``rejected``", "2-1": "Purchase order has been rejected. It can be edited in this state.", "3-0": "``approved``", "3-1": "Purchase order has been approved. At this point, it can no longer be edited.", "4-0": "``purchased``", "4-1": "Purchase order has been purchased", "5-0": "``received_partial``", "5-1": "Some line items has been partially received", "6-0": "``received_full``", "6-1": "All line items have been fully received", "7-0": "``closed``", "7-1": "Purchase order is complete. The only editable fields at this point are description and labels." }, "cols": 2, "rows": 8 } [/block] ##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. [block:parameters] { "data": { "0-0": "``draft``", "h-0": "Initial State", "h-1": "Possible Transition States", "0-1": "``pending_approval``", "h-2": "Endpoint", "0-2": "``/purchase_orders/:number/submit_for_approval``", "1-1": "``approved``", "2-2": "``/purchase_orders/:number/approve``", "2-1": "``approved``", "1-2": "``/purchase_orders/:number/approve``", "2-0": "``pending_approval``", "3-1": "``rejected``", "3-2": "``/purchase_orders/:number/reject``", "4-0": "``rejected``", "4-1": "``pending_approval``", "4-2": "``/purchase_orders/:number/submit_for_approval``", "5-1": "``approved``", "5-2": "``/purchase_orders/:number/approve``", "6-0": "``approved``", "6-1": "``purchased``", "6-2": "``/purchase_orders/:number/purchase``", "8-0": "``received_partial``", "9-0": "``received_full``", "10-0": "``closed``", "9-1": "``closed``", "9-2": "``/purchase_orders/:number/close``", "7-0": "``purchased``", "7-1": "``approved``", "7-2": "``/purchase_orders/:number/undo_purchase``" }, "cols": 3, "rows": 11 } [/block]