API documentation
Method list
Test your request
Changelog


addInventoryPurchaseOrder
The method allows you to create a new purchase order in BaseLinker storage. Orders are created as drafts by default.


Input parameters
warehouse_idintWarehouse identifier
supplier_idintSupplier identifier
payer_idintPayer identifier
currencyvarchar(3)Order currency (e.g. EUR, USD)
namevarchar(80)(optional) Order name
notestext(optional) Order description/notes
invoice_novarchar(50)(optional) Related invoice number
date_delivery_expectedint(optional) Expected delivery date as unix timestamp
additional_costsarray(optional) List of additional costs assigned to the purchase order. Each element should contain fields listed below
| - namevarchar(30)Additional cost name
| - costdecimal(10,2)Additional cost value (must be >= 0.01)
packagesarray(optional) List of packages with tracking information assigned to the purchase order. Each element should contain fields listed below
| - courier_codevarchar(20)Courier code (e.g. "dpd", "dhl", "inpost", "other"). The list of available courier codes can be retrieved using the getCouriersList method.
| - courier_other_namevarchar(20)(optional) Custom courier name. Required when courier_code is "other".
| - package_numbervarchar(40)Tracking number / shipment number for the package



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
order_idintCreated purchase order identifier
document_numbervarchar(50)Generated document number



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