About Customer Account UI extension fetch admin api

Topic summary

A developer is attempting to create a draft order mutation from a Customer Account UI extension and needs to access Shopify’s Admin API.

Current approach:

  • Using authenticate.public.customerAccount(request) to get session token and shop domain
  • Loading session via sessionStorage.loadSession(shopDomain)
  • Attempting to also use authenticate.admin(request) to access admin.graphql() for Admin API queries

Core question:
Can the same request object be used for both authenticate.public.customerAccount() and authenticate.admin() authentication methods? If not, what is the proper implementation pattern for accessing Admin API from a Customer Account UI extension?

The discussion remains open with no responses yet. The developer is seeking guidance on the correct authentication flow for this use case.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

I want to mutation a draft order from customer account ui extension. So, i need fetch admin api.

In my app backend

export async function action({ request }: ActionFunctionArgs) {
  const { sessionToken, cors } =
    await authenticate.public.customerAccount(request);
  const origin = request.headers.get("Origin") as string;
  const shopDomain = sessionToken.dest;
  const session = await sessionStorage.loadSession(shopDomain);

At same time i need use admin.graphql() to query admin api

const { admin } = await authenticate.admin(request);

I just want to know, can’i use the same request on the diffrent part? if not, what is the correct method?