getInventoryPurchaseOrders
The method allows you to retrieve a list of purchase orders from BaseLinker storage.
Input parameters
Output data:
A sample request in PHP:
inventory_id | int | (optional) Catalog ID. The list of identifiers can be retrieved using the method getInventories. |
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 |
| - order_id | int | Purchase order identifier |
| - series_id | int | Document series identifier |
| - document_number | varchar(50) | Full document number |
| - date_add | int | Document creation date (Unix timestamp) |
| - date_created | int | Document issue date (Unix timestamp) |
| - date_received | int | (optional) Date when order was received (Unix timestamp) |
| - date_completed | int | (optional) Date when order was completed (Unix timestamp) |
| - warehouse_id | int | Warehouse identifier |
| - supplier_id | int | Supplier identifier |
| - payer_id | int | (optional) Payer identifier |
| - currency | varchar(3) | 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 order |
| - completed_items_count | int | Number of unique items received |
| - cost_invoice_no | varchar(50) | (optional) Related invoice number |
| - notes | text | (optional) 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: