XeroAPI/xero-php-oauth2

Retrieve "online invoice url" in "GET https://api.xero.com/api.xro/2.0/Invoices" API

vishal6121k opened this issue · 1 comments

  • SDK Version 2.1.3

  • Problem Description:
    I need to list all the invoices in a table with online_invoice_url and invoiceid, so that my customers can open and download the pdf version of the invoice.
    But, these users will not have access to the Xero account directly.

  • Solution expecting:
    Can we get the online_invoice_url along with other informations in the multiple
    invoice list api( GET https://api.xero.com/api.xro/2.0/Invoices).

  • Alternative solution thought:
    I considered to call the api: "GET https://api.xero.com/api.xro/2.0/Invoices/9b9ba9e5-e907-4b4e-8210-54d82b0aa479/OnlineInvoice"
    But, I will need to do that for each invoice in a loop and we have a rate limiter of 60 requests per minute, which doesn't seem much helpful in scaling.

@vishal6121k - I'm sorry to say the only way to get the Online Invoice URL generated is by calling the endpoint for each individual invoice.

Alternative is to not use the Online Invoice, instead using the page parameter when getting a list of multiple invoices. This will return 100 invoices with lineitem details. You could create a view in your app to display the invoice details to the user.