Hi all,
I’ve been running into some issues while trying to create a purchase receipt for a purchase order through the REST API.
I’m making a PUT request to /PurchaseReceipt in Postman with this body:
{
"VendorID": {
"value": "DER"
},
"LocationID": {
"value": "MAIN"
},
"Details": l
{
"InventoryID": {
"value": "10068777051226"
},
"Warehouse": {
"value": "NORR"
},
"Location": {
"value": "J01A"
},
"LotSerialNbr": {
"value": "1016"
},
"ExpirationDate": {
"value": "2025-05-01T00:00:00+00:00"
},
"POOrderType": {
"value": "Normal"
},
"POOrderNbr": {
"value": "PO000271"
},
"POOrderLineNbr": {
"value": 1
}
}
]
}
But I end up with a 422 and the following error message:
"error": "Inserting 'Purchase Receipt Line Split' record raised at least one error. Please review the errors.",
Further into the response block in the receipt line item, I get this:
"ExpirationDate": {
"error": "'Expiration Date' cannot be empty."
},
I can’t seem to make out the issue here, as the expiration date is clearly in the request body.
This issue does not occur if I try to create the receipt manually instead of through a REST request.
Additionally, this only seems to occur for purchase orders with certain inventory items, but not others. Making a near identical request with a different inventory item will successfully create the purchase receipt, so I’m thinking it must be something to do with the item itself, but I can’t figure out what that might be.
Any insights into this issue would be greatly appreciated!