getInventoryDocuments
This method allows you to retrieve a list of inventory documents from BaseLinker. It supports pagination and optional filtering by document type, date range, etc.
Input parameters
Output data:
A sample request in PHP:
| filter_source_object_type | int | (optional) The source object type to filter by: 1 - order, 2 - purchase order, 3 - stock take, 4 - order return, 7 - fulfillment delivery, 8 - transfer |
| filter_source_object_id | int | (optional) The source object ID to filter by |
| filter_document_id | int | (optional) A specific inventory document ID |
| filter_document_type | int | (optional) The document type: 0 - GR (Goods Received), 1 - IGR (Internal Goods Received), 2 - GI (Goods Issue), 3 - IGI (Internal Goods Issue), 4 - IT (Internal Transfer), 5 - OB (Opening Balance) |
| filter_document_status | int | (optional) The document status: 0 - Draft, 1 - Confirmed |
| filter_date_from | int | (optional) The minimum creation date (unix timestamp) to filter by |
| filter_date_to | int | (optional) The maximum creation date (unix timestamp) to filter by |
| filter_warehouse_id | int | (optional) The warehouse ID |
| page | int | (optional) Results page number (100 documents per page, numbered from 1) |
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 |
| documents | array | An array of inventory documents |
| | - document_id | int | The unique identifier of the inventory document |
| | - document_type | int | The document type: 0-GR, 1-IGR, 2-GI, 3-IGI, 4-IT, 5-OB |
| | - document_status | int | The document status: 0 - Draft, 1 - Confirmed |
| | - direction | int | The document direction (0 = incoming, 1 = outgoing) |
| | - document_series_id | int | The ID of the document series |
| | - full_number | varchar(30) | The full document number |
| | - date_created | int | The creation date of the document in unix time |
| | - date_confirmed | int | The confirmation date in unix time. 0 if not confirmed |
| | - warehouse_id | int | The main warehouse ID used for this document |
| | - warehouse_id2 | int | The second (destination) warehouse ID for transfers |
| | - items_count | int | Number of items in the document |
| | - total_quantity | int | Total quantity of products in the document |
| | - total_price | decimal(10,2) | Total value (price) for the entire document |
| | - connection_type | int | Source object type: 1-order, 2-purchase order, 3-stock take, 4-order return, 7-fulfillment delivery, 8-transfer |
| | - connection_id | int | Source object ID |
| | - notes | varchar(500) | Document notes/comments |
| | - source_object_type | int | Type of source object that created this document: 0-no source, 1-order, 2-purchase order, 3-stock take, 4-order return, 7-fulfillment delivery, 8-transfer |
| | - source_object_id | int | ID of the source object. 0 if no source |
Sample
Input data:Output data:
A sample request in PHP: