Skip to main content
The Subtotal Connect Shopify app exposes a small set of JSON endpoints through Shopify’s app proxy. You can call them from any storefront page to build custom UI — for example, a “Link your Walmart account” button on a marketing page, a CTA inside a loyalty widget, or an integration with a third-party storefront framework — without using the theme app block or profile UI extension.
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 appends logged_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
Example

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
  • blockVisiblefalse when 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.
Example

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
Example — a Connect button that opens Subtotal Link for a single retailer:

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
Example

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
Add utm_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:
The tags are returned on the connection by Get a connection, and you can group connection metrics by them. Only those three names are read; any other query parameter is ignored. Values are trimmed, and a value over 256 characters is dropped. Tags are recorded only when this endpoint creates a new connection — if the customer already has one for that retailer, they’re redirected into Subtotal Link and the existing connection keeps the tags it was created with.

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.
If you don’t need to inspect the customer’s current connection status (for example, on a marketing page where you just want a “Link your Walmart account” CTA), skip the /retailers call entirely and hard-code the linkId: