curl --request POST \
--url https://api.decodahealth.com/inventory/purchase-orders/auto-generate \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"locationIds": [
"<string>"
]
}
'[
{
"supplierId": "<string>",
"id": "<string>",
"status": "PENDING",
"issueDate": "2023-11-07T05:31:56Z",
"completedDate": "2023-11-07T05:31:56Z",
"supplier": {
"name": "<string>",
"description": "<string>",
"website": "<string>",
"email": "<string>",
"preferredContactMethod": "<string>",
"phoneNumber": "<string>",
"addressLineOne": "<string>",
"addressLineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>",
"country": "<string>",
"shipmentTime": 123,
"isArchived": false,
"defaultNotes": [
{
"content": "<string>",
"id": "<string>",
"supplierId": "<string>",
"name": "<string>"
}
],
"id": "<string>"
},
"lineItems": [
{
"supplierToStockUomId": "<string>",
"locationId": "<string>",
"quantity": 123,
"id": "<string>",
"purchaseOrderId": "<string>",
"status": "PENDING",
"quantityReceived": 1,
"supplierToStockUom": {
"supplierPartNumber": "<string>",
"uom": "AMPOULES",
"id": "<string>",
"supplierToStockId": "<string>",
"supplierToStock": {
"supplierId": "<string>",
"stockId": "<string>",
"id": "<string>",
"stock": {
"name": "<string>",
"unit": "AMPOULES",
"id": "<string>",
"description": "<string>",
"notes": "<string>",
"category": "<string>",
"minStockLevel": 123,
"isArchived": false
}
},
"conversionFactor": 1,
"isDefault": false,
"displayLabel": "<string>",
"price": 123,
"leadTime": 1,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"isArchived": false
},
"location": {
"id": "<string>",
"name": "<string>",
"isVirtual": true
},
"cost": 1,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z"
}
],
"notes": [
{
"content": "<string>",
"id": "<string>",
"purchaseOrderId": "<string>",
"name": "<string>"
}
],
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"isArchived": false,
"leadTimeDays": 123
}
]Auto-generate purchase orders for stocks below PAR level.
curl --request POST \
--url https://api.decodahealth.com/inventory/purchase-orders/auto-generate \
--header 'API-KEY: <api-key>' \
--header 'Content-Type: application/json' \
--header 'TENANT: <tenant>' \
--data '
{
"locationIds": [
"<string>"
]
}
'[
{
"supplierId": "<string>",
"id": "<string>",
"status": "PENDING",
"issueDate": "2023-11-07T05:31:56Z",
"completedDate": "2023-11-07T05:31:56Z",
"supplier": {
"name": "<string>",
"description": "<string>",
"website": "<string>",
"email": "<string>",
"preferredContactMethod": "<string>",
"phoneNumber": "<string>",
"addressLineOne": "<string>",
"addressLineTwo": "<string>",
"city": "<string>",
"state": "<string>",
"zipCode": "<string>",
"country": "<string>",
"shipmentTime": 123,
"isArchived": false,
"defaultNotes": [
{
"content": "<string>",
"id": "<string>",
"supplierId": "<string>",
"name": "<string>"
}
],
"id": "<string>"
},
"lineItems": [
{
"supplierToStockUomId": "<string>",
"locationId": "<string>",
"quantity": 123,
"id": "<string>",
"purchaseOrderId": "<string>",
"status": "PENDING",
"quantityReceived": 1,
"supplierToStockUom": {
"supplierPartNumber": "<string>",
"uom": "AMPOULES",
"id": "<string>",
"supplierToStockId": "<string>",
"supplierToStock": {
"supplierId": "<string>",
"stockId": "<string>",
"id": "<string>",
"stock": {
"name": "<string>",
"unit": "AMPOULES",
"id": "<string>",
"description": "<string>",
"notes": "<string>",
"category": "<string>",
"minStockLevel": 123,
"isArchived": false
}
},
"conversionFactor": 1,
"isDefault": false,
"displayLabel": "<string>",
"price": 123,
"leadTime": 1,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"isArchived": false
},
"location": {
"id": "<string>",
"name": "<string>",
"isVirtual": true
},
"cost": 1,
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z"
}
],
"notes": [
{
"content": "<string>",
"id": "<string>",
"purchaseOrderId": "<string>",
"name": "<string>"
}
],
"createdDate": "2023-11-07T05:31:56Z",
"updatedDate": "2023-11-07T05:31:56Z",
"isArchived": false,
"leadTimeDays": 123
}
]The tenant you are making this request on behalf of
Your api key
List of location IDs to check stock levels for
Successful Response
ID of the supplier
Unique identifier for the purchase order
Status of the purchase order
PENDING, PLACED, COMPLETED, CANCELLED Date when the purchase order was sent to supplier
Date when all shipments are DELIVERED (purchase order completed)
Optional supplier details
Show child attributes
Line items with details
Show child attributes
Notes attached to this purchase order
Show child attributes
Date and time the purchase order was created
Date and time the purchase order was last updated
Whether the purchase order is archived
Maximum lead time in days across all line items (estimated delivery time from order placement)