xero-node icon indicating copy to clipboard operation
xero-node copied to clipboard

Unsetting Invoice Expected Payment Date

Open opedromiranda opened this issue 5 years ago • 1 comments

SDK you're using (please complete the following information):

  • Version 4.7.3

Describe the bug I can't seem to be able to unset an invoice's expected payment date.

To Reproduce Steps to reproduce the behavior:

xeroCLient.accountingApi.updateInvoice(tenantID, invoiceID, {
  invoices: [{ expectedPaymentDate: '' }]
})

Expected behavior The expectedPaymentDate should be cleared.

Additional context To be fair, this appears to be more of a Xero API issue/design decision. However, I did manage to clear the EPD calling the API directly, using ExpectedPaymentDateString.

curl --request POST \
  --url https://api.xero.com/api.xro/2.0/Invoices/b7b20c66-5844-4dac-b855-dd043f15e795 \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer ...' \
  --header 'Content-Type: application/json' \
  --header 'xero-tenant-id: tenant-id' \
  --data '{
	"Invoices": [{
		"ExpectedPaymentDateString": ""
	}]
}'

Using ExpectedPaymentDateString clears the EPD in Xero, while using ExpectedPaymentDate does not.

In invoice.ts, an entry can be added in the attributeTypeMap to allow updates to the ExpectedPaymentDateString property.

What are your thoughts on this?

opedromiranda avatar Dec 01 '20 10:12 opedromiranda

Hey! Just wondering if theres been any movements or workarounds for this?

Thanks!

daffron avatar May 09 '24 03:05 daffron