The Purchase Order Revisions API allows you to read access to PO Change History. This API contains a record for each change to a PO, whether the change results in the PO being resent to the supplier (like a new line or modified quantity on a line) or if the change is internal (like changing an Account Code).
The API is similar in structure to the Purchase Order API with three main differences:
- The record contains a 'revision-record' element. This contains information about the specific 'internal revision' or change to the PO captured in this record.
- With few exceptions, only fields which have changed fields are visible. The only fields which will be visible regardless of the change are the PO ID, the PO Line ID, or the <created/> and <deleted/> fields which appear as 'true' if that has been added or removed.
- Each non PO ID or PO Line ID field element contains two new elements <from/> and <to/>. The <to/> field will contain the new values which were created or updated in this revision while the <from/> field contains the values from the previous revision. This is explained in more detail below in the Field Definitions section.
The URL to access purchase orders is:
Order Purchase Order Revisions API allows you to:
|POST||/api/purchase_order_revisions||create||Create purchase order revision|
|POST||/api/purchase_orders/:purchase_order_id/revisions||create||Create purchase order revision|
|GET||/api/purchase_order_revisions||index||Query purchase order revisions|
|GET||/api/purchase_orders/:purchase_order_id/revisions||index||Query purchase order revisions|
|GET||/api/purchase_order_revisions/:id||show||Show purchase order revision|
|GET||/api/purchase_orders/:purchase_order_id/revisions/:id||show||Show purchase order revision|
|PATCH||/api/purchase_order_revisions/:id||update||Update purchase order revision|
|PUT||/api/purchase_order_revisions/:id||update||Update purchase order revision|
|PATCH||/api/purchase_orders/:purchase_order_id/revisions/:id||update||Update purchase order revision|
|PUT||/api/purchase_orders/:purchase_order_id/revisions/:id||update||Update purchase order revision|
- There are dependent fields that become queryable based the value from the source field. For example, if you query against po-method=email, then po-email can be added as an additional query criteria. Please see fields with Yes*.
- For large data set and for performance optimization, you should always limit your result with some GET criteria.
- PO changes do not always increment the version number (see http://support.coupa.com/entries/628...use-a-revision). The updated-at field can always be used to determine whether any changes have been made.