Cursor-based pagination with shopify_payments/balance/transactions

Den327
New Member
6 0 0

I am trying to get all the transactions for a given payout and the endpoint will only give the first fifty transactions. There is no link in the header for the other transactions and you cannot use the limit=250 to get the first 250? Here is an example of my request.

https://{APIKey}{Password}{Store}.myshopify.com/admin/api/2020-10/shopify_payments/balance/transactions.json?payout_id=1234567890

 

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 237

If you are looking to retrieve a larger recordset rather than the REST API I would recommend using the GraphQL API (https://shopify.dev/docs/admin-api/graphql/reference/orders/ordertransaction). This allows you to retrieve the whole batch using bulk operations --> https://shopify.dev/tutorials/perform-bulk-operations-with-admin-api. You basically issue you query, poll the status, and when the operation has completed you download a JSONL file with all of the results sitting in one neat package to iterate through.

0 Likes
Den327
New Member
6 0 0

Thanks for the help, I was thinking GraphQL was for Graph's? It's all new to me'90's programmer' but I am looking to get all the transactions in a payout. I haven't been able to get the GraphQL payout to work yet, the GraphQL tool keeps telling me I don't have permission? But either way it doesn't look like GraphQL/Shopify Payments has anything that will give me the transactions that make up a payout?

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 237

Your logged-in Shopify user account need to be granted access to the read_shopify_payments_payouts scope. See https://shopify.dev/docs/admin-api/access-scopes for details. That's likely why your GraphiQL app call failed. I would think between the Transaction and Payout API endpoints you would be able to get at what you need. As long as the shop owner has given your logged-in user account the appropriate permissions.  

0 Likes
Den327
New Member
6 0 0

I am using the Shopify GraphiQL App and it does not have the scope "read_shopify_payments_payouts" when you install it. I selected all. But I am building my app in C# and I haven't built a GraphQL interface to try it yet. I just don't see that any of the functions of GraphQL will have a list of transactions for a payout. 

0 Likes
Den327
New Member
6 0 0

Ok, I am now using the Insomnia app for testing. I am trying to get the bulk transactions of a payout, how do I do that with GraphQL? All I can see is ShopifyPaymentsPayout, and a bunch of others that don't look like they are going to give me the transactions that makeup the payout.

{shopifyPaymentsAccount {payouts(first:10) {edges {node {id}}}}}

0 Likes
Greg_Kujawa
Shopify Partner
1016 83 237

I'm not sure how this is going to fly, as I recall looking through the API documentation and it looks like the payout endpoint just lists date of payout and summary total for the individual payout. So I don't see where that transactions are linked to a specific payout ID. Unless someone else on here knows where to get at this...

0 Likes
Den327
New Member
6 0 0

That is my conclusion too, I can get 50 of the transactions with REST API but that is it.

0 Likes