Receipts, receiving purchases
With "Receipts" you register received purchase orders.
Receipts can be linked to a specific purchase order or to a supplier to register received products from multiple purchase orders.
You can also receive products that are not on purchase orders. Picqer will then create a new purchase order with the products that are received that were not purchased.
There are temporarily 2 versions of receipts in Picqer while we change the core receipt functionality.
See the migration guide for the technical and conceptual changes.
Name |
Type |
Required |
Description |
idreceipt |
integer |
generated |
Unique Picqer reference |
idwarehouse |
integer |
optional |
Linked to resource Warehouses. If you do not provide a idwarehouse, we will select the first warehouse. |
version |
integer |
optional |
The version of this receipt (currently 1 or 2). |
supplier |
array |
optional* |
Linked to resource Suppliers. Either a supplier or a purchase order is required. |
purchaseorder |
array |
optional* |
Linked to resource Purchase orders. Either a supplier or a purchase order is required. |
receiptid |
string |
generated |
Per-account receipt number |
status |
string |
read-only |
Status of receipt: processing or completed |
remarks |
string |
optional |
Remarks about this receipt. (Only v1) |
completed_by |
array |
optional* |
User that completed the receipt, empty when the receipt is not yet completed. |
completed_by.iduser |
integer |
read-only |
Unique Picqer reference of the user that completed the receipt. |
completed_by.name |
string |
read-only |
The name of the user that completed the receipt |
amount_received |
integer |
read-only |
Amount of products in this receipt |
amount_received_excessive |
integer |
read-only |
Amount of products in this receipt more then purchased. (Only v1) |
completed_at |
string |
read-only |
Datetime that this receipt is completed |
created |
string |
read-only |
Datetime that this receipt is created |
products |
array |
required |
Products in this receipt |
products.idreceipt_product |
integer |
generated |
Unique id of this line item |
products.idpurchaseorder_product |
integer |
read-only |
Linked to line of purchase order, the product that is being received |
products.idproduct |
integer |
required |
Linked to resource Products |
products.idpurchaseorder |
integer |
read-only |
Linked to resource Purchase order, as each product can come from a different purchase order |
products.productcode |
string |
read-only |
Productcode of product |
products.name |
string |
read-only |
Name of product |
products.amount |
integer |
required |
Amount that is being received in this receipt |
products.amount_ordered |
integer |
read-only |
Amount that was ordered in the purchase order |
products.amount_previously_received |
integer |
read-only |
Amount that was received for this product on other receipts. (Only v1) |
products.added_by_receipt |
boolean |
read-only |
False if this product was originally ordered, true if this product was added by this receipt |
products.stock_location (v1) products.location (v2) |
array |
read-only |
Currently linked location to add the stock to on receiving |
products.created_at |
string |
read-only |
The datetime a product is received (Only v2) |
products.received_by_iduser |
integer |
read-only |
The iduser who registered this product (Only v2) |
products.reverted_at |
string |
read-only |
The datetime this product is reverted (Only v2) |
products.reverted_by_iduser |
integer |
read-only |
The iduser who reverted this product (Only v2) |
GET
https://example.picqer.com/api/v1/receipts
HTTP/1.1 200 OK
[
{
"idreceipt": 469364,
"idwarehouse": 18,
"version": 1,
"supplier": {
"idsupplier": 55151,
"name": "Schoenmaker Kramer"
},
"purchaseorder": {
"idpurchaseorder": 612084,
"purchaseorderid": "20201023"
},
"receiptid": "RC2020-1071",
"status": "processing",
"remarks": null,
"completed_by": null,
"amount_received": 5,
"amount_received_excessive": 0,
"completed_at": null,
"created": "2020-11-11 14:18:42",
"updated": "2020-11-11 14:18:42",
"products": [
{
"idreceipt_product": 14959405,
"idpurchaseorder_product": 9473892,
"idproduct": 13177709,
"idpurchaseorder": 612084,
"productcode": "AA568904",
"productcode_supplier": "SEC-AA568904",
"name": "Secrid Eco Drive Calculator Lumix",
"barcode": "5480962989264",
"amount": 0,
"amount_ordered": 5,
"amount_receiving": 0,
"added_by_receipt": false,
"abc_classification": null
},
{
"idreceipt_product": 14959407,
"idpurchaseorder_product": 9473893,
"idproduct": 13177679,
"idpurchaseorder": 612084,
"productcode": "AT298759",
"productcode_supplier": "NES-AT298759",
"name": "Nestle Watch Graphing Lumix S",
"barcode": "3376627429184",
"amount": 3,
"amount_ordered": 5,
"amount_receiving": 0,
"added_by_receipt": false,
"abc_classification": null
}
]
},
...
]
You can filter the receipts with the following parameters. Add these filters as querystring parameters to the URL.
Attribute |
Description |
Example |
receiptid |
Get the receipt that have this value as receiptid. |
RC2022-1003 |
status |
Only receipts with this status |
processing |
idpurchaseorder |
Receipts for this purchase order. |
|
idsupplier |
Receipts for this supplier. |
|
updated_after |
Get the receipts that are changed since this date and time. |
2022-01-01 16:00:00 |
completed_after |
Get the receipts that are completed since this date and time. |
2022-01-01 16:00:00 |
include_indirect_receipts |
In combination with idpurchaseorder, if true, this will return all receipts that received products from this purchase order. Including receipts that are linked to multiple orders. Without this key, only receipts that are directly linked to this purchase order will be returned. |
true |
The following example is for a v2 receipt. Note that the products returned in this response are received and added to the stock already. Expected products are not included in this response anymore, you can use the "Get expected products" endpoint to see those.
GET
https://example.picqer.com/api/v1/receipts/{idreceipt}
HTTP/1.1 200 OK
{
"idreceipt": 469364,
"receiptid": "RC2020-1071",
"idwarehouse": 18,
"version": 2,
"status": "processing",
"supplier": {
"idsupplier": 55151,
"name": "Schoenmaker Kramer"
},
"purchaseorder": {
"idpurchaseorder": 612084,
"purchaseorderid": "20201023"
},
"remarks": null,
"completed_by": null,
"amount_received": 1,
"completed_at": null,
"created": "2020-11-11 14:18:42",
"updated": "2020-11-11 14:18:42",
"products": [
{
"idreceipt_product": 14959405,
"idpurchaseorder_product": 9473892,
"idproduct": 13177709,
"idpurchaseorder": 612084,
"productcode": "AA568904",
"productcode_supplier": "SEC-AA568904",
"name": "Secrid Eco Drive Calculator Lumix",
"barcode": "5480962989264",
"amount": 1,
"amount_ordered": 5,
"added_by_receipt": false,
"abc_classification": null,
"received_by_iduser: 1,
"reverted_at": null,
"reverted_by_iduser": null,
"image": null,
"location": {
"idlocation": 2059474,
"idwarehouse": 18,
"parent_idlocation": 2059472,
"type": "location",
"name": "A.2.1.2",
"remarks": null,
"unlink_on_empty": false,
"location_type": {
"idlocation_type": 1,
"name": "Standaard",
"default": true,
"color": "#0000f0"
},
"is_bulk_location": false
}
}
]
}
The steps to receive products via the API are:
You can create a receipt for a purchase order by providing 'idpurchaseorder', or for a supplier by providing 'idsupplier'.
POST
https://example.picqer.com/api/v1/receipts
{
"idpurchaseorder": 666379,
"version": 2
}
HTTP/1.1 201 Created
{
"idreceipt": 469364,
"receiptid": "RC2020-1071",
"idwarehouse": 18,
"version": 2,
"status": "processing",
"supplier": {
"idsupplier": 55151,
"name": "Schoenmaker Kramer"
},
"purchaseorder": {
"idpurchaseorder": 612084,
"purchaseorderid": "20201023"
},
"remarks": null,
"completed_by": null,
"amount_received": 0,
"completed_at": null,
"created": "2020-11-11 14:18:42",
"updated": "2020-11-11 14:18:42",
"products": []
}
This endpoint returns the expected-products, including the strategies that you can use to receive this product. See "Add product" to find out more on using these strategies.
GET
https://example.picqer.com/api/v1/receipts/{idreceipt}/expected-products
HTTP/1.1 200 OK
[
{
"product": {
"idproduct": 114,
"idvatgroup": 1,
"idsupplier": 4,
"productcode": "0195949018510",
"name": "Apple iPhone 15 Pro",
"price": 1000,
"fixedstockprice": 0,
"productcode_supplier": "",
"deliverytime": 0,
"description": "",
"barcode": "",
"unlimitedstock": false,
"assembled": false,
"type": "normal",
"weight": 0,
"length": null,
"width": null,
"height": null,
"minimum_purchase_quantity": 0,
"purchase_in_quantities_of": 0,
"hs_code": "",
"country_of_origin": "",
"show_on_portal": true,
"active": true,
"comment_count": 0,
"analysis_abc_classification": null,
"analysis_pick_amount_per_day": null,
"tags": {},
"productfields": [],
"images": [],
"stock": [],
"pricelists": []
},
"totals": {
"expected": 10,
"received": 5,
"remaining": 5
},
"strategies": [
{
"strategy": "automatic",
"parameters": {},
"ordered": 10,
"received": 5,
"remaining": 5
},
{
"strategy": "purchaseorder_product",
"parameters": {
"idpurchaseorder_product": 572
},
"purchaseorderid": "PO2024-1163",
"ordered": 10,
"received": 5,
"remaining": 5
},
{
"strategy": "new",
"parameters": {},
"idpurchaseorder": null,
"purchaseorderid": null
}
]
}
]
You can also request the applicable strategies for a specific product by providing an 'idproduct'.
GET
https://example.picqer.com/api/v1/receipts/{idreceipt}/expected-products/{idproduct}
HTTP/1.1 200 OK
{
"product": {
"idproduct": 114,
"idvatgroup": 1,
"idsupplier": 4,
"productcode": "0195949018510",
"name": "Apple iPhone 15 Pro",
"price": 1000,
"fixedstockprice": 0,
"productcode_supplier": "",
"deliverytime": 0,
"description": "",
"barcode": "",
"unlimitedstock": false,
"assembled": false,
"type": "normal",
"weight": 0,
"length": null,
"width": null,
"height": null,
"minimum_purchase_quantity": 0,
"purchase_in_quantities_of": 0,
"hs_code": "",
"country_of_origin": "",
"show_on_portal": true,
"active": true,
"comment_count": 0,
"analysis_abc_classification": null,
"analysis_pick_amount_per_day": null,
"tags": {},
"productfields": [],
"images": [],
"stock": [],
"pricelists": []
},
"totals": {
"expected": 10,
"received": 5,
"remaining": 5
},
"strategies": [
{
"strategy": "automatic",
"parameters": {},
"ordered": 10,
"received": 5,
"remaining": 5
},
{
"strategy": "purchaseorder_product",
"parameters": {
"idpurchaseorder_product": 572
},
"purchaseorderid": "PO2024-1163",
"ordered": 10,
"received": 5,
"remaining": 5
},
{
"strategy": "new",
"parameters": {},
"idpurchaseorder": null,
"purchaseorderid": null
}
]
}
]
You can receive a product by providing the associated purchase-order product. The amount and location will be used to directly add the product to the stock at the given location, this can also be a container.
POST
https://example.picqer.com/api/v1/receipts/{idreceipt}/products
{
"idproduct": 78,
"idpurchaseorder_product": 493,
"amount": 1,
"idlocation": 664
}
HTTP/1.1 200 OK
[
{
"idreceipt_product": 946,
"idpurchaseorder": 113,
"idpurchaseorder_product": 493,
"idproduct": 78,
"purchaseorderid": "PO2024-1112",
"productcode": "AU605533",
"productcode_supplier": "APP-AU605533",
"name": "Apple Watch Color",
"barcode": "4728410784335",
"abc_classification": null,
"image": null,
"amount": 1,
"amount_ordered": 10,
"added_by_receipt": false,
"received_by_iduser: 1,
"reverted_at": null,
"reverted_by_iduser": null,
"location": {
"idlocation": 664,
"idwarehouse": 1,
"type": "container",
"name": "Container 2",
"remarks": ""
}
}
]
You can use different strategies for selecting the purchase order when adding a product to a receipt.
There are 3 strategies:
- purchaseorder_product (default) - This strategy will register the amount on a specific purchaseorder product. Provide the idpurchaseorder_product in the request.
- automatic - This strategy will automatically divide the amount over open purchaseorder products. This strategy is only relevant for receipts not based on a specific purchase order.
- new - This strategy will add the product to either the linked purchase order or a freshly created purchase order for excessive products.
Since the automatic strategy can result in multiple entries for different purchase order products the response has a collection of receipt-products instead of a single receipt-product.
To use a strategy other than purchaseorder_product:
POST
https://example.picqer.com/api/v1/receipts/{idreceipt}/products
{
"idproduct": 78,
"strategy": "automatic",
"amount": 10,
"idlocation": 664
}
HTTP/1.1 200 OK
[
{
"idreceipt_product": 946,
"idpurchaseorder": 113,
"idpurchaseorder_product": 493,
"idproduct": 78,
"purchaseorderid": "PO2024-1112",
"productcode": "AU605533",
"productcode_supplier": "APP-AU605533",
"name": "Apple Watch Color",
"barcode": "4728410784335",
"abc_classification": null,
"image": null,
"amount": 5,
"amount_ordered": 10,
"added_by_receipt": false,
"received_by_iduser: 1,
"reverted_at": null,
"reverted_by_iduser": null,
"location": {
"idlocation": 664,
"idwarehouse": 1,
"type": "container",
"name": "Container 2",
"remarks": ""
}
},
{
"idreceipt_product": 947,
"idpurchaseorder": 114,
"idpurchaseorder_product": 494,
"idproduct": 78,
"purchaseorderid": "PO2024-1113",
"productcode": "AU605533",
"productcode_supplier": "APP-AU605533",
"name": "Apple Watch Color",
"barcode": "4728410784335",
"abc_classification": null,
"image": null,
"amount": 5,
"amount_ordered": 5,
"added_by_receipt": false,
"received_by_iduser: 1,
"reverted_at": null,
"reverted_by_iduser": null,
"location": {
"idlocation": 664,
"idwarehouse": 1,
"type": "container",
"name": "Container 2",
"remarks": ""
}
},
]
You can revert a received product only when the stock is still available, this will decrease the stock by the received amount and will mark the receipt-product as reverted.
POST
https://example.picqer.com/api/v1/receipts/{idreceipt}/products/{idreceipt_product}/revert
HTTP/1.1 200 OK
{
"idreceipt_product": 946,
"idpurchaseorder": 113,
"idpurchaseorder_product": 493,
"idproduct": 78,
"purchaseorderid": "PO2024-1112",
"productcode": "AU605533",
"productcode_supplier": "APP-AU605533",
"name": "Apple Watch Color",
"barcode": "4728410784335",
"abc_classification": null,
"image": null,
"amount": 1,
"amount_ordered": 10,
"added_by_receipt": false,
"received_by_iduser: 1,
"reverted_at": "2024-03-11 10:09",
"reverted_by_iduser": 1243,
"location": {
"idlocation": 664,
"idwarehouse": 1,
"type": "container",
"name": "Container 2",
"remarks": ""
}
}
If you complete a receipt, we will set the status to "completed". For v1 receipts, products are added to the stock at this point.
As a response you do not see the status changed, this will be done in the background. If you retrieve the receipt again, you see status changed to 'completed' and the user and date of the completion filled.
PUT
https://example.picqer.com/api/v1/receipts/{idreceipt}
{
"status": "completed"
}
HTTP/1.1 200 OK
{
"idreceipt": 496349,
"idwarehouse": 18,
"version": 1,
"supplier": {
"idsupplier": 63386,
"name": "Heiku"
},
"purchaseorder": {
"idpurchaseorder": 666379,
"purchaseorderid": "20201024"
},
"receiptid": "RC2020-1073",
"status": "processing",
"remarks": null,
"completed_by": null,
"amount_received": 4,
"amount_received_excessive": 4,
"completed_at": null,
"created": "2020-11-27 12:03:43",
"updated": "2020-11-27 12:03:43",
"products": [
...
]
}
It depends on the version of the receipt until when a receipt can be deleted. Products should not have been added to the stock yet. In v1 this means that any "processing" receipt can be deleted. For v2, only receipts where not a single product is received can be deleted.
DELETE
https://example.picqer.com/api/v1/receipts/{idreceipt}
HTTP/1.1 204 No Content
Comments are supported on receipts.
Below are some endpoints that only work for older v1 receipts:
This endpoint only supports v1 receipts.
After you created a receipt for a purchase order, you can mark all products as received. This will set the amount received to the amount you ordered.
POST
https://example.picqer.com/api/v1/receipts/{idreceipt}/mark-all-received
HTTP/1.1 200 OK
{
"idreceipt": 496349,
"idwarehouse": 18,
"version": 1,
"supplier": {
"idsupplier": 63386,
"name": "Heiku"
},
"purchaseorder": {
"idpurchaseorder": 666379,
"purchaseorderid": "20201024"
},
"receiptid": "RC2020-1073",
"status": "processing",
"remarks": null,
"completed_by": null,
"amount_received": 4,
"amount_received_excessive": 0,
"completed_at": null,
"created": "2020-11-27 12:03:43",
"updated": "2020-11-27 12:03:43",
"products": [
{
"idreceipt_product": 15792546,
"idpurchaseorder_product": 10412819,
"idproduct": 14781906,
"idpurchaseorder": 666379,
"productcode": "SW10111",
"productcode_supplier": "",
"name": "Kicker XXL Champ Elite Pro",
"barcode": "",
"amount": 2,
"amount_ordered": 2,
"amount_receiving": 2,
"added_by_receipt": false,
"abc_classification": null,
"amount_previously_received": 0,
"amount_more_than_ordered": 0,
"amount_backorders": 0,
"image": null,
"stock": 5,
"stock_location": null
},
{
"idreceipt_product": 15792545,
"idpurchaseorder_product": 10412818,
"idproduct": 14781890,
"idpurchaseorder": 666379,
"productcode": "SW10114",
"productcode_supplier": "",
"name": "Kicker Champ Elite",
"barcode": "",
"amount": 2,
"amount_ordered": 2,
"amount_receiving": 2,
"added_by_receipt": false,
"abc_classification": null,
"amount_previously_received": 0,
"amount_more_than_ordered": 0,
"amount_backorders": 0,
"image": null,
"stock": 21,
"stock_location": null
}
]
}
If you want to mark product for product as received, use this endpoint to increment the amount received by 1. You can provide a barcode or a idproduct.
You get the matched receipt product as a response.
If you want to add a product that is not on the receipt yet, then provide the idproduct and the parameter force as 'true'.
POST
https://example.picqer.com/api/v1/receipts/{idreceipt}/products
{
"barcode": "2745515900917"
}
HTTP/1.1 200 OK
{
"idreceipt_product": 15793402,
"idpurchaseorder_product": 10413052,
"idproduct": 13177749,
"idpurchaseorder": 666408,
"productcode": "BP673709",
"productcode_supplier": "OPE-BP673709",
"name": "Opel LZ20 Color",
"barcode": "2745515900917",
"amount": 1,
"amount_ordered": 5,
"amount_receiving": 1,
"added_by_receipt": false,
"abc_classification": null,
"amount_previously_received": 0,
"amount_more_than_ordered": 0,
"amount_backorders": 0,
"image": null,
"stock": 24,
"stock_location": {
"idlocation": 2059871,
"idwarehouse": 18,
"type": "location",
"parent_idlocation": 2059870,
"name": "B.3.3.1",
"remarks": null,
"unlink_on_empty": false,
"location_type": {
"idlocation_type": 1,
"name": "Standaard",
"default": true,
"color": "#0000f0"
},
"is_bulk_location": false
}
}
This endpoint only supports v1 receipts.
Use this endpoint if you want to provide a specific amount that is received, or change the linked stock location.
Provide delta to change the amount up or down, or provide amount to set the amount to the given value.
Provide stock_idlocation to change the linked location to receive the stock on. You can only provide a location that is already linked to the product or 'null' to select "no specific location".
PUT
https://example.picqer.com/api/v1/receipts/{idreceipt}/products/{idreceipt_product}
{
"delta": 2
}
HTTP/1.1 200 OK
{
"idreceipt_product": 15793402,
...
"amount": 3,
"amount_ordered": 5,
...
}