Shopify API
Storefront API
X-Shopify-Storefront-Access-Token
アクセストークンでアクセス可能
GraphQL推奨
customer note以外の顧客情報はアップデートできる?
Customer Access Tokenがある
Customer用?
StoreFrontリファレンス
エンドポイント
mutation customerAddressUpdate($customerAccessToken: String!, $id: ID!, $address: MailingAddressInput!) {
基本inputにcustomerAccessTokenが必要
ユーザー側の通常のアクセスをshopify外からでも使えるようにするもの?
token発行ページに以下の文言があった。
ストアフロントAPIのアクセストークンは公開されています。それらをJavaScriptファイルまたは任意のHTMLドキュメントに配置することができます。
customerAccessTokenCreate
unauthenticated_write_customersスコープが必要
customerを見つける
unauthenticated_write_customersスコープは不要
code:js
queryCustomer: `query ($token: String!) {
customer(customerAccessToken: $token) {
email
}
}`,
headerにstorefront_access_tokenが必要
emailとpasswordをinputにセット
Shopify Partner で作成
shopifyデータの表示用?
Liquidレスポンス
CORS警告無しでリクエストできる。
online store 2.0
スペックの増加
アプリがカプセル化される
GraphQL
queryシンタックス
Admin API
Graphql リファレンス
query root
トップレベル
customer
スコープ: read_customers
Query
email:${eamil}
first
検索されたlistの内、最初の一つを取得
customer update
Ajax API
Cart
/cart/update.js
現在のcartをアップデートするAPI
Cart Attributeなどをアップデート
code:js
{
attributes: {
'Gift wrap': 'Yes'
}
}
Jquery post
その他
レスポンスコード
どのAPI?
Admin
PolarisでUIを作成。
Webhook