Looking Up Refunds in GraphQL

MrPunkin
Shopify Partner
91 0 50

Is there a way I can query all refunds during a date range via the GraphQL API? I know I can query orders and hope that the updated_at column relates to the refund, but there could be a chance an order was updated after the refund processed and thus I'm not really searching the refund window, but rather any order changes.

 

It seems kind of crazy that there is no way to filter orders by when refunds happened, but also no way to look up refunds separately from orders. Is there a way to tie a TenderTransaction back to the order associated with it? I'm not seeing any related order identifiers on that object type.

Replies 11 (11)

Josh
Shopify Staff
1134 84 233

Hey @MrPunkin , 

 

The TenderTransaction resource does provide the order_id that the transaction is associated to, but it looks like that is only returned with the REST endpoint for some reason. I'll log an issue to see if we can get that added to GraphQL as well, that seems like an oversight. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

MrPunkin
Shopify Partner
91 0 50

Josh,

 

That'd be excellent, thank you. It does seem like an oversight to me as well. I'd love to transition to the GraphQL endpoint for this data but without parity between the two endpoints it's not possible just yet.

Josh
Shopify Staff
1134 84 233

Hey again @MrPunkin , 

 

Great news! We're going to push out a change to add the order ID to tender transactions in GraphQL. Provided there aren't any major issues, it should be ready to go by the end of the day - but if you don't see the change by then, things should be ready for Monday. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

MrPunkin
Shopify Partner
91 0 50

That's great news, thanks!

Josh
Shopify Staff
1134 84 233

Hey again @MrPunkin , 

 

Apologies, looks like my time estimate was off by a day - this code change should be shipping out within the next few hours provided no major issues arise. Keep your eyes peeled!

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

bookkeepapp
Shopify Partner
9 0 1

Hey josh if orderid is now in tenderTransactions what is it called I don't see it in the documentation or the explorer.  Thank you.  Jason

Founder of bookkeep.com
Josh
Shopify Staff
1134 84 233

Hey @bookkeepapp

 

It's available as order_id through the REST API, but it doesn't appear to be available via GraphQL yet. I had thought we had added it there too, I'll look into that. 

 

Edit : Correction, the order ID is available in the GraphQL API. It is currently only available on the 'unstable' version though, so you won't see it unless you're specifically calling that version. Keep an eye out for it in a future stable API release though. 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog

hisimon
Tourist
3 0 1

Hi @Josh 

 

Did the Order Id every get committed to the GarphQL TenderTransactions?

 

I am looking for orderId and order_id on TenderTansactions on any version (including unstable) and I get an error saying the field doesn't exist. 

 

Please can you update as I believe this is the only way to get a concise list of redunds through GarphQL but it is useless without a reference to the order. 

 

Thanks,

 

MrPunkin
Shopify Partner
91 0 50

@hisimon : We have been leveraging the TenderTransaction REST API endpoint since this thread started and it's worked just fine for us. I know it should exist in the GraphQL API, but until then we simply get a list of all TenderTransactions that are refunds, grab the order_id field, then use that to grab the rest of our order data for those orders which have refunds via the GraphQL API.

 

I know it doesn't solve the problem of it not being available, but just giving some info on how we have been getting that info in the meantime in case it can help. Best of luck.

hisimon
Tourist
3 0 1

Thanks @MrPunkin this was my backup architecture so I really appreciate the feedback and ratification this approach would work. Thanks!

srcb
Shopify Partner
10 0 2

It seems to me that they removed it. Instead in the unstable version of the API there is now a full connection to the order.

@Josh Are there any plans to add it to a release soon?