Solved

REST API: trying to add Details to an existing PurchaseReceipt

  • 16 May 2024
  • 2 replies
  • 34 views

Userlevel 2
Badge

I’m doing a PUT method in Postman but it keeps creating a brand new purchase receipt instead of adding Details to the existing PurchaseReceipt that I’ve specified.  How do I prevent a new PurchaseReceipt from getting created.

 

URL:  /entity/Default/22.200.001/PurchaseReceipt

Body:

{
        "ReceiptNbr": {"value": "PR00153497"},   
        "Details" :[
            {
              "POOrderNbr": {"value": "PO53472"},
              "POOrderType": {"value": "Drop-Ship"},              
              "TrackingNumber": {"value": "9999"},
              "ReceiptQty": {"value": "1"},              
              "InventoryID":{"value": "190-34563221"},
               "POLineNbr": {"value": "1"}              
            }
            ],
        "VendorID": { "value": "PU3" },
        "VendorRef": { "value": "FROM_API" },        
        "Location": {"value": "MAIN"},
        "Branch": {"value": "CM"}            
}

 

icon

Best answer by Vignesh Ponnusamy 16 May 2024, 17:15

View original

2 replies

Userlevel 7
Badge +5

Hi @bpgraves,

To update the existing record, you need to use the key fields that are used to identify the document. For purchase receipt, it should be the Type and ReceiptNbr field in the PUT request. For more details on it refer, https://help.acumatica.com/(W(15))/Help?ScreenId=ShowWiki&pageid=af48c02a-afbc-4fdb-b1e5-635ac7ebbaf1

 

Feel free to post back if you have any questions.! Good Luck,

Userlevel 2
Badge

Hi @bpgraves,

To update the existing record, you need to use the key fields that are used to identify the document. For purchase receipt, it should be the Type and ReceiptNbr field in the PUT request. For more details on it refer, https://help.acumatica.com/(W(15))/Help?ScreenId=ShowWiki&pageid=af48c02a-afbc-4fdb-b1e5-635ac7ebbaf1

 

Feel free to post back if you have any questions.! Good Luck,

oh wow!  I keep forgetting to add the Type!  Every time I do this with the REST API, I end up creating a brand new object.  I really wish it wasn’t required since the ReceiptNbr should have been sufficient for the key: Acumatica can’t create the same ReceiptNbr for a PurchaseReceipt even if it has a different type!

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