Colin Posted April 15, 2020 Report Posted April 15, 2020 Hi, I'm new to Blesta. How do I format my API query to search for a specific invoice by id? I've searched the API and source docs but couldn't find anything. e.g. I can find invoice #104028 using: curl --request GET https://mydomain.com/api/invoices/search.json?query=104028&page=1 But if invoice #104028 is referenced in another invoice's line items it will appear in the search results. Quote
Jono Posted April 15, 2020 Report Posted April 15, 2020 Unfortunately the Invoices model does not support the level of granularity in searching, though it's looking like it will in Blesta 4.10. Now this is particularly if you are using the Invoice #. If you know the internal invoice ID (the id that appears in the url when editing an invoice which comes from the invoices.id column) then you could call curl --request GET https://mydomain.com/api/invoices/get.json?invoice_id=104028 Quote
Colin Posted April 15, 2020 Author Report Posted April 15, 2020 Thanks for the update Jono. Quote it's looking like it will in Blesta 4.10 That's good news. Thanks. 'get.json?invoice_id=<invoice.id>' works. ? But I see the model method ( source docs) is depreciated? Quote
Jono Posted April 17, 2020 Report Posted April 17, 2020 On 4/15/2020 at 4:13 PM, Colin said: Thanks. 'get.json?invoice_id=<invoice.id>' works. ? But I see the model method ( source docs) is depreciated? Yea I notice that the other day, and it is a little misleading. If you look at the method in the code it's self, this is how the deprecation comment reads: * @deprecated since v4.6.0 - The properties of some data returned by this method are deprecated: * - line_items * - taxes_applied * - tax_subtotal * - tax_total * - total * - total_w_tax So the method itself is not deprecated, just some of the return values. Quote
Colin Posted April 17, 2020 Author Report Posted April 17, 2020 5 hours ago, Jono said: So the method itself is not deprecated, just some of the return values Ah. I see. Thank you for clarifying that. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.