Get connenction between exchanged order and new order

robinsch
New Member
1 0 0

Hello,
is it possible to get the connection between an exchanged order and the created exchange order via the API?

If I exchange an order via the Shopify POS Pro like described here, the old order gets refunded and a new order gets created with the payment gateway exchange-credit.
Is there a field or API endpoint the get the connection between the refunded order and the newly created order? So I would like to get the information which order was created as exchange order from the refunded order and the other way I would like to know from an order if it was created in response to an exchange request.

I found that I can query the events for an order and there is a reference to the new order, so somehow this information seems to exist.
But relying on parsing the events does not seem great, so I want to know if there is another way to get this information

{
  "node": {
    "message": "XXX completed an exchange on order <a href=\"https://shop.myshopify.com/admin/orders/<orderId>\">#123456</a>."
   }
}

 

0 Likes