getInventoryPurchaseOrders
The method allows you to retrieve a list of purchase orders from BaseLinker storage.
Input parameters
Output data:
A sample request in PHP:
| warehouse_id | int | (optional) Warehouse ID. The list of identifiers can be retrieved using the method getInventoryWarehouses. |
| supplier_id | int | (optional) Limiting results to a specific supplier ID |
| series_id | int | (optional) Limiting results to a specific document series ID |
| date_from | int | (optional) Date from which documents should be retrieved (Unix timestamp) |
| date_to | int | (optional) Date up to which documents should be retrieved (Unix timestamp) |
| filter_document_number | varchar(50) | (optional) Filtering by document number (full or partial match) |
| page | int | (optional) Results paging (100 documents per page) |
Output data
The method returns the data in JSON format.
| status | varchar(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 |
| purchase_orders | array | List of purchase orders. Each element contains fields listed below |
| | - id | int | Purchase order identifier |
| | - name | varchar(80) | Purchase order name |
| | - series_id | int | Purchase order series identifier |
| | - document_number | varchar(50) | Full document number |
| | - date_created | int | Purchase order creation date (Unix timestamp) |
| | - date_sent | int | Purchase order sent date (Unix timestamp) |
| | - date_received | int | (optional) Purchase order received date (Unix timestamp) |
| | - date_completed | int | (optional) Purchase order completed date (Unix timestamp) |
| | - warehouse_id | int | Warehouse identifier |
| | - supplier_id | int | Supplier identifier |
| | - payer_id | int | (optional) Payer identifier |
| | - currency | varchar(3) | Purchase order currency (e.g. EUR, USD) |
| | - total_quantity | int | Total quantity of items |
| | - completed_total_quantity | int | Total quantity of received items |
| | - total_cost | decimal(10,2) | Total order cost |
| | - completed_total_cost | decimal(10,2) | Total cost of received items |
| | - items_count | int | Number of unique items in purchase order |
| | - completed_items_count | int | Number of unique items received |
| | - cost_invoice_no | varchar(50) | (optional) Related invoice number |
| | - notes | text | (optional) Purchase order notes/description |
| | - status | tinyint | Order status. 0 - draft, 1 - sent, 2 - received, 3 - completed, 4 - completed partially, 5 - canceled |
Sample
Input data:Output data:
A sample request in PHP: