Purchase orders
Purchase orders are purchases you made by your supplier. You can create a purchase order, then send it to your supplier, and when you receive it in your warehouse create a receipt. The stock will be added to your warehouse when the receipt is received.
| Name |
Type |
Required |
Description |
| idpurchaseorder |
integer |
generated |
Unique Picqer reference |
| idsupplier |
integer |
optional |
Linked to resource Suppliers. If you do not provide a idsupplier, then supplier_name is required. |
| idwarehouse |
integer |
optional |
Linked to resource Warehouses. If you do not provide idwarehouse, the warehouse with the highest priority that accepts orders will be selected. |
| idtemplate |
integer |
optional |
Linked to resource Templates, if null the default template will be selected. |
| purchaseorderid |
string |
generated |
Per-account purchase order number |
| supplier_orderid |
string |
optional |
Orderid that the supplier gave it |
| supplier_name |
string |
optional |
Name of the supplier, if no idsupplier is provided. |
| 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 (yyyy-mm-dd). If empty when the purchase order is marked as purchased, it is calculated from the delivery time of the products. |
| language |
string |
optional |
Language used for communication with supplier, 'nl' or 'en'. Defaults to the language of the supplier. |
| purchased_by_iduser |
integer |
read-only |
ID of the user who marked the purchase order as purchased, null if unknown |
| purchased_at |
string |
read-only |
Datetime that the purchase order was marked as purchased, null if not purchased yet |
| completed_by_iduser |
integer |
read-only |
ID of the user who completed the purchase order, null if unknown |
| completed_at |
string |
read-only |
Datetime that the purchase order was completed, null if not completed yet |
| created_by_iduser |
integer |
read-only |
ID of the user who created the purchase order, null if unknown |
| created |
string |
read-only |
Datetime that the purchase order was created |
| updated |
string |
read-only |
Datetime that the purchase order was last updated |
| idfulfilment_customer |
integer |
optional |
Only for Picqer Fulfilment: Linked to belonging fulfilment customer. Only present in the response for accounts with Picqer Fulfilment. |
| comment_count |
integer |
read-only |
Number of comments on this purchase order |
| products |
array |
optional |
Products in this purchase order |
| products.idpurchaseorder_product |
integer |
generated |
Unique Picqer reference for this product line |
| products.idproduct |
integer |
required |
Linked to resource Products |
| products.idvatgroup |
integer |
read-only |
Linked to resource VAT groups |
| products.productcode |
string |
read-only |
Productcode of the product |
| products.productcode_supplier |
string |
read-only |
Productcode of the supplier |
| products.name |
string |
read-only |
Name of the product |
| products.price |
float |
optional |
Purchase price per piece. Defaults to the fixed stock price of the product. Null when the user has no right to see stock prices. |
| products.amount |
integer |
required |
Amount of products |
| products.amountreceived |
integer |
read-only |
Amount of products that has been received |
| products.delivery_date |
string |
optional |
Expected delivery date for this product (yyyy-mm-dd), if different from the purchase order |
| products.weight |
integer |
read-only |
Weight of the product in grams |
GET
https://example.picqer.com/api/v1/purchaseorders
HTTP/1.1 200 OK
[
{
"idpurchaseorder": 626,
"idsupplier": 3,
"idwarehouse": 18,
"idtemplate": 4,
"purchaseorderid": "20130013",
"supplier_orderid": null,
"supplier_name": null,
"status": "concept",
"remarks": "",
"delivery_date": "2013-08-12",
"language": "nl",
"purchased_by_iduser": null,
"purchased_at": null,
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": 2,
"created": "2013-07-17 20:38:35",
"updated": "2013-07-17 20:38:35",
"products": [
{
"idpurchaseorder_product": 1272401,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 69.95,
"amount": 100,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
},
{
"idpurchaseorder": 625,
"idsupplier": 3,
"idwarehouse": 18,
"idtemplate": 4,
"purchaseorderid": "20130012",
"supplier_orderid": null,
"supplier_name": null,
"status": "purchased",
"remarks": "",
"delivery_date": "2013-08-12",
"language": "nl",
"purchased_by_iduser": 2,
"purchased_at": "2013-07-18 09:12:04",
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": 2,
"created": "2013-07-17 20:38:33",
"updated": "2013-07-18 09:12:04",
"products": [
{
"idpurchaseorder_product": 1272400,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 69.95,
"amount": 100,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
]
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, purchased, received, cancelled) |
concept |
| search |
Search through the fields purchaseorderid, supplier orderid and supplier name. |
|
| updated_after |
Get the purchase orders that are changed since this date and time. |
2015-01-01 12:00:00 |
| idfulfilment_customer |
Get the purchase orders for this fulfilment customer. |
623 |
| idsupplier |
Get the purchase orders linked to this supplier. |
1532 |
| idwarehouse |
Get the purchase orders for this warehouse. |
13 |
GET
https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}
HTTP/1.1 200 OK
{
"idpurchaseorder": 625,
"idsupplier": 3,
"idwarehouse": 18,
"idtemplate": 4,
"purchaseorderid": "20130012",
"supplier_orderid": null,
"supplier_name": null,
"status": "purchased",
"remarks": "",
"delivery_date": "2013-08-12",
"language": "nl",
"purchased_by_iduser": 2,
"purchased_at": "2013-07-18 09:12:04",
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": 2,
"created": "2013-07-17 20:38:33",
"updated": "2013-07-18 09:12:04",
"products": [
{
"idpurchaseorder_product": 1272400,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 69.95,
"amount": 100,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
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,
"idtemplate": 4,
"purchaseorderid": "20130014",
"supplier_orderid": null,
"supplier_name": null,
"status": "concept",
"remarks": null,
"delivery_date": null,
"language": "nl",
"purchased_by_iduser": null,
"purchased_at": null,
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": null,
"created": "2013-07-17 21:39:40",
"updated": "2013-07-17 21:39:40",
"products": [
{
"idpurchaseorder_product": 1272402,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 26.95,
"amount": 25,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
Only 'concept' 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,
"idtemplate": 4,
"purchaseorderid": "20130014",
"supplier_orderid": null,
"supplier_name": null,
"status": "purchased",
"remarks": null,
"delivery_date": "2013-07-24",
"language": "nl",
"purchased_by_iduser": null,
"purchased_at": "2013-07-17 21:41:02",
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": null,
"created": "2013-07-17 21:39:40",
"updated": "2013-07-17 21:41:02",
"products": [
{
"idpurchaseorder_product": 1272402,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 26.95,
"amount": 25,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
You can change a purchase order after you created it.
PUT
https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}
{
"remarks": "Automatically purchased at supplier",
"supplier_orderid": "882636-229"
}
HTTP/1.1 200 OK
{
"idpurchaseorder": 627,
"idsupplier": 3,
"idwarehouse": 18,
"idtemplate": 4,
"purchaseorderid": "20130014",
"supplier_orderid": "882636-229",
"supplier_name": null,
"status": "purchased",
"remarks": "Automatically purchased at supplier",
"delivery_date": "2013-07-24",
"language": "nl",
"purchased_by_iduser": null,
"purchased_at": "2013-07-17 21:41:02",
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": null,
"created": "2013-07-17 21:39:40",
"updated": "2019-07-19 11:21:12",
"products": [
{
"idpurchaseorder_product": 1272402,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 26.95,
"amount": 25,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
If you received some products on a purchase order, but will not receive the remaining products, you can 'close' the purchase order to let Picqer know you don't expect the last products to arrive.
POST
https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/close
HTTP/1.1 200 OK
{
"idpurchaseorder": 627,
"idsupplier": 3,
"idwarehouse": 18,
"idtemplate": 4,
"purchaseorderid": "20130014",
"supplier_orderid": null,
"supplier_name": null,
"status": "received",
"remarks": null,
"delivery_date": "2013-07-24",
"language": "nl",
"purchased_by_iduser": null,
"purchased_at": "2013-07-17 21:41:02",
"completed_by_iduser": 2,
"completed_at": "2013-07-25 14:02:11",
"created_by_iduser": null,
"created": "2013-07-17 21:39:40",
"updated": "2013-07-25 14:02:11",
"products": [
{
"idpurchaseorder_product": 1272402,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 26.95,
"amount": 25,
"amountreceived": 20,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
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,
"idtemplate": 4,
"purchaseorderid": "20130014",
"supplier_orderid": null,
"supplier_name": null,
"status": "cancelled",
"remarks": null,
"delivery_date": null,
"language": "nl",
"purchased_by_iduser": null,
"purchased_at": null,
"completed_by_iduser": null,
"completed_at": null,
"created_by_iduser": null,
"created": "2013-07-17 21:39:40",
"updated": "2013-07-17 21:45:30",
"products": [
{
"idpurchaseorder_product": 1272402,
"idproduct": 147,
"idvatgroup": 18,
"productcode": "502.052.16",
"productcode_supplier": "502.052.16",
"name": "SUNDERÖ",
"price": 26.95,
"amount": 25,
"amountreceived": 0,
"delivery_date": null,
"weight": 10200
}
],
"idfulfilment_customer": null,
"comment_count": 0
}
To receive products from a purchase order, see the Receipts endpoint.
You can use the endpoint /api/v1/purchaseorders/{idpurchaseorder}/products to get the details of products in a purchase order.
To add a new product to an existing purchase order, you can POST that product with the following example.
You can only add 1 product per call. Required fields are: idproduct and amount. The price and delivery_date fields are optional.
POST
https://example.picqer.com/api/v1/purchaseorders/{idpurchaseorder}/products
{
"idproduct": 1105257,
"price": 12.95,
"amount": 1
}
HTTP/1.1 201 Created
{
"idpurchaseorder_product": 1272513,
"idproduct": 1105257,
"idvatgroup": 5,
"productcode": "AR2954212",
"productcode_supplier": "28372736",
"name": "Philips Hue kit",
"price": 12.95,
"amount": 1,
"amountreceived": 0,
"delivery_date": null,
"weight": 1793
}
To update a product, you can send a PUT request to endpoint /api/v1/purchaseorders/{idpurchaseorder}/products/{idpurchaseorder_product} to update amount, price or delivery_date.
To delete a product, send a DELETE request to endpoint /api/v1/purchaseorders/{idpurchaseorder}/products/{idpurchaseorder_product}. You can only remove products that are not received yet.
Comments are supported on purchase orders.