avadev/AvaTax-REST-V2-JS-SDK

"This document status is incorrect for this operation" with refundTransaction

Closed this issue · 2 comments

We are using refundTransaction to create a ReturnInvoice representing a refund for a previously created SalesInvoice. Code snippet

await avatax.refundTransaction({
                transactionCode:originalSalesInvoiceCode,
                model: {
                    refundDate: new Date(),
                    refundType: RefundType.Full,
                    referenceCode: invoiceId,
                }

It is working fine most of the time, but sometimes it throws error This document status is incorrect for this operation. When we retry, it passed. I assumed this document means the original sales invoice, so we get some info about it when the error occurs.
The original sales invoice status: 1, type: 1, lock: false.
Can you help me address or understand the issue?
Our SDK version is 23.7.0

@BioCarmen Apologies for the delay, is this still happening? Please try to latest SDK version 24.6.3 and let us know and we can investigate.

Marking as closed, please feel free to reopen if its still an issue