Invoice Due Date and Discount no longer populate automatically in new invoicing view

39 views Asked by At

We have a Xero Certified Integration which submits new invoices via the Xero API. When submitting a new invoice previously the invoice Due Date and Discount would populate automatically from the customer record when using classic invoicing view. This no longer occurs with the introduction of the new invoicing view.

Is there a way we can we restore this behaviour for new invoicing? Or will we need to perform the calculations prior to submitting the invoice - at the risk of inconsistencies with how Xero performs the calculation.

Example API request:

POST https://api.xero.com/api.xro/2.0/Invoices

{
    "Url": "https://example.org/invoice?ref=db5f8bcf-1813-4b74-984f-0489a587bddc",
    "LineItems": [
        {
            "ItemCode": "GB1-White",
            "Description": "56 13/02/2015 Golf balls - white single. Please reorder with code GB1-White",
            "UnitAmount": "5.60",
            "Quantity": 1.82
        }
    ],
    "Contact": {
        "ContactID": "ed531f74-f149-4059-b47e-6cd970189305"
    },
    "Type": "ACCREC",
    "Reference": "Job9"
}

Steps to reproduce:

  1. Submit an invoice via the API using the above request. Select a customer with a Due Date and Discount configured. Note that the due date and discount fields are not specified.
  2. Log into Xero and locate the newly created invoice.
  3. Ensure that the new invoicing view is selected before opening the new invoice.

New Invoicing view:

  1. Open the invoice in the new invoicing view. e.g. https://go.xero.com/app/!q8B9S/invoicing/edit/9d09075d-3a9b-4b6c-b735-e55cbaf73934
  2. Observe that the invoice due date is the same as the issue date.
  3. Expected this to be the 20th of the following month (e.g. 20 March 2024) as configured on the customer. And to use the organisation default if not configured on the customer.
  4. Observe that the line item discount field is blank. Clicking in the field has no effect.
  5. Expected the line item discount to pull through from the customer.

Classic Invoicing view:

  1. Click “Switch to classic invoicing”: e.g. https://go.xero.com/AccountsReceivable/Edit.aspx?InvoiceID=9d09075d-3a9b-4b6c-b735-e55cbaf73934
  2. Observe that the Due Date is now the 20th of the following Month.
  3. Observe that the line item discount is blank but clicking in the field populates the correct value for the customer.
1

There are 1 answers

5
sallyhornet On

The API doesn't use the contact defaults but in classic invoicing there is a script that runs when you open the invoice in Xero which populates the defaults in the draft invoice if the fields are missing. This doesn't happen in new invoicing.

You would need to supply the fields. New invoicing is that it supports a discount amount or a discount rate so you can choose either.