Skip to content
benzookapi edited this page Jul 8, 2024 · 108 revisions

Basic usage of Session Token (ID Token)

216690835-a8615fb0-0a91-4357-9548-e551a46093f7.mp4

For external service connection

215689359-724b5000-cf86-4b6c-92bf-71b724632059.mp4

Non embedded apps cannot use App Bridge or Session Token, so should render the external page with your own JWT

Untitled.mp4

How to link a Shopify shop to an user of your external service

  1. In the login page, you should send the JWT with the shop name during the login process (your own JWT should be encoded with the app secret as Session Token does which prevents from fraud token insertion by others).
  2. If the user login successfully or the user is already logged-in, store the shop name in your database with the logged-in user ID.
  3. At the next time that the user is already logged-in or log in again, your service already has (know) the record of the ID and shop, and the user no longer needs to go to the Shopify app page.
  4. For publishing your app, this approach to limit the connecting point of your service and Shopify shops to the initial process of install is mandatory (see the guideline).
  5. Note that if your app is non embedded one, you can't get Built for Shopify badge.

External page protection and link to selected data

216701356-63f44dbe-8525-4d53-a721-6a729b0cd126.mp4

Theme editor and storefront working with App proxies

216705808-70d3b6ad-f7b7-4091-95ec-c45cc9a79502.mp4

Line item properties, and Cart notes and attributes insertion without touching the original theme Liquid

80ba3d56-2954-4110-8a76-d63c2decd367.mp4

Automatic discount working with customer metafields

216708433-be7bbfbd-30aa-480e-a165-e528f33f5901.mp4

Shipping rate filtering by input zip code

218436786-3fcd2802-6acc-4c32-b0ca-030184cbcee5.mp4

Payment method filtering by selected shipping rate

218440555-dd03d864-71e4-4f26-9414-f0701598c98e.mp4

Sending checkout events to GA4 through their API

shopify-ga4-web-pixels.mp4

Upsell products set in each metafield and get the shop review score in the post-purchase flow

219054274-a04af128-c1d8-43f6-9a9c-583bff239fcd.mp4

Provide the same upsell and review as post-purchase with IP address blocking

231545192-cd65d59f-78d5-48c6-987b-d2529b6a9e71.mp4

Clone a checkout from upsell using Storefront API and set an blacklisted IP address

231557892-2dcaf28d-ffeb-4578-9d7e-e4cc5e7a441d.mp4

Show the current line items in smart phone only for the collapsed order summary

231552190-7727e29b-4cb9-4b9b-ac24-4ca150af8be1.mp4

Block the checkout with "COMING SOON!" message and clear the cart if a larger quantity is given than allowed one

Untitled2.mp4

Fulfillment and capture orders, and use fulfillment service for product inventory management and external fulfillments

837d8306-2f0b-4c06-9562-ddebcd639fe9.mp4

TIPS: Inventory status transformation

Login Shopify store with a dummy SSO

18d5e2d7-ebb8-4f61-b145-6b90e463968e.mp4

Import product data using JSONL file upload

beed1a82-5593-4106-a42f-4b4f44f76e70.mp4

Checkout creation with a public token in a plain HTML page

368adbb8-d93d-43c6-a30c-034f719a9086.mp4

How the public token is used at the client side

f8f31763-8c3d-4152-88e9-7b0a7bb8d69c.mp4

How the private token is used at the server side

6f771740-b79f-4907-8ca6-742889e40143.mp4

TIPS

  • Public Token can be used for Storefront API only as X-Shopify-Storefront-Access-Token with unauthenticated scope only which can be revealed without expiration. Private Token can be used for Admin API as X-Shopify-Access-Token like OAuth Token, also for Storefront API as Shopify-Storefront-Private-Token With authenticated and unauthenticated scopes both (but they need to be included by the parent OAuth scopes) which can NOT be revealed and with expiration. Public / Private Token get disabled immediately once the parent OAuth token gets deactivated with the app uninstall or other token handling.

How to switch the language and country in context

15f2855a-608a-449a-8036-395a108cbe8e.mp4

TIPS

  • Checkout context depends on BuyerIdentity, so even if you create a checkout with a country locale (e.g. US), if the logged in customer has another country address (e.g. JP), the checkout context gets override with the customer's buyer identity.

Cart creation with a public token in a plain HTML page

e9daba94-b1d1-424e-a985-e2a5ee7ebb48.mp4

TIPS

  • Checkout initiation flow and Cart initiation flow cannot be merged so you have to decide which flow you use for your storefront. If you don't need cart function or already have your own cart integration, checkout flow might be better with more flexible shipping address preset for login or guest buyers. If you need cart or want to use Shopify cart, cart flow might be better with some estimation data like tax and shipping cost.
  • Checkout data cannot be retrieved with ID by another app (e.g. Storefront API GraphiQL explorer), and its checkout URL is supposed to be secret. Cart data can be retrieved with ID by another app, and its checkout URL is supposed to be shared like online store and POS merging.
Clone this wiki locally