avadev/AvaTax-REST-V2-JS-SDK

refundTransaction always errors out because of missing refundDate

kedskeds opened this issue · 1 comments

The refundTransaction function is failing because of a missing refundDate. When I hit the endpoint directly, it expects this format:

{
    "companyCode",
    "transactionCode",
    "refundDate": "2022-03-11",
    "model": {
        "RefundTransactionModel": { ... }
}

However, the refundTransaction function doesn't send refundDate in the body of the request.

The docs must be incorrect, because refundDate isn't listed as a required param in the body of the request:

It is only listed as a required param within the refundTransactionModel. But I have tried including it just within the refundTransactionModel, and not within the body, and the request fails.

This is an example request where I included refundDate within the refundTransactionModel and it failed because of a missing refundDate.

The request body for RefundTransaction should look something like this:
{
"refundTransactionCode": "some guid",
"refundDate": "2022-06-01",
"refundType": "Full",
"referenceCode": "Refund for a committed transaction"
}

All the other variables are either query string parameters, path variables or headers.

Please let us know if that doesn't work for you.
Thanks