Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LineItems: DiscountRate returned but DiscountAmount does not depending on invoice call query #592

Open
timwiel opened this issue Jun 4, 2024 · 2 comments

Comments

@timwiel
Copy link

timwiel commented Jun 4, 2024

The lineitems field DiscountAmount should be returned in any response that also returns DiscountRate as they both apply equally to a lineitem.

Current Behavior

When a call is made to a single invoice the lineitem fields DiscountRate and DiscountAmount are both returned in the lineitems object HOWEVER if a call is made that retrieves a summary then only the DiscountRate is returned.

The API documentation states (see https://developer.xero.com/documentation/api/accounting/invoices#get-invoices) that when multiple invoices are returned then either no lineitems are returned OR a summary is returned depending on the invoice query.

I have verified this behaviour using the following:

  • Returns DiscountRate but NOT DiscountAmount on lineitems:
    • Using PHP SDK call to $result = $apiInstance->getInvoices($xeroTenantId,null,null,null,"{$invoice_guid1},{$invoice_guid2}",null);
    • Using Xero API Explorer using the GetInvoices with comma seperated query IDs
    • Using Xero API Explorer using the GetInvoices with page query
  • Returns both DiscountRate and DiscountAmount:
    • Using Xero API Explorer using the GetInvoice with one invoice GUID specified
  • Returns empty lineitems field:
    • Using Xero API Explorer using the GetInvoice with createByMyApp set to 1

Expected Behavior

The API should return lineitems with DiscountRate and DiscountAmount as documented for a call that returns multiple invoices if the lineitems field is populated

OR the API documentation needs to be updated with a specific breakdown of what lineitem fields are returned in a summarised response ... which would be all fields EXCEPT validationerrors and DiscountAmount which seems a bit strange why only those two would not be returned.

Copy link

github-actions bot commented Jun 4, 2024

PETOSS-429

Copy link

github-actions bot commented Jun 4, 2024

Thanks for raising an issue, a ticket has been created to track your request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant