Skip to content

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

@timwiel

Description

@timwiel

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions