Purchase Orders

Attributes

Name Type Required Description
idpurchaseorder integer generated Unique Picqer reference
idsupplier integer required Linked to resource Suppliers
purchaseorderid integer generated Per-account purchase order number
supplier_orderid string optional Orderid that the supplier gave it
status string generated Status of the order (concept, purchased, received, cancelled)
remarks string optional Remarks about this order (printed on purchase order)
delivery_date string optional Expected delivery date
products array required Products in this purchase order
products.idproduct integer required Linked to resource Products
products.amount integer required Amount of products
products.price float optional Override the price

Get all purchase orders

GET https://example.picqer.com/api/v1/purchaseorders
HTTP/1.1 200 OK [ { "idpurchaseorder": 626, "idsupplier": 3, "idwarehouse": 18, "purchaseorderid": "20130013", "supplier_orderid": null, "status": "concept", "remarks": "", "date_delivery": "06/15/13", "created": "2013-07-17 20:38:35", "updated": "2013-07-17 20:38:35", "products": [ { "idproduct": 147, "idvatgroup": 18, "productcode": "502.052.16", "productcode_supplier": "502.052.16", "name": "SUNDERÖ", "price": 69.95, "amount": 100, "amountreceived": 0, "weight": 10200 } ] }, { "idpurchaseorder": 625, "idsupplier": 3, "idwarehouse": 18, "purchaseorderid": "20130012", "supplier_orderid": null, "status": "concept", "remarks": "", "date_delivery": "06/15/13", "created": "2013-07-17 20:38:33", "updated": "2013-07-17 20:38:34", "products": [ { "idproduct": 147, "idvatgroup": 18, "productcode": "502.052.16", "productcode_supplier": "502.052.16", "name": "SUNDERÖ", "price": 69.95, "amount": 100, "amountreceived": 0, "weight": 10200 } ] } ]

Filters

You can filter the purchase orders with the following parameters. Add these filters as querystring parameters to the URL.

Attribute Description Example
status Only purchase orders with this status concept
search Search through the fields purchaseorderid, supplier orderid and supplier name.
updatedsince Get the purchase orders that are changed since this date and time. 2015-01-01 12:00:00

Get single purchase order

GET https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}
HTTP/1.1 200 OK { "idpurchaseorder": 625, "idsupplier": 3, "idwarehouse": 18, "purchaseorderid": "20130012", "supplier_orderid": null, "status": "concept", "remarks": "", "date_delivery": "06/15/13", "created": "2013-07-17 20:38:33", "updated": "2013-07-17 20:38:34", "products": [ { "idproduct": 147, "idvatgroup": 18, "productcode": "502.052.16", "productcode_supplier": "502.052.16", "name": "SUNDERÖ", "price": 69.95, "amount": 100, "amountreceived": 0, "weight": 10200 } ] }

Create new purchase order

POST https://example.picqer.com/api/v1/purchaseorders
{ "idsupplier": 3, "idwarehouse": 18, "products": [ { "idproduct": 147, "price": 26.95, "amount": 25 } ] }
HTTP/1.1 201 Created { "idpurchaseorder": 627, "idsupplier": 3, "idwarehouse": 18, "purchaseorderid": "20130014", "supplier_orderid": null, "status": "concept", "remarks": null, "date_delivery": null, "created": "2013-07-17 21:39:40", "updated": "2013-07-17 21:39:40", "products": [ { "idproduct": 147, "idvatgroup": 18, "productcode": "502.052.16", "productcode_supplier": "502.052.16", "name": "SUNDERÖ", "price": 26.95, "amount": 25, "amountreceived": 0, "weight": 10200 } ] }

Mark purchase order as purchased

Only 'cocnept' purchase orders can be marked as purchased.

POST https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/mark-as-purchased
HTTP/1.1 200 OK { "idpurchaseorder": 627, "idsupplier": 3, "idwarehouse": 18, "purchaseorderid": "20130014", "supplier_orderid": null, "status": "purchased", "remarks": null, "date_delivery": null, "created": "2013-07-17 21:39:40", "updated": "2013-07-17 21:39:40", "products": [ { "idproduct": 147, "idvatgroup": 18, "productcode": "502.052.16", "productcode_supplier": "502.052.16", "name": "SUNDERÖ", "price": 26.95, "amount": 25, "amountreceived": 0, "weight": 10200 } ] }

Cancel purchase order

Purchase orders can only be cancelled when they have the status 'concept' or 'purchased'.

POST https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/cancel
HTTP/1.1 200 OK { "idpurchaseorder": 627, "idsupplier": 3, "idwarehouse": 18, "purchaseorderid": "20130014", "supplier_orderid": null, "status": "cancelled", "remarks": null, "date_delivery": null, "created": "2013-07-17 21:39:40", "updated": "2013-07-17 21:39:40", "products": [ { "idproduct": 147, "idvatgroup": 18, "productcode": "502.052.16", "productcode_supplier": "502.052.16", "name": "SUNDERÖ", "price": 26.95, "amount": 25, "amountreceived": 0, "weight": 10200 } ] }

Receipts

At 26 July 2016 we changed the way we 'receive' purchase orders in Picqer. The old POST on https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/receive will still work for backwards compatibility, but the methods below are the new way.

A purchase order can have multiple receipts. Each receipt can contain 1 or more products.

Get all receipts from a purchase order

GET https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/receipts
HTTP/1.1 200 OK [ { "idpurchaseorder_receipt": 2933, "idpurchaseorder": 18393, "iduser": 424, "purchaseorder_receiptid": "PO2016-1005-1", "remarks": null, "received_at": "2016-07-25 12:01:28", "products": [ { "idpurchaseorder_product": 18287, "idproduct": 1105248, "amount": 2 } ] } ]

Get single receipt

GET https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/receipts/{idpurchaseorder_receipt}
HTTP/1.1 200 OK { "idpurchaseorder_receipt": 2933, "idpurchaseorder": 18393, "iduser": 424, "purchaseorder_receiptid": "PO2016-1005-1", "remarks": null, "received_at": "2016-07-25 12:01:28", "products": [ { "idpurchaseorder_product": 18287, "idproduct": 1105248, "amount": 2 } ] }

Create a new receipt

POST https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/receipts
{ "remarks": "We got some extra flyers with this delivery", "received_at": "2016-07-25 12:01:28", "products": [ { "idpurchaseorder_product": 18287, "idproduct": 1105248, "amount": 2 } ] }
HTTP/1.1 201 Created { "idpurchaseorder_receipt": 2934, "idpurchaseorder": 18393, "iduser": 424, "purchaseorder_receiptid": "PO2016-1005-2", "remarks": null, "received_at": "2016-07-25 13:21:28", "products": [ { "idpurchaseorder_product": 18287, "idproduct": 1105248, "amount": 2 } ] }
Read more Backorders