You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be nice if there weren't extra steps to get to the specified invoice when calling getInvoice.
AFAIK this function should never return multiple invoices (that would be what getInvoices is for), but to get to the requested Invoice your code has to look a bit cluttered:
$invoicesResponse = $apiInstance->getInvoice(
$record['tenant_id'],
$guid
);
if (!empty($invoicesResponse)) {
$invoices = $invoicesResponse->getInvoices();
if (count($invoices) > 0) {
return$invoices[0];
}
}
Thank you for feedback. I hear what you're saying about looking for ways to simplify the code needed to utilize the SDK. We generate our SDKs from our OpenAPI specs, so this enhancement would need to happen in the templates we use to generate the SDKs.
To clarify, calling for a single object using a guid returns an array of invoices.
{
"Invoices":[
{
"Type":"ACCREC",
"InvoiceID":"a03ffcd2-5d91-4c7e-b483-318584e9e439",
"InvoiceNumber":"INV-0006",
"Reference":"Tour"
--- MANY more properties :-) --
}
]
}
We could explore adding method(s) to encapsulate some of the code you are writing.
At this point, these enhancements are a lower priority over adding support for additional API endpoints. But I will leave this issue open to remind us about this improvement request.
But if you provide example of method(s) you'd like incorporated that could move this along.
It'd be nice if there weren't extra steps to get to the specified invoice when calling
getInvoice
.AFAIK this function should never return multiple invoices (that would be what
getInvoices
is for), but to get to the requested Invoice your code has to look a bit cluttered:Whereas it could be:
The text was updated successfully, but these errors were encountered: