Skip to main content

Admin Action Extensions

Admin actions add a button to an admin resource page (e.g. the order detail page). When the merchant clicks it, your app opens in a modal iframe with the current resource id in the URL — perfect for “Refund this order”, “Issue gift card from order”, “Resync inventory”, or any other one-shot operation that needs your app’s UI but does not belong as an always-visible block.
If you need a panel that is always visible on a resource page, use an Admin Block instead. Use an Admin Action when the merchant only needs the UI on demand.

How Admin Actions Work

The host renders the button in the resource page’s action toolbar. On click, it opens a modal with an iframe pointing at your appUrl plus query parameters describing the resource. Your app drives the UX inside the modal and uses App Bridge to close it, show a toast, or trigger a host redirect when work is done.

Available Targets

Admin Actions are wired at specific resource-detail action slots. The initial release ships with one target — more will be added in subsequent releases.
TargetWhere it renders
admin.order-details.action.renderAction toolbar on the order detail page
Additional targets for product, customer, draft order, and collection detail pages are planned next. Track the changelog for new admin.{resource}-details.action.render targets as they ship.

Extension Manifest

Declare admin actions in your app.json under extensions.adminActions, or send them inline to the install pipeline. Each entry corresponds to one button.

Inline in app.json

Schema file form

When installed through the install pipeline, each admin action is persisted as a single schema file at:

Fields

FieldRequiredDescription
handleyesURL-safe identifier — unique per app. Also used as the schema filename.
targetyesAction slot the button is rendered into. See Available targets.
titleyesButton label shown to the merchant.
appUrlyesHTTPS URL loaded into the modal iframe. Receives resource context as query params.
iconnoURL of an SVG/PNG icon shown next to the button label.

Installing Admin Actions

Send the action manifests when your app completes OAuth, the same way you upload theme blocks or snippets. The install endpoint accepts an adminActions array on the extensions payload:
Each entry produces a {handle}.schema.json file under the app’s admin-actions/ directory. The host’s admin extension API picks it up on the next request — /api/apps/admin-extensions?target=... returns entries with type: "admin_action" for actions, as opposed to type: "admin_block" for blocks.

Iframe Context

When the merchant clicks the action button, your appUrl is loaded into the modal iframe with these query parameters appended:
ParameterAlways setDescription
targetyesThe extension’s manifest target.
domainSlugyesThe merchant’s domain slug.
hostyesbtoa(window.location.origin) — base64-encoded admin origin.
resourceIdoptionalThe id of the resource currently being viewed (e.g. ord_8a7f...).
resourceTypeoptionalThe type of the resource (e.g. order).
Unlike admin blocks, the action modal does not append an extensionId query param — the modal’s resize listener filters on the manifest id it already holds, so you don’t need to echo one. Resize clamp for the modal is Math.min(height, 800), with a 400px default.

Communicating with the Host

Admin actions use the standard App Bridge SDK. app.dispatch(action, payload) and app.dispatchAndWait(action, payload) take an action string plus payload — not a {type, payload} envelope.

Close the modal when done

After your action completes, dismiss the modal so the merchant returns to the resource page:

Show a toast on success

Block close while a request is in flight

The LeaveConfirmation helper also dispatches the underlying LEAVE_CONFIRMATION_ENABLE / LEAVE_CONFIRMATION_DISABLE actions for you, and wires the browser’s beforeunload event so closing the tab triggers the confirmation too.

Complete Example

A minimal refund helper that loads the order, takes a partial amount, and issues the refund via your app’s backend before closing the modal.

Admin Actions vs Admin Blocks

Admin ActionAdmin Block
TriggerClick a buttonAlways rendered with the page
LayoutModal iframe on top of the pageInline iframe in the page layout
Use casesRefund, resync, issue gift card, one-shot opsReviews summary, warehouse status, KPIs
type fieldadmin_actionadmin_block
File locationadmin-actions/{handle}.schema.jsonapp.jsonextensions.adminExtensions[]
Discovery API/api/apps/admin-extensions?type=admin_action/api/apps/admin-extensions?type=admin_block

See Also