Skip to main content
Solved

Create Purcahse receipt from purchase order using Rest API

  • Nov 16, 2023 8:49 PM UTC
  • 7 replies
  • 524 views
  • Translate All

Driss
Jr Varsity III
Forum|alt.badge.img

hey everyone

 

hope all good 

 

I’ve a PO with “OPEN” Status, i want to create purchase receipt 

 

I’ve added new action to the endpoint 

 

 

I’ve added new field “OrderNbr” so i can add that to by request to find the PO

 

 

 

This is my endpoint request 

 

https://company/entity/vendorpolineitems/22.200.001/purchasereceipt/AddPOOrder

 

Http body request 

 

{
    "entity": {},
    "parameters": {
         
        "OrderNbr": {
            "value": "PPO-05298"
        }
       
}

 }


Error Message 

 

"message":"An error has occurred.","exceptionMessage":"Operation failed","exceptionType":"




Thanks

Best answer by stephenbologna39

Hi @Driss 

 

If you only need to create a Purchase Receipt from a Purchase Order, this can be done with a standard PUT request:

 

PUT ?$expand=Details HTTP/1.1

Host: [<Acumatica ERP instance URL>]/entity/Default/23.200.001/PurchaseReceipt

Accept: application/json

Content-Type: application/json

 

{

    "VendorID": { "value": "GOODFRUITS" },

    "Location": { "value": "MAIN" },

    "Details": [

        {

            "POOrderNbr": { "value": "000030" },

            "POOrderType": { "value": "Normal" }

        }

    ]

}

 

Source:

https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=a93b5926-d164-4a1b-97fe-a1c46af67ea6

View original

7 replies

jinin
Pro I
Forum|alt.badge.img+12
  • Pro I
  • Nov 17, 2023 12:03 PM UTC

Hi @Driss ,

Could you please try the following request?

{

    "entity": {

        "ReceiptNbr": {

            "value": "PR002024"

        },

        "Type": {

            "value": "Receipt"

        }

    },

    "parameters": {

        "OrderNbr": {

            "value": "PO002057"

        },

        "Type": {

            "value": "Normal"

        }

    }

}

Translate

Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Nov 17, 2023 1:00 PM UTC

@jinin Thank for the answer actually now it creating the receipt but it not adding the Purchase Order

and also in order to see the purchase order i need to add the vendor id 

 

here is the request


 

{

    "entity": {

    "VendorID":{
    
    "value":"V001088"
    
    }

    },

    "parameters": {

        "OrderNbr": {

            "value": "PPO-05298"

        },

        "Type": {

            "value": "Normal"

        }

    }

}

 

 

 

Translate

Forum|alt.badge.img+2

Hi @Driss 

 

If you only need to create a Purchase Receipt from a Purchase Order, this can be done with a standard PUT request:

 

PUT ?$expand=Details HTTP/1.1

Host: [<Acumatica ERP instance URL>]/entity/Default/23.200.001/PurchaseReceipt

Accept: application/json

Content-Type: application/json

 

{

    "VendorID": { "value": "GOODFRUITS" },

    "Location": { "value": "MAIN" },

    "Details": [

        {

            "POOrderNbr": { "value": "000030" },

            "POOrderType": { "value": "Normal" }

        }

    ]

}

 

Source:

https://help.acumatica.com/Help?ScreenId=ShowWiki&pageid=a93b5926-d164-4a1b-97fe-a1c46af67ea6

Translate

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+5
  • Acumatica Moderator
  • Nov 21, 2023 5:32 PM UTC

@Driss , @stephenbologna39  is correct. You need to call Receipt entity and provide PO Nbr in the body.

Please note that Add PO is a modal/dialog action which are not supported via API yet:

 

Translate

Driss
Jr Varsity III
Forum|alt.badge.img
  • Author
  • Jr Varsity III
  • Nov 21, 2023 5:51 PM UTC

@RohitRattan88 Thank you so much!

Translate

darinpaulsacumatica76
Jr Varsity II

​@RohitRattan88, so you are saying that even though you can add the AddPOOrderLine action when extending the endpoint, it still isn’t supported by the API?

 

Translate

RohitRattan88
Acumatica Moderator
Forum|alt.badge.img+5
  • Acumatica Moderator
  • Aug 12, 2025 5:24 PM UTC

​@RohitRattan88, so you are saying that even though you can add the AddPOOrderLine action when extending the endpoint, it still isn’t supported by the API?

​@darinpaulsacumatica76 yes that was the case I looked into it last time. You need to send top level entity for action, thus cannot send action parameters in isolation. Maybe test but I am skeptical.

Translate