Solved

REST API request - Purchase Receipt creation

  • 29 May 2023
  • 3 replies
  • 172 views

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": [
{
"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!

icon

Best answer by RohitRattan88 30 May 2023, 17:06

View original

3 replies

Userlevel 7
Badge +4

@ElliotC I havn’t seen this error before.

I dont think ExpirationDate is a required field. Maybe try to make a call without it just to compare the outcome?

Hi @RohitRattan88, thanks for your reply.

I tried removing ExpirationDate from the request body, and unfortunately I get the same error message.

Userlevel 7
Badge +4

@ElliotC 

Not sure where the breakup is but I am able to generate PO Receipts with following info:

Postman
Receipt

Hopefully it helps

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved