Skip to main content
Solved

REST API request - Purchase Receipt creation


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!

Best answer by RohitRattan88

@ElliotC 

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

Postman
Receipt

Hopefully it helps

View original
Did this topic help you find an answer to your question?

3 replies

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 248 replies
  • May 29, 2023

@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?


  • Author
  • Freshman I
  • 1 reply
  • May 29, 2023

Hi @RohitRattan88, thanks for your reply.

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


RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+4
  • Acumatica Moderator
  • 248 replies
  • Answer
  • May 30, 2023

@ElliotC 

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

Postman
Receipt

Hopefully it helps


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings