I’m trying to use the Order REST API to determine the usage of Paypal vs Shopify Payments on one of our sites. The call I’m making to get my orders is to
/admin/api/2022-01/orders.json?status=any&fields=id,gateway.
We’ve had over 4000 orders, and many of them have
{"id" : {{order_id}},"gateway" : "shopify_payments"}
but the vast majority of orders retrieved via the API have
{"id" : {{order_id}},"gateway" : ""}
This also seems to be the case when making calls to /admin/api/2022-10/orders/4049577672840/transactions.json?fields=id,gateway for each order as well. Why is the gateway property empty? Is there any other way to get the payment gateway for all of my orders?
Hi @wthomas999 
Since the Order.gateway property is deprecated in versions 2022-01+, I’d recommend using the Order.payment_gateway_names property instead. This should list the payment gateways used for the order, and reflects the Transaction.gateway property all related transactions at the /admin/api/2022-10/orders/ORDER_ID/transactions.json endpoint.
Hope that helps!
Hi @ShopifyDevSup ,
Thank you for your suggestion, unfortunately, I did try this and I’m seeing the same empty string returned in the payment_gateway_names list:
Changing the call to:
/admin/api/2022-01/orders.json?status=any&fields=id,payment_gateway_names
still results in empty values:
{'id': 4049490346120, 'payment_gateway_names': ['']}
The site in question should only have been using Shopify Payments or PayPal. Is it possible that their was a previously used payment gateway that has since been deprecated?
Would you mind trying to check the list of transaction.gateways on that same order (4049490346120) with this endpoint: /admin/api/2022-10/orders/4049490346120/transactions.json?fields=gateway
Alternatively, if you would reach out to us here using your partner account with permissions to this merchant store and orders, and we would be happy to take a closer look. Please be sure to provide the team with the shop_id, api_client_id and the x-request-id (+timestamp) from trying the endpoint above. It would be helpful to let them know we were looking at order id 4049490346120 in particular as well.
Hi @ShopifyDevSup
GET *.myshopify.com/admin/api/2022-10/orders/4049490346120/transactions.json?fields=gateway
results in
{"transactions":[{"gateway":""}]}
Unfortunately I can’t grant any access to the site at this time but will keep this in mind if this becomes an absolute blocker for my team. As of now, knowing the different gateways is a nice-to-have.