Skip to main content
Solved

GET PurchaseReceipt Can i filter api response by any containing Details/POOrderNbr = ' certain value'


Hi,

How can i GET PurchaseReceipt - List of Lines that are for a certain PO number?
I cannot seem to filter by expanded objects. 

Otherwise to get all Receipt Lines against a certain PO I will need to dig out all receip[ts for a supplier and loop through all returned lines to get my filtered list.

 

here is my API call returning a 500 - "The parent value for a property access of a property 'POOrderNbr' is not a single value. Property access can only be applied to a single value.",

/entity/Default/22.200.001/PurchaseReceipt/?$expand=Details&$filter=VendorID eq 'V000000001' and Details/POOrderNbr eq '000018'

 

or is there a way to query ReceiptLines seperately?

 

Best answer by Samvel Petrosov

nickacfield wrote:

@Samvel Petrosov 

What do you mean by "work with the gi"

I can add fields and parameters.. what do i add /change. 

Any chance you could explain what's needed to get the filter by details.

I have spent considerable time already playing with the settings inside the endpoint, but with no reference material available, it's all guess work

Here is a very simple version of that as an example.

  1. Create a GI like below for PO Receipt & Receipt Lines. 

     

  2. Add Parameters for filtration by PO Nbr.

     

  3. Add Condition to use the Parameters in the GI.

     

  4. Configure the Results Grid to include the data you need.

     

  5. Extend the Web Services Endpoint.

     

  6. Add the GI as an entity. Make sure to save the changes.

     

  7. Send the PUT request to get your data.

     

 

I have attached the GI as an example to this response. 

Please have in mind that this is an over-simplified example.

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

7 replies

harutyungevorgyan
Jr Varsity I
Forum|alt.badge.img

Hello ​@nickacfield ,

You cannot filter expanded details by any field in Acumatica's REST API. The most efficient way to retrieve Purchase Receipt Lines for a specific Purchase Order is to use a DAC-based OData query.

You can achieve this by sending a GET request to the following URL:

https://{AcumaticaURL}/t/{TenantName}/Api/OData/DAC/PX_Objects_PO_POReceiptLine?$filter=PONbr eq '000018'

Key points to note:

  • The field name used in the filter must match the exact field name in the DAC (PONbr).
  • If your Acumatica instance does not use multiple tenants, replace {TenantName} with Company.

Authentication:
To authenticate, use Basic Authentication:

  1. Encode your credentials (username:password) in Base64.

  2. Include the following header in your request:

    Authorization: Basic {Base64EncodedCredentials}

This request will return all Purchase Receipt Lines associated with the specified PO number.
 

Let me know if you need any further assistance.


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi ​@nickacfield,

Yes, it is not possible to filter based on the fields in the details node. Instead, you can filter the like below,

Filter the OrderNbr(in the header) and then expand instead of filtering based on the OrderNbr field in the Details. Below is an example you can try, 

<<Instance URL>>/entity/Default/22.200.001/PurchaseOrder?$filter=OrderNbr eq 'PO002511'&$expand=Details

Hope that helps.! Please feel free to post back if you have any questions.


  • Author
  • Freshman II
  • 5 replies
  • March 19, 2025

That wont help  ​@Vignesh Ponnusamy   as a receipt can be for multiple PO’s  and the line/details based OrderNbr is the only relevant one. In fact there is no header OrderNbr as you have suggested.

@harutyungevorgyan   I was hoping to not have to use a different method, when my scripts are logged in via API and managing that,  

Any other solution guys?   if not I will look at the DAC/ODATA option.


Samvel Petrosov
Jr Varsity II
Forum|alt.badge.img+5
nickacfield wrote:

That wont help  ​@Vignesh Ponnusamy   as a receipt can be for multiple PO’s  and the line/details based OrderNbr is the only relevant one. In fact there is no header OrderNbr as you have suggested.

@harutyungevorgyan   I was hoping to not have to use a different method, when my scripts are logged in via API and managing that,  

Any other solution guys?   if not I will look at the DAC/ODATA option.

You can create a Generic Inquiry with the filters you need and result set limited to the data (POReceiptLine) you need, extend the Web Service Endpoint, then work with that GI from REST API. That should not require a separate session.


  • Author
  • Freshman II
  • 5 replies
  • March 19, 2025

@Samvel Petrosov 

What do you mean by "work with the gi"

I can add fields and parameters.. what do i add /change. 

Any chance you could explain what's needed to get the filter by details.

I have spent considerable time already playing with the settings inside the endpoint, but with no reference material available, it's all guess work


Samvel Petrosov
Jr Varsity II
Forum|alt.badge.img+5
nickacfield wrote:

@Samvel Petrosov 

What do you mean by "work with the gi"

I can add fields and parameters.. what do i add /change. 

Any chance you could explain what's needed to get the filter by details.

I have spent considerable time already playing with the settings inside the endpoint, but with no reference material available, it's all guess work

Here is a very simple version of that as an example.

  1. Create a GI like below for PO Receipt & Receipt Lines. 

     

  2. Add Parameters for filtration by PO Nbr.

     

  3. Add Condition to use the Parameters in the GI.

     

  4. Configure the Results Grid to include the data you need.

     

  5. Extend the Web Services Endpoint.

     

  6. Add the GI as an entity. Make sure to save the changes.

     

  7. Send the PUT request to get your data.

     

 

I have attached the GI as an example to this response. 

Please have in mind that this is an over-simplified example.


  • Author
  • Freshman II
  • 5 replies
  • March 20, 2025

OMG… ​@Samvel Petrosov  Thank you so Much!!!

You are Amazing.

Words cannot describe how great you are.

 

Solved.

And you solved my other issue about getting unbilled quantity on line (i spotted it while creating the GI)

Legend. Thank you again!

 


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