API documentation
Method list
Test your request
Changelog


getInventoryPurchaseOrderLogs
Returns a list of log entries for a given purchase order, allowing to track status changes, item modifications, and other events.


Input parameters
purchase_order_idintPurchase order (delivery) identifier.
date_fromint(optional) Date from which logs are to be retrieved. Unix timestamp format.
date_toint(optional) Date to which logs are to be retrieved. Unix timestamp format.
log_typearray(optional) Array of event type IDs you want to retrieve. Available values:
0 - Purchase order creation
1 - Purchase order deletion
2 - Status change
3 - Email sent to supplier
4 - Text field modifications
5 - Items modifications
6 - Landed costs modifications
7 - Packages modifications
8 - Shared via supply page
9 - Item negotiations
10 - Purchase order merge
11 - Purchase order split
sortvarchar(4)(optional) Log sorting direction. Default: "ASC".
pageint(optional) Results paging (100 log groups per page).



Output data
The method returns the data in JSON format.
statusvarchar(30)SUCCESS - request executed correctly
ERROR - an error occurred during an API request. Error details will be described in 2 additional returned fields: error_message and error_code
logsarrayAn array of logs grouped by date and the profile executing the change.
| - profiletextThe name of the profile that performed the change.
| - dateintEvent date (unix timestamp).
| - entriesarrayAn array of events performed by a given profile at a given time.
log_type (text) - Event type key. Possible values:
"purchase_order_creation"
"purchase_order_deletion"
"status_change"
"email_sent_to_supplier"
"text_field_modification"
"items_modification"
"landed_costs_modification"
"packages_modification"
"shared_via_supply_page"
"item_negotiations"
"purchase_order_merge"
"purchase_order_split".
status_key (text) - New status key. Returned only for log_type "status_change". Possible values: "draft", "sent", "received_not_started", "received", "completed", "completed_partially", "canceled".
field_key (text) - Modified field key. Returned only for log_type "text_field_modification". Possible values: "name", "status", "full_number", "notes".
previous_value (text) - Previous value of the modified text field. Returned only for log_type "text_field_modification".
email_recipient (text) - Email recipient. Returned only for log_type "email_sent_to_supplier".
items_changes_count (int) - Number of item modifications grouped in this log entry. Returned only for log_type "items_modification".
landed_costs_changes_count (int) - Number of landed costs modifications grouped in this log entry. Returned only for log_type "landed_costs_modification".
packages_changes_count (int) - Number of packages modifications grouped in this log entry. Returned only for log_type "packages_modification".
item_negotiations_count (int) - Number of negotiation changes grouped in this log entry. Returned only for log_type "item_negotiations".
related_purchase_order_id (int) - Identifier of the related purchase order. Returned only for log_type "purchase_order_merge" or "purchase_order_split".
related_purchase_order_full_number (text) - Full number of the related purchase order. Returned only for log_type "purchase_order_merge" or "purchase_order_split".



Sample
Input data:
Output data:
A sample request in PHP: