Refunds. Location does not have a transaction with ID

Hello.
I’m handling the refund.created webhook event to reflect the refund data in our system. To handle it I need to get the transaction the refund is related to. For the moment the refund object doesn’t contain the transaction_id key which I can use. If I try to use order_id - it says “Location {location} does not have a transaction with ID {order_id}”. Is it possible now to get the transaction from the refund webhook data? Please, advise.

What’s the reason you need the transaction_id? The Transactions API is deprecated. Otherwise all refunds will have an order_id for the refund. As for the error your getting what’s the ID your using to call the Orders API. :slightly_smiling_face:

I tried to use order_id with the transaction API in this case.

Our system is still using the transaction API and it works for the moment. So, could you advise, how is it possible to:

  1. How to refund payment which is done with the transaction API?
  2. How to handle webhooks for payments done with transaction API?

We highly recommend migrating over to the Payments API and Orders API since the Transactions API is deprecated and will be retired in the future. Also the order that’s generated from a refund isn’t returned by the Transactions API. You’ll need to use the Orders API to get the refund details which will have source_order_id. The source_order_id is the original transaction_id of the payment. :slightly_smiling_face: