Trying to write query for Shopify Payout but get stuck

Hi there,

I am trying to use GraphQL Admin API to get a query for a certain day’s Shopify payout info, and link each payout to the order id. But I am not able to.
Can anyone take a look at the code and kindly offer some help? Much appreciated!

Things are based on:

country=‘us’
your_query2=‘’’ query ShopifyPaymentsPayoutShow {
shopifyPaymentsAccount {
payouts(first: 100) {
nodes {
id
issuedAt
net {
amount
currencyCode
}
status
transactionType
}
}
}
}‘’’

url = ‘https://’+{merchantcode}+‘/admin/api/2024-04/graphql.json’
headers = {“Content-Type”: “application/graphql”,
“X-Shopify-Access-Token”: token}

request = requests.post(url, data=your_query2, headers=headers)
jsonres=json.loads(request.text)

The GQL above is as far as I can get.
Seems like it doesn’t accept a filter or a query for a certain date, and it doesn’t have a node connected to order id.

Have you tried using the shopifyPaymentsAccount query which has a field for payouts?


You can filter by querying the issued_at field, and you can get details like the payout ID, issue date, net amount, status, and transaction type.

Hello:

Thanks for getting back to me. In fact, I was trying to query the most recent shopify payout list, regardless of account. The shopify payout doesn’t accept query filters, it seems. That’s where I got stuck.

Best,

李清缘

数据分析师

qingyuan.li@designlibro.com