addInventoryPurchaseOrder
The method allows you to create a new purchase order in BaseLinker storage. Orders are created as drafts by default.
Input parameters
| warehouse_id | int | Warehouse identifier |
| supplier_id | int | Supplier identifier |
| payer_id | int | Payer identifier |
| currency | varchar(3) | Order currency (e.g. EUR, USD) |
| name | varchar(80) | (optional) Order name |
| notes | text | (optional) Order description/notes |
| invoice_no | varchar(50) | (optional) Related invoice number |
| date_delivery_expected | int | (optional) Expected delivery date as unix timestamp |
| additional_costs | array | (optional) List of additional costs assigned to the purchase order. Each element should contain fields listed below |
| | - name | varchar(30) | Additional cost name |
| | - cost | decimal(10,2) | Additional cost value (must be >= 0.01) |
| packages | array | (optional) List of packages with tracking information assigned to the purchase order. Each element should contain fields listed below |
| | - courier_code | varchar(20) | Courier code (e.g. "dpd", "dhl", "inpost", "other"). The list of available courier codes can be retrieved using the getCouriersList method. |
| | - courier_other_name | varchar(20) | (optional) Custom courier name. Required when courier_code is "other". |
| | - package_number | varchar(40) | Tracking number / shipment number for the package |
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 |
| order_id | int | Created purchase order identifier |
| document_number | varchar(50) | Generated document number |
Sample
Input data:Output data:
A sample request in PHP: