If the theme app block or profile UI extension meets your needs, use those instead — they handle UI, state, and styling for you. The Storefront API is for cases where you need a custom entrypoint or a different layout.
Base path
All endpoints are mounted at/apps/subtotal/* on the merchant’s storefront domain. Fetch them with a relative path:
Authentication
You do not send an API key. Shopify’s app proxy signs every request server-side, so calls only work when they originate from a page on the merchant’s storefront. When a customer is signed in, Shopify automatically appendslogged_in_customer_id as a query parameter when proxying the request to the Subtotal Connect backend. Endpoints that operate on a specific customer (/retailers, /connections, /disconnect-connection, /visibility, /link/{linkId}) require the customer to be signed in. If they aren’t, those endpoints return 400 or redirect to the Shopify customer login.
Endpoints
GET /apps/subtotal/configuration
Returns 200 if the shop has configured Subtotal Connect (i.e. a Subtotal API key is stored for the shop). Returns 404 otherwise. Use this to feature-detect before rendering your UI.
Response
GET /apps/subtotal/visibility
Returns the visibility decision for the current customer based on the rules the merchant has configured in the Shopify admin (global allow-list of emails/domains, plus a per-retailer allow-list). Use this if you want your custom entrypoint to respect the same gating as the theme app block.
Response
blockVisible—falsewhen the merchant’s global visibility rules hide Subtotal Connect for this customer.restrictedRetailerIds— IDs the merchant has hidden from this specific customer. Filter these out of any retailer list you render.
GET /apps/subtotal/retailers
Returns the list of retailers supported for the shop, with the current customer’s connection (if any) attached to each retailer.
Response
retailer_id is a lowercase slug (e.g. walmart, amazon, kroger). The link_url path suffix is a short mixed-case alphanumeric linkId (e.g. zklQOnlG) used by /apps/subtotal/link/{linkId}.
connection is omitted when the customer has never linked the retailer. status is one of:
Treat
initialized, disconnected, and revoked the same as “no connection” — show a fresh Link action that starts a new linking flow.
Example
POST /apps/subtotal/connections
Creates (or reuses) a Subtotal connection for the current customer and returns a URL that opens Subtotal Link with the connection pre-bound. Redirect the customer to link_url to start the linking flow.
Request body
Response
POST /apps/subtotal/disconnect-connection
Disconnects an existing connection. After this returns, the connection’s status moves to disconnected and Subtotal stops collecting purchases for it.
Request body
Response
GET /apps/subtotal/link/{linkId}
One-shot redirect endpoint. Resolves the retailer with the given linkId (the last path segment of a retailer’s link_url), creates or finds the customer’s connection, and 302s into Subtotal Link. If the customer isn’t signed in, they’re redirected to Shopify’s customer login first and bounced back here on success.
Useful for plain <a href> entrypoints where you don’t want to run any client-side JavaScript.
Query parameters
Example
Tagging a link URL
Addutm_campaign, utm_source, or utm_medium to the URL and they’re recorded as connection tags on the connection this endpoint creates. Use them to tell apart the places you send customers from:
Putting it together
A minimal custom Connect button — feature-detect, fetch the customer’s Walmart connection state, and render the right entrypoint for the current status. For linking and reauthenticating,/apps/subtotal/link/{linkId} does the work in one step, so the button can be a plain <a href>. Only disconnect needs a JS click handler.
/retailers call entirely and hard-code the linkId: