📈

【Shopify.dev和訳】Admin API/GraphQL reference/Customers①

2021/10/01に公開

この記事について

この記事は、Customer APIsの記事を和訳したものです。

記事内で使用する画像は、公式ドキュメント内の画像を引用して使用させていただいております。

Shopify アプリのご紹介

Shopify アプリである、「商品ページ発売予告アプリ | リテリア Coming Soon」は、商品ページを買えない状態のまま、発売日時の予告をすることができるアプリです。Shopify で Coming Soon 機能を実現することができます。

https://apps.shopify.com/shopify-application-314?locale=ja&from=daniel

Shopify アプリである、「らくらく日本語フォント設定|リテリア Font Picker」は、ノーコードで日本語フォントを使用できるアプリです。日本語フォントを導入することでブランドを演出することができます。

https://apps.shopify.com/font-picker-1?locale=ja&from=daniel

概要 | Overview

Customer APIs

マーチャントの顧客データ管理を支援します。

本セクションの API 一覧 | In this section

ユニオン | UNIONS

CustomerPaymentInstrument

CustomerPaymentMethods に可能な全ての手段。

可能なタイプ | Possible types

オブジェクト | OBJECT

Customer

顧客の連絡先、注文履歴、メルマガ登録に同意しているかどうかなど、ストアの顧客に関する情報を表します。

内容 | On this Page

接続先 | Connections

event (EventConnection!)
顧客に関するイベントのリスト。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
query (String) サポートされているフィルタパラーメータ :

comments
created_at
subject_type
verd

フィルターの使い方については、検索構文を参照してください。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false
sortKey (EventSortKeys) 指定されたキーでリストをソートします。デフォルト値 : ID

metafields (MetafieldConnection!)
リソースに属するメタフィールドのリスト。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
namespace (String) フィルタリングの対象となるメタフィールドの名前空間です。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false

orders (OrderConnection!)
顧客の注文リスト。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
query (String) サポートされているフィルタパラーメータ :

cart_token
channel_id
chargeback_status
checkout_token
created_at
credit_card_last4
customer_id
delivery_method
discount_code
email
financial_status
fraud_protection_level
fulfillment_location_id
fulfillment_status
gatway
location_id
name
payment_provider_id
processed_at
reference_location_id
return_status
risk_level
sales_channel
source_identifier
source_name
status
tag
test
updated_at

フィルターの使い方については、検索構文を参照してください。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false
sortKey (OrderSortKeys) 指定されたキーでリストをソートします。デフォルト値 : ID

paymentMethods (CustomerPaymentMethodConnection!)
顧客の支払い方法のリスト。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false
showRevoked (Boolean) 顧客が取り消した支払い方法を表示するかどうか。デフォルト値 : false

privateMetafields (PrivateMetafieldConnection!)
リソースに属するプライベートメタフィールドのリスト。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
namespace (String) フィルタリングの対象となるメタフィールドの名前空間です。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false

subscriptionContracts (SubscriptionContractConnection!)
顧客のサブスクリプション契約のリスト。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false

フィールド | Fields

acceptsMarketing (Boolean!)
顧客がメルマガ受信に同意したかどうかの boolean 値。

acceptsMarketingUpdatedAt (DateTime!)
顧客がメルマガ受信に同意または拒否した日時。

addresses ([MailingAddress!]!)
顧客に関連するアドレスのリスト。

Argument Description
first (Int) 配列の結果をこの要素数になるように後ろを切り捨てます。

averageOrderAmountV2 (MoneyV2)
顧客が注文ごとに費やした平均金額。

canDelete (Boolean!)
マーチャントが顧客をストアから削除できるかどうかの boolean 値。

顧客がストアから削除できるのはまだ注文をしていない場合のみで、顧客が注文をした後はストアから削除することはできません。

createdAt (DateTime!)
顧客がストアに追加された日時。

defaultAddress (MailingAddress)
カスタマーに関連付けられたデフォルトの住所。

displayName (String!)
first_name と last_name の値に基づいた、カスタマーのフルネーム。

first_name と last_name が利用できない場合は、顧客の e-mail アドレスにフォールバックされ、それが利用できない場合は顧客の電話番号になります。

email (String)
顧客の E メールアドレス。

firstName (String)
顧客のファーストネーム。

hasNote (Boolean!)
顧客が関連するメモを持っているかどうかの boolean 値。

hasTimelineComment (Boolean!)
マーチャントがカスタマーのページにカスタマーに関するタイムラインコメントを追加しているかどうかの boolean 値。

id (ID!)
グローバルに一意な識別子。

image (Image!)
顧客に関連するイメージ。

Argument Description
size (Int) 画像の幅と高さ(1 ~ 2048 ピクセル)。 この引数は非推奨です。代わりにImage.transformedSrcmaxWidthまたはmaxHeightを使用してください。

lastName (String)
顧客のラストネーム。

lastOrder (Order)
顧客の最後にした注文。

legacyResourceId (UnsignedInt64!)
REST Admin API の対応するリソースの ID。

lifetimeDuration (String!)
顧客がストアに初めて追加されてからの期間。

例:「約 12 年」。

locale (String!)
顧客のロケール。

marketingOptInLevel (CustomerMarketingOptInLevel)
M3AAWG のベストプラクティスガイドラインに記載されている、マーケティング購読のオプトインレベル。

顧客がメルマガ受信に同意したときに与えたものです。

顧客がメルマガを受け入れない場合、このプロパティは NULL になります。

metafieldMetafield
リソースに属する、名前空間とキーによるメタフィールドを返します。

Argument Description
key (String) required プライベートメタフィールドのキーです。
namespace (String) required プライベートメタフィールドの名前空間です。

multipassIdentifier (String)
Multipass ログインで使用される、顧客の一意の識別子。

note (String)
顧客に関するメモ。

ordersCount (UnsignedInt64!)
顧客が生涯に店舗で行った注文の数。

phone (String)
顧客の電話番号。

privateMetafield (PrivateMetafield)
リソースに属する、名前空間とキーによるプライベートメタフィールドを返します。

Argument Description
key (String) required プライベートメタフィールドのキーです。
namespace (String) required プライベートメタフィールドの名前空間です。

productSubscriberStatus (CustomerProductSubscriberStatus!)
サブスクリプション契約によって定義される、顧客の可能なサブスクライバーの状態。

state (CustomerState!)
顧客のショップのアカウントの状態。

tags ([String!]!)
顧客に追加されたタグのコンマ区切りリスト。

taxExempt (Boolean!)
顧客が注文に対する税金の請求を免除されているかどうかの boolean 値。

taxExemptions ([TaxExemption!]!)
顧客に適用される免税措置のリスト。

totalSpent (Money!)
顧客が生涯で注文に費やした合計金額。

totalSpentV2 (MoneyV2!)
顧客が生涯で注文に費やした合計金額。

updatedAt (DateTime!)
顧客が最後に更新された日時。

validEmailAddress (Boolean!)
E メールアドレスが正しくフォーマットされているかどうかの boolean 値。

メールアドレスが実際に存在することを保証するものではありません。

verifiedEmail (Boolean!)
顧客がメールアドレスを確認したかどうかの boolean 値。

Shopify の管理画面や AI で顧客が作成された場合、デフォルトではtrueになります。

Customer を返す型 | Types that return Customer

Customer のミューテーション | Mutations for Customer

customerAddTaxExemptions
顧客に免税制度を追加します。

customerCreate
新規顧客を作成します。

customerDelete
顧客を削除します。

customerGenerateAccountActivationUrl
新しいアカウントアクティベーション URL を生成します。

customerRemoveTaxExemptions
カスタマーから免税対象を削除します。

customerReplaceTaxExemptions
顧客の免税対象を置換する。

customerUpdate
顧客の属性を更新します。

customerUpdateDefaultAddress
顧客のデフォルトアドレスを更新します。

実装 | Implements

非推奨のフィールド | Deprecated fields

  • averageOrderAmount (Money)
    顧客が 1 回の注文で費やした平均金額です。

複数の Customer をページングするための自動生成タイプです。

内容 | On this page

フィールド | Fields

edges ([CustomerEdge!]!)
エッジのリスト。
pageInfo (PageInfo!)
ページネーションを作成するための情報。

内容 | On this page

フィールド | Fields

cursor (String!)
ページネーションで使用するカーソルです。

自動生成されるタイプで、ページネーションの際に 1 つの Customer とカーソルを保持します。

node (Customer!)
CustomerEdge の末尾の項目。

CustomerEdge を返す型 | Types that return CustomerEdge

Samples

Sample 1
# 最初10人の顧客を取得する
{
  customers(first: 10) {
    edges {
      node {
        id
        displayName
      }
    }
  }
}
OUTPUT
{
  "data": {
    "customers": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Customer/1310260264982",
            "displayName": "Bob Slydell"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260789270",
            "displayName": "Kermit Haag"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260854806",
            "displayName": "Roseanna Halvorson"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260887574",
            "displayName": "Cornelia Borer"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260920342",
            "displayName": "Dorian Heidenreich"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260953110",
            "displayName": "Ivan Rowe"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260985878",
            "displayName": "Leana Little"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310261051414",
            "displayName": "Reinaldo Krajcik"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310261084182",
            "displayName": "Ronald Heaney"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310261116950",
            "displayName": "Alaine Cummings"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 12,
      "actualQueryCost": 12,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 988,
        "restoreRate": 50
      }
    }
  }
}
Sample 2
# 2019年01月01日以降に更新された顧客を取得
{
  customers(first: 10, query:"updated_at:>2019-01-01") {
    edges {
      node {
        id
        displayName
      }
    }
  }
}
OUTPUT
{
  "data": {
    "customers": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Customer/1310260264982",
            "displayName": "Bob Slydell"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260789270",
            "displayName": "Kermit Haag"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260854806",
            "displayName": "Roseanna Halvorson"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260887574",
            "displayName": "Cornelia Borer"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260920342",
            "displayName": "Dorian Heidenreich"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260953110",
            "displayName": "Ivan Rowe"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310260985878",
            "displayName": "Leana Little"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310261051414",
            "displayName": "Reinaldo Krajcik"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310261084182",
            "displayName": "Ronald Heaney"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310261116950",
            "displayName": "Alaine Cummings"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 12,
      "actualQueryCost": 12,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 988,
        "restoreRate": 50
      }
    }
  }
}
Sample 3

# 顧客IDの取得
{
  customers(first:1, query:"email:bob.slydell@example.com") {
    edges {
      node {
        id
        displayName
      }
    }
  }
}

OUTPUT
{
  "data": {
    "customers": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Customer/1310260264982",
            "displayName": "Bob Slydell"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 3,
      "actualQueryCost": 3,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 997,
        "restoreRate": 50
      }
    }
  }
}
Sample 4

# IDとGraphQLエイリアスを使って複数の顧客を取得
{
  customer1: customer(id:"gid://shopify/Customer/1310260264982") {
    displayName
  }
  customer2: customer(id:"gid://shopify/Customer/1310260789270") {
    displayName
  }
  customer3: customer(id: "gid://shopify/Customer/1310260854806") {
    displayName
  }
}
OUTPUT
{
  "data": {
    "customer1": {
      "displayName": "Bob Slydell"
    },
    "customer2": {
      "displayName": "Kermit Haag"
    },
    "customer3": {
      "displayName": "Roseanna Halvorson"
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 3,
      "actualQueryCost": 3,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 997,
        "restoreRate": 50
      }
    }
  }
}
Sample 5

# QueryRoot.nodeフィールドとGraphQLフラグメントを使った顧客の取得
{
  node(id:"gid://shopify/Customer/1310260264982") {
    id
  }
  ... on Customer {
    displayName
  }
}
OUTPUT
{
  "errors": [
    {
      "message": "Fragment on Customer can't be spread inside QueryRoot",
      "locations": [
        {
          "line": 7,
          "column": 3
        }
      ],
      "path": [
        "query",
        "... on Customer"
      ],
      "extensions": {
        "code": "cannotSpreadFragment",
        "typeName": "Customer",
        "fragmentName": "unknown",
        "parentName": "QueryRoot"
      }
    }
  ]
}
Sample 6

# 指定した国の顧客を取得する
{
  customers(first:10, query:"country:Canada") {
    edges {
      node {
        id
        displayName
      }
    }
  }
}
OUTPUT
{
  "data": {
    "customers": {
      "edges": [
        {
          "node": {
            "id": "gid://shopify/Customer/1310260264982",
            "displayName": "Bob Slydell"
          }
        },
        {
          "node": {
            "id": "gid://shopify/Customer/1310290378774",
            "displayName": "Benedict Ankunding"
          }
        }
      ]
    }
  },
  "extensions": {
    "cost": {
      "requestedQueryCost": 12,
      "actualQueryCost": 4,
      "throttleStatus": {
        "maximumAvailable": 1000,
        "currentlyAvailable": 996,
        "restoreRate": 50
      }
    }
  }
}

CustomerCreditCard

顧客のクレジットカードを表します。

内容 | On this page

フィールド | Fields

billingAddress (CustomerCreditCardBillingAddress)
カードの請求先住所。

brand (String!)
カードのブランド。

expiresSoon (Boolean!)
カードの有効期限が迫っているかどうかの boolean 値。

expiryMonth (Int!)
カードの有効期限の月。

expiryYear (Int!)
カードの有効期限の年。

firstDigits (String)
カードの BIN 番号。

isRevocable (Boolean!)
有効なサブスクリプション契約がない場合、支払い方法を取り消すことができます。

lastDigits (String!)
カード番号の下 4 桁。

maskedNumber (String!)
下 4 桁のみが表示されたマスクされたカード番号。

name (String!)
カードの所有者の名前。

CustomerCreditCardBillingAddress

クレジットカード支払の請求先住所。

内容 | On this page

フィールド | Fields

address1 (String)
住所の 1 行目。一般的には、番地や郵便番号。

city (String)
市、区、村、または町の名前。

country (String)
国の名前。

countryCode (CountryCode)
住所の国を表す 2 文字のコード。例えば、US です。

province (String)
県、州、地区などの地域。

provinceCode (String)
地域を表す 2 文字のコード。例えば、ON です。

zip (String)
住所の ZIP または郵便番号を指定します。

CustomerCreditCardBillingAddress を返す型 | Types that return CustomerCreditCardBillingAddress

CustomerPaymentInstrumentBillingAddress

支払手段の請求先住所です。

内容 | On this page

フィールド | Fields

address1 (String)
住所の 1 行目。一般的には、番地や郵便番号。

city (String)
市、区、村、または町の名前。

country (String)
国の名前。

countryCode (CountryCode)
住所の国を表す 2 文字のコード。例えば、US です。

name (String)
この住所に住んでいる顧客の名前。

province (String)
県、州、地区などの地域。

provinceCode (String)
地域を表す 2 文字のコード。例えば、ON です。

zip (String)
住所の ZIP または郵便番号を指定します。

Types that return CustomerPaymentInstrumentBillingAddress

CustomerPaymentMethod

顧客の支払い方法。

内容 | On this page

接続先 | Connections

subscriptionContracts (SubscriptionContactConnection!)
サブスクリプション契約をリストアップします。

Argument Description
after (String) 指定されたカーソルの後に来る要素を返します。
before (String) 指定されたカーソルの前にある要素を返します。
first (Int) リストの最初から n 個目までの要素を返します。
last (Int) リストの最後から n 個目の要素までを返します。
reverse (Boolean) 対象となるリストの順序を逆にします。デフォルト値 : false

フィールド | Fields

customer (Customer)
お支払い方法が属する顧客です。

id (ID!)
この支払方法の ID。

instrument (CustomerPaymentInstrument)
この支払い方法の手段。

revokedAt (DateTime)
この支払い方法が取り消された時間。

CustomerPaymentMethod を返す型 | Types that return CustomerPaymentMethod

CustomerPaymentMethod のミューテション | Mutations for CustomerPaymentMethod

customerPaymentMethodCreditCardCreate
顧客のためにクレジットカードの支払い方法を作成します。

customerPaymentMethodCreditCardUpdate
顧客のクレジットカード決済方法を更新します。

customerPaymentMethodPaypalBillingAgreementCreate
顧客の PayPal 請求契約を作成します。

customerPaymentMethodPaypalBillingAgreementUpdate
顧客の PayPal 請求契約を更新します。

customerPaymentMethodRemoteCreate
リモートゲートウェイの識別子から支払い方法を作成します。

customerPaymentMethodRevoke
顧客の支払方法を取り消します。

customerPaymentMethodSendUpdateEmail
顧客が特定の支払方法を更新できるように、顧客にリンクを送信します。

実装 | Implements

複数の CustomerPaymentMethods をページングするための自動生成型。

内容 | On this page

フィールド | Fields

edges ([CustomerPaymentMethodEdge!]!)
エッジのリスト。

pageInfo (PageInfo!)
ページネーションを補助するための情報。

自動生成されたタイプで、1 つの CustomerPaymentMethod とページネーション中のカーソルを保持する。

内容 | On this page

フィールド | Fields

cursor (String!)
ページネーションで使用するためのカーソル。

node (CustomerPaymentMethod!)
CustomerPaymentMethodEdge の末尾の項目。

CustomerPaymentMethodEdge を返す型 | Types that return CustomerPaymentMethodEdge

CustomerPaypalBillingAgreement

顧客の支払い方法のための PayPal を表します。

内容 | On this page

フィールド | Fields

billingAddress (CustomerPaymentInstrumentBillingAddress)
この支払方法の請求先住所。

inactive (Boolean!)
PayPal の課金契約が非アクティブであるかどうかの boolean 値。

isRevocable (Boolean!)
有効なサブスクリプション契約がない場合、支払い方法を取り消すことができるかどうかの boolean 値。

paypalAccountEmail (String)
顧客の PayPal アカウントの E メールアドレス。

MUTATION

customerAddTaxExemptions

顧客への免税措置の追加

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerAddTaxExemptions($customerId: ID!, $taxExemptions: [TaxExemption!]!) {
  customerAddTaxExemptions(customerId: $customerId, taxExemptions: $taxExemptions) {
    customer {
      id
    }
    userErrors {
      field
      message
    }
  }
}
variable
{
  "customerId": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=",
  "taxExemptions": [
    "placeholder"
  ]
}

引数 | Arguments

Argument Description
customerId (ID!) required 更新する顧客の ID です。
taxExemptions ([TaxExemption]!) required 顧客に追加する免税制度のリスト。

フィールドを返す | Return fields

customer (Customer)
更新されたカスタマー。

userErrors ([UserError!]!)
ミューテーションを実行した際に発生したエラーのリスト。

customerCreate

新規顧客を作成します。

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerCreate($input: CustomerInput!) {
  customerCreate(input: $input) {
    customer {
      id
    }
    userErrors {
      field
      message
    }
  }
}
variable
{
  "input": {}
}

引数 | Arguments

Argument Description
input (CustomerInput!) required 顧客を作成する際に使用するフィールドです。

CustomerInput フィールド | CustomerInput fields

acceptsMarketing (Boolean)
顧客が E メールでマーケティング資料を受け取ることに同意したかどうか。

acceptsMarketingUpdatedAt (DateTime)
顧客が E メールでマーケティング資料を受け取ることに同意または異議を唱えた日時。顧客がマーケティング資料の受信を承諾または拒否したときに設定されます。

addresses ([MailingAddressInput!])
顧客のアドレスを指定する入力です。

email (String)
顧客の固有の E メールアドレス。

firstName (String)
顧客のファーストネーム。

id (ID)
更新するカスタマーを指定します。カスタマーが存在しない場合は、新しいカスタマーを作成します。

lastName (String)
顧客のラストネーム。

locale (String)
顧客のロケールを指定します。

marketingOptInLevel (CustomerMarketingOptInLevel)
顧客が E メールでマーケティング資料を受け取ることに同意したときに有効だった、マーケティング購読のオプトインレベル(M3AAWG のベストプラクティスガイドラインに記載されています)。

メタフィールド ([MetafieldInput!])
顧客に追加のメタデータを添付します。

note (String)
顧客に関するメモ。

phone (String)
顧客の固有の電話番号。

privateMetafields ([PrivateMetafieldInput!])
この製品に関連付けるプライベートメタフィールド。

tags ([String!])
顧客に関連付けられたタグのコンマ区切りリスト。tagsを更新すると、以前に顧客に追加された既存のタグはすべて上書きされます。既存のタグを上書きせずに新しいタグを追加するには、tagsAddミューテーションを使用します。

taxExempt (Boolean)
顧客が注文に対する税金の支払いを免除されているかどうか。

taxExemptions ([TaxExemption!])
顧客に適用する免税項目のリストです。

フィールドを返す | Return fields

customer (Customer)
更新されたカスタマー。

userErrors ([UserError!]!)
ミューテーションを実行した際に発生したエラーのリスト。

customerDelete

顧客を削除します。

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerDelete($input: CustomerDeleteInput!) {
  customerDelete(input: $input) {
    deletedCustomerId
    shop {
      id
    }
    userErrors {
      field
      message
    }
  }
}
variable
{
  "input": {
    "id": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="
  }
}

引数 | Arguments

Argument Description
input (CustomerDeleteInput!) required 削除する顧客を指定する。

CustomerDeleteInput フィールド | CustomerDeleteInput fields

id (ID!) required
削除する顧客の ID です。

フィールドを返す | Return fields

deletedCustomerId (ID)
削除された顧客の ID。

shop (Shop!)
削除された顧客のショップ。

userErrors ([UserError!]!)
変異を実行した際に発生したエラーのリストです。

customerGenerateAccountActivationUrl

新規アカウントのアクティベーション URL を生成します。

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerGenerateAccountActivationUrl($customerId: ID!) {
  customerGenerateAccountActivationUrl(customerId: $customerId) {
    accountActivationUrl
    userErrors {
      field
      message
    }
  }
}
variable
{
  "customerId": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE="
}

引数 | Arguments

Argument Description
customerId (ID!) required URL が生成される顧客の ID

CustomerInput フィールド | CustomerInput fields

id (ID!) required
削除する顧客の ID です。

フィールドを返す | Return fields

accountActivationUrl (URL)
新しく生成されたアカウントアクティベーション URL。

userErrors ([UserError!]!)
変異を実行した際に発生したエラーのリスト。

customerPaymentMethodCreditCardCreate

顧客のためのクレジットカードによる支払い方法を作成します。

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerPaymentMethodCreditCardCreate(
  $customerId: ID!
  $billingAddress: MailingAddressInput!
  $sessionId: String!
) {
  customerPaymentMethodCreditCardCreate(
    customerId: $customerId
    billingAddress: $billingAddress
    sessionId: $sessionId
  ) {
    customerPaymentMethod {
      id
    }
    userErrors {
      field
      message
    }
  }
}
variable
{
  "customerId": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=",
  "billingAddress": {},
  "sessionId": "placeholder"
}

引数 | Arguments

Argument Description
billingAddress (MailingAddressInput!) required 請求書先の住所。
customerId (ID!) required 顧客の ID。
sessionId (String!) required Cardserver のセッション ID。

MailingAddressInput フィールド | MailingAddressInput fields

address1 (String)
住所の 1 行目。一般的には、住所や私書箱の番号です。

address2 (String)
住所の 2 行目。典型的には、アパート、スイート、またはユニットの番号です。

city (String)
市、区、村、または町の名前。

company (String)
顧客の会社や組織の名前。

country (String)
国の名前を指定します。この引数は非推奨です。代わりにcountryCodeを使用してください。

countryCode (CountryCode)
住所の国を表す 2 文字のコードです。

firstName (String)
顧客のファーストネーム。

id (ID)
この引数は非推奨です。90%の突然変異では必要なく、必要な場合は別途提供されます。

lastName (String)
顧客のラストネーム。

phone (String)
顧客のユニークな電話番号。

E.164 規格に基づいてフォーマットされています。例えば、+16135551111です。

province (String)
県、州、地区など、住所の地域。この引数は非推奨です。代わりに provinceCode を使用してください。

provinceCode (String)
住所の地域を表すコード(都道府県、州、区など)。例えば、QC はカナダのケベック州を表します。

zip (String)
住所の郵便番号を指定します。

フィールドを返す | Return fields

customerPaymentMethod (CustomerPaymentMethod)
顧客の支払い方法。

userErrors ([UserError!]!)
ミューテーションを実行した際に発生したエラーのリスト。

customerPaymentMethodCreditCardUpdate

顧客のクレジットカードの支払い方法を更新します。

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerPaymentMethodCreditCardUpdate(
  $id: ID!
  $billingAddress: MailingAddressInput!
  $sessionId: String!
) {
  customerPaymentMethodCreditCardUpdate(
    id: $id
    billingAddress: $billingAddress
    sessionId: $sessionId
  ) {
    customerPaymentMethod {
      id
    }
    userErrors {
      field
      message
    }
  }
}
variable
{
  "id": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=",
  "billingAddress": {},
  "sessionId": "placeholder"
}

引数 | Arguments

Argument Description
billingAddress (MailingAddressInput!) required 請求書先の住所。
id (ID!) required 顧客の ID。
sessionId (String!) required クレジットカードサーバーのセッション ID。

MailingAddressInput フィールド | MailingAddressInput fields

address1 (String)
住所の 1 行目。一般的には、住所や私書箱の番号です。

address2 (String)
住所の 2 行目。典型的には、アパート、スイート、またはユニットの番号です。

city (String)
市、区、村、または町の名前。

company (String)
顧客の会社や組織の名前。

country (String)
国の名前を指定します。この引数は非推奨です。代わりにcountryCodeを使用してください。

countryCode (CountryCode)
住所の国を表す 2 文字のコードです。

firstName (String)
顧客のファーストネーム。

id (ID)
この引数は非推奨です。90%の突然変異では必要なく、必要な場合は別途提供されます。

lastName (String)
顧客のラストネーム。

phone (String)
顧客のユニークな電話番号。

E.164 規格に基づいてフォーマットされています。例えば、+16135551111です。

province (String)
県、州、地区など、住所の地域。この引数は非推奨です。代わりに provinceCode を使用してください。

provinceCode (String)
住所の地域を表すコード(都道府県、州、区など)。例えば、QC はカナダのケベック州を表します。

zip (String)
住所の郵便番号を指定します。

フィールドを返す | Return fields

customerPaymentMethod (CustomerPaymentMethod)
顧客の支払い方法。

userErrors ([UserError!]!)
ミューテーションを実行した際に発生したエラーのリスト。

customerPaymentMethodPaypalBillingAgreementCreate

顧客の PayPal 請求契約を作成します。

内容 | On this page

参考例 | Interactive example

これはミューテーションクエリの例です。このクエリを編集するには、下に埋め込まれたインタラクティブツールを使います。

ヒント:フィールドを自動補完するには、Ctrl + Spaceを使用してください。

mutation customerPaymentMethodPaypalBillingAgreementCreate(
  $customerId: ID!
  $billingAgreementId: String!
) {
  customerPaymentMethodPaypalBillingAgreementCreate(
    customerId: $customerId
    billingAgreementId: $billingAgreementId
  ) {
    customerPaymentMethod {
      id
    }
    userErrors {
      code
      field
      message
    }
  }
}
variable
{
  "customerId": "Z2lkOi8vU2hvcGlmeS9FeGFtcGxlLzE=",
  "billingAgreementId": "placeholder"
}

引数 | Arguments

Argument Description
billingAddress (MailingAddressInput) required 請求書先の住所。
billingAddressId (String!) required PayPal からの請求契約 ID です。
customerId (ID!) required 顧客の ID。
inactive (Boolean) required PayPal の課金契約が非アクティブであるかどうか。
デフォルト値:false

MailingAddressInput フィールド | MailingAddressInput fields

address1 (String)
住所の 1 行目。一般的には、住所や私書箱の番号です。

address2 (String)
住所の 2 行目。典型的には、アパート、スイート、またはユニットの番号です。

city (String)
市、区、村、または町の名前。

company (String)
顧客の会社や組織の名前。

country (String)
国の名前を指定します。この引数は非推奨です。代わりにcountryCodeを使用してください。

countryCode (CountryCode)
住所の国を表す 2 文字のコードです。

firstName (String)
顧客のファーストネーム。

id (ID)
この引数は非推奨です。90%の突然変異では必要なく、必要な場合は別途提供されます。

lastName (String)
顧客のラストネーム。

phone (String)
顧客のユニークな電話番号。

E.164 規格に基づいてフォーマットされています。例えば、+16135551111です。

province (String)
県、州、地区など、住所の地域。この引数は非推奨です。代わりに provinceCode を使用してください。

provinceCode (String)
住所の地域を表すコード(都道府県、州、区など)。例えば、QC はカナダのケベック州を表します。

zip (String)
住所の郵便番号を指定します。

フィールドを返す | Return fields

customerPaymentMethod (CustomerPaymentMethod)
顧客の支払い方法。

userErrors ([CustomerPaymentMethodUserError!]!)
ミューテーションを実行した際に発生したエラーのリスト。

Shopify アプリのご紹介

Shopify アプリである、「商品ページ発売予告アプリ | リテリア Coming Soon」は、商品ページを買えない状態のまま、発売日時の予告をすることができるアプリです。Shopify で Coming Soon 機能を実現することができます。

https://apps.shopify.com/shopify-application-314?locale=ja&from=daniel

Shopify アプリである、「らくらく日本語フォント設定|リテリア Font Picker」は、ノーコードで日本語フォントを使用できるアプリです。日本語フォントを導入することでブランドを演出することができます。

https://apps.shopify.com/font-picker-1?locale=ja&from=daniel

Discussion

ログインするとコメントできます