avadev / AvaTax-REST-V2-JS-SDK

Sales Tax API SDK for Javascript / Node and AvaTax REST
https://developer.avalara.com/sdk/
Apache License 2.0
27 stars 37 forks source link

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

Open BioCarmen opened 9 months ago

BioCarmen commented 9 months ago

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

svc-developer commented 6 days ago

@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.