Missing access token when querying Shopify API from custom app

Topic summary

Missing access token error when calling the REST client in a store-specific custom app was traced to misconfigured initialization using shopifyApp instead of shopifyApi.

Root cause: Configuration fields (isCustomStoreApp, apiKey, apiSecretKey, apiVersion, restResources, billing) were placed at the top level. The tutorial referenced shopifyApi, but the project used shopifyApp.

Resolution: Move the relevant parameters into the api object inside shopifyApp configuration and use the updated API paths:

  • Use shopify.api.session.customAppSession(…) instead of shopify.session…
  • Use shopify.api.rest… instead of shopify.rest…

Notes:

  • Access token is required for the REST client; misplacement caused the “Missing access token” error.
  • Code snippet configuration is central to understanding the fix.
  • Terms: shopifyApp (app scaffolding with auth/session), shopifyApi (lower-level API client); custom app (single store), public app (multi-store distribution).

Follow-up issue: Another participant’s app shows “session not found” and “shop unauthenticated,” and cannot install on other shops.

Clarification provided: Custom apps are single-store only; multi-store requires a public app. Status: the public app’s unauthenticated/session errors remain unresolved; no concrete fix was shared. Discussion ongoing.

Summarized with AI on January 27. AI used: gpt-5.

Hi @Divy_tatva ,

Customs apps in Shopify can only be installed on a single store. If you’d like it to be installed on multiple stores, you need to make a public app. Here’s more info on Distributing your Shopify app. As for your other errors, sorry I’m not sure what’s causing those.