How to identify if the refund is processed through Shopify POS app

Hello Shopify Community,

I am working on Shopify Return/Exchange integration in our ERP application. The objective is to receive the notification when a Return or Exchange is placed using Shopify POS app. I have subscribed to Refund\Create webhook event.

Once the Refund notification is received, I am able to get shopify order number from the refund notification payload and then call GraphQL API to query the exchangeV2s details of the respective order. The exchangeV2s contains different notes such as additions, returns, etc to identify the line items that are returned or exchanged.

Everything is fine so far, but I need to know if the exchange or return is created using Shopify POS app. How to know if the exchange or refund is created using Shopify POS app?

Hi Krishnakishore,

It doesn’t look like there’s a specific field on the refund query that would say if a refund is processed on POS or not, but you could query the transactions field of the Refund object to check the gateway or other related details that might indicate the source of the refund processing:


It would look something like this:

query GetRefundDetails($refundId: ID!) {
  refund(id: $refundId) {
    id
    transactions(first: 10) {
      edges {
        node {
          gateway
          kind
          status
        }
      }
    }
  }
}

Would that work for you?

Hello Liam,

Thank you for the update.

We don’t get the data in the transaction section if there is no difference in the amount. Example. The order line has a price of $50.00, and the exchange line is also $50.00. In this case we do get notification, but the Transaction section doesn’t contain any data. Otherwise, Transaction.Source_name contains value as “POS” if it is created from POS. The challenge I have is that we don’t get Transaction data in some scenarios.