Yes, it is in our pipeline to completely overhaul our API documentation and we’ll post any updates here on the forum.
Regarding POs…
Creating POs is a bit of a rabbit hole. Right now there is no POST method on the /purchase_order/
endpoint, and PUTting can only update, not create.
POs are currently created with the /product/<sku>/buy/<supplier_id>/
endpoint. This endpoint will either create or update an existing PO depending on the elements passed and whether or not a matching PO is already open.
The body for the endpoint takes the following:
POST /product/<sku>/buy/<supplier_id>/
{
"warehouse": <warehouse_id>,
"quantity": <quantity of sku>,
"unit_price": <unit price of sku>
}
If you already have a PO open for supplier A
, warehouse 123
and you POST to the buy
endpoint with another sku, it’ll append it to the currently open PO. If there is no open PO with the supplier/warehouse combo then it’ll create a new one.
Similarly, if the sku already exists on the PO, then it’ll check to see if the unit price is the same. If it is, then it’ll simply add the quantities to the existing line. If the unit price is different then it’ll add a new line with the quantity at the different unit price.
We do have plans to add a POST endpoint for purchase orders and I’ll update you here on the forum when we do.