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.
| Target | Where it renders |
|---|
admin.order-details.action.render | Action 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
When installed through the install pipeline, each admin action is persisted
as a single schema file at:
Fields
| Field | Required | Description |
|---|
handle | yes | URL-safe identifier — unique per app. Also used as the schema filename. |
target | yes | Action slot the button is rendered into. See Available targets. |
title | yes | Button label shown to the merchant. |
appUrl | yes | HTTPS URL loaded into the modal iframe. Receives resource context as query params. |
icon | no | URL 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:
| Parameter | Always set | Description |
|---|
target | yes | The extension’s manifest target. |
domainSlug | yes | The merchant’s domain slug. |
host | yes | btoa(window.location.origin) — base64-encoded admin origin. |
resourceId | optional | The id of the resource currently being viewed (e.g. ord_8a7f...). |
resourceType | optional | The 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 Action | Admin Block |
|---|
| Trigger | Click a button | Always rendered with the page |
| Layout | Modal iframe on top of the page | Inline iframe in the page layout |
| Use cases | Refund, resync, issue gift card, one-shot ops | Reviews summary, warehouse status, KPIs |
type field | admin_action | admin_block |
| File location | admin-actions/{handle}.schema.json | app.json → extensions.adminExtensions[] |
| Discovery API | /api/apps/admin-extensions?type=admin_action | /api/apps/admin-extensions?type=admin_block |
See Also