AvaTax-REST-V2-JS-SDK icon indicating copy to clipboard operation
AvaTax-REST-V2-JS-SDK copied to clipboard

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

Open BioCarmen opened this issue 2 years ago • 0 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 avatar Oct 05 '23 15:10 BioCarmen