Refund API - can't be processed through this API

I am using .net SDK to create a refund in the sandbox. The order that I am trying to do the refund on has been created also in the sandbox. And is there in the dashboard.

I am getting an error of “The payment XXXXXXXXXXXX can’t be processed through this API.”

I have tried every unique ID I have, and I must be using the correct payment_id as all the others give me an error of “Could not find payment with id: 123456”

I am getting the same errors when using the API explorer.

Hi @m8kwr welcome to the forums!

Can you share what the id is (it’s not secret)? Just to confirm, are you passing the payment_id? I believe this error would arise if you used the order_id instead (since it’s the equivalent of the older transaction_id).

It turns out I am passing the order ID and not the tender ID, but I am now struggling to find where/when I get this ID. I assume it would be when the checkout api returns to the website, but I am getting “tenders”: [{“id”: “ZImUwGl3iZQhdzSmWqFrmTUUvaB” but this doesn’t want to work either.

I am also trying the ID values against the get Payment api, to make sure it is working first! frustrated, and will feel silly when I am told where it is :rofl:

Ah, I didn’t realize you were using the Checkout API. So the Checkout API returns the transaction_id, but the Transactions API is currently deprecated. The transaction_id, however, is equivalent to an order_id. So, you should be able to retrieve the order, then in the order, find the tenders[0]->id and that is equivalent to the payment_id.

With that said, ZImUwGl3iZQhdzSmWqFrmTUUvaB looks to be a valid payment_id, but in the logs I see an authorization error, not an invalid id error. It looks like you’re using access token for MLBN4QDCJP182 merchant, but this payment belongs to ML2VQ85XKN7X5, so the access token doesn’t have access to refund this payment.