Jump to content

Recommended Posts

Posted (edited)

I am trying to retrieve all invoices from the /sales_invoices GET endpoint, but only with certain attributes, like the contact (including all the nested_attributes).

If I run 

/sales_invoices?attributes=status,currency,total_amount,contact&nested_attributes=all

The contact is returned only with id, displayed_as and path.

I noticed in the docs there is no mention of nested_attributes as a query parameter, but in the guides, sales_invoices is used as the example of how to search with nested_attributes, so there is a bit of inconsistency.

The only way I can get the attributes I need is to search with attributes=all but this slows the request down considerably.

Edited by Chris Astles
  • 2 weeks later...
Posted

Hi Chris

Apologies for the late response. 

The API at present does not fully comply with oData specs hence why we try not to reference nested_attributes  in the docs where possible. In this scenario, it may be more efficient to make an additional call to the contacts/id endpoint to obtain those attributes you require.


Thanks

Mark

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...