Tracking payouts and payout transactions using GraphQL API

Our applications is tracking stores balance transactions using the ShopifyPaymentsBalanceTransactionConnection GraphQL API. The query filters for this API currently supports filtering on the processed_at field which provides the timestamp on when the transaction is created (in PENDING status) but there is no way to track when a transaction status changes to IN TRANSIT/SCHEDULED and then to its final state (CANCELED, FAILED or PAID). The only way to keep track of the transaction status is to poll periodically requesting at least the least 7 days of transactions which could be a lot. In order to facilitate the tracking of balance transactions can you please consider the following changes to the API?

  • Add webhooks when the status changes (our preference)
  • Provide an additional query filter on the updated_at timestamp like it is done for other APIs. This would allow API clients to only query the transactions which have been updated between polls rather than having to re-query a bigger time window on every poll

I am assuming that you are talking about the payout status, not the per transaction status. In this case you can use the payouts query directly to get status changes. If you want the associated payout status you can query the transactions and use the transaction type filter, and filter only for type ‘Transfer’, this will ensure you get only one transaction per payout.

1 Like

Hey folks :waving_hand: - just seconding what @SRCB said here. You should be able to use the shopifyPaymentsAccount query and the payouts object under that to track payout status like this:

{
  shopifyPaymentsAccount {
    id
    payouts (first:10) {
      nodes {
        id
        status
      }
    }
  }
}

Hope this helps :slight_smile:

1 Like

Thank you both that makes sense. We did implement it this way as this is the most optimal way to do it.