# GraphQL Admin API で「決済方法」を取得したい

**URL:** <https://community.shopify.com/t/graphql-admin-api/106346>\
**Category:** 技術的なQ＆A\
**Created:** [March 14, 2022, 8:09am UTC](https://community.shopify.com/t/graphql-admin-api/106346 "2022-03-14T08:09:45Z")\
**Posts on this page:** 2\
**Page:** 1

## AI-generated summary

ShopifyのGraphQL Admin APIで、注文データから決済方法（例：クレカ、コンビニ）を取得・絞り込みたいという相談。

現状: OrderのcustomPaymentMethodsで取得できそうだが、CustomPaymentMethodConnectionの具体的なフィールド指定方法が不明。

追加状況: 特定の注文IDを指定すれば、paymentGatewayNamesやtransactions（paymentMethod、formattedGateway、paymentIcon.altText など）で決済情報を取得できた。

課題: orderのIDを指定せずに、決済方法を横断的に取得する手段の有無（顧客単位や一覧での取得可否）を質問中。

参照: Shopifyコミュニティの関連スレッドURLが提示されている。

技術用語補足:
- customPaymentMethods: 外部/カスタム決済手段の接続情報コネクション。
- transactions: 注文に紐づく支払いトランザクション履歴。
- paymentGatewayNames: 利用した決済ゲートウェイ名一覧。

現在の結論: 具体的な実装方法やID不要の取得方法に関する回答はまだなく、未解決。コードスニペットの内容が理解に重要。

<div class="post-metadata">

**Author:** ![fkan](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fkan](https://community.shopify.com/u/fkan)\
**Post date:** [March 14, 2022, 8:09am UTC](https://community.shopify.com/t/graphql-admin-api/106346/1 "2022-03-14T08:09:45Z")

</div>

注文管理の決済方法からデータを絞りたいのですが、決済方法が取得できていません。

現状、Shopify API reference docsで調べて

odersのcustomPaymentMethodsで取得できるのかなというところまでしかわかっておりません。

「クレカ決済」「コンビニ決済」のように決済方法を取得するには

下記 **# CustomPaymentMethodConnection fields** にはなんと入力すれば取得できますでしょうか？

ご教授いただけると幸いです。

よろしくお願いいたします。

```auto

{
customPaymentMethods {
# CustomPaymentMethodConnection fields
}

  

```

---

<div class="post-metadata">

**Author:** ![fkan](https://avatars.discourse-cdn.com/v4/letter/f/6bbea6/32.png) [@fkan](https://community.shopify.com/u/fkan)\
**Post date:** [March 15, 2022, 7:49am UTC](https://community.shopify.com/t/graphql-admin-api/106346/2 "2022-03-15T07:49:07Z")

</div>

質問の続きです。

特定のお客様の決済方法を取得することはできたのですが、

orderのidを指定せずに取得する方法はありますでしょうか？

コード：

```python
{
  order(id: "gid://shopify/Order/3928604967067") {
    paymentGatewayNames
    transactions(first:10) {
      id
      accountNumber
      formattedGateway
      paymentMethod
      paymentIcon {
        altText
      }
    }
  }
}

```

参考サイト：

[https://community.shopify.com/c/shopify-apis-and-sdks/how-to-get-the-detailed-payment-method-when-using-shopify/m-p/1219540#M68816](https://community.shopify.com/c/shopify-apis-and-sdks/how-to-get-the-detailed-payment-method-when-using-shopify/m-p/1219540#M68816)
