How to Get Shopify Order Payment Methods [Shopify GraphQL API Edition]
I’ll introduce how to get Shopify Order payment methods using the Shopify GraphQL API.
The theme of this article is to retrieve payment methods used in Shopify via the Shopify API.
Examples of payment methods)
When I asked a question in the Shopify Community, I received an answer immediately. Thank you.
{
order(id: "gid://shopify/Order/3928604967067") {
paymentGatewayNames
transactions(first:10) {
id
accountNumber
formattedGateway
paymentMethod
paymentIcon {
altText
}
}
}
}
{
"data": {
"order": {
"paymentGatewayNames": [
"shopify_payments"
],
"transactions": [
{
"id": "gid://shopify/OrderTransaction/4886496805019",
"accountNumber": "•••• •••• •••• 1111",
"formattedGateway": "Shopify Payments",
"paymentMethod": "VISA",
"paymentIcon": {
"altText": "Visa"
}
}
]
}
},
"extensions": {
"cost": {
"requestedQueryCost": 3,
"actualQueryCost": 3,
"throttleStatus": {
"maximumAvailable": 2000,
"currentlyAvailable": 1997,
"restoreRate": 100
}
}
}
}
That’s all from the Gemba.