Skip to main content

Overview

Admin extensions add custom functionality to the Shopify admin panel. Create order action buttons, product bulk actions, custom dashboards, and workflow automations.

Extension Types

Product Actions

Add bulk actions to product lists
  • Tag products automatically
  • Generate SEO descriptions
  • Update pricing
  • Sync to external systems

Order Actions

Add actions to order details
  • Send custom notifications
  • Create shipment labels
  • Apply custom fulfillment
  • Export to warehouse

Customer Actions

Enhance customer management
  • Segment customers
  • Bulk email campaigns
  • Loyalty program enrollment
  • Custom tagging

Custom Pages

Add new pages to admin
  • Analytics dashboards
  • Inventory management
  • Custom reports
  • Integration settings

Admin Extension Targets

Available extension points:
TargetLocationUse Case
admin.product-details.action.renderProduct page actionsSingle product operations
admin.product-index.action.renderProduct list actionsBulk product operations
admin.order-details.action.renderOrder page actionsSingle order operations
admin.order-index.action.renderOrder list actionsBulk order operations
admin.customer-details.action.renderCustomer page actionsSingle customer operations
admin.customer-index.action.renderCustomer list actionsBulk customer operations

Example: Product SEO Generator

Generate an admin extension that creates SEO-optimized descriptions:
1

Describe Your Extension

Create an admin extension that appears on product pages. 
Add a button that uses AI to generate SEO-optimized product 
descriptions based on the product title and vendor. Update 
the product description field automatically.
2

Review Generated Code

Synapse creates:
  • Action button in product details
  • GraphQL queries for product data
  • Mutation to update description
  • Loading/success states
  • Error handling
3

Deploy & Test

  • Automatic validation and deployment
  • Available immediately in admin
  • Test on sample products
4

Use in Admin

  1. Go to Products → [Any Product]
  2. Click “More actions”
  3. Select your custom action
  4. Watch it process and update

Generated Extension Structure

extensions/seo-generator/
├── src/
│   ├── ActionExtension.tsx    # Main component
│   ├── api.ts                # API calls
│   └── run.graphql           # GraphQL
├── shopify.extension.toml    # Config
└── package.json

Main Component

import {
  reactExtension,
  useApi,
  Button,
  Text,
} from '@shopify/ui-extensions-react/admin';

export default reactExtension(
  'admin.product-details.action.render',
  () => <Extension />
);

function Extension() {
  const { data } = useApi<'admin.product-details.action.render'>();
  const [loading, setLoading] = useState(false);
  
  const generateSEO = async () => {
    setLoading(true);
    
    // Call your API
    const description = await fetch('/api/generate-seo', {
      method: 'POST',
      body: JSON.stringify({
        title: data.product.title,
        vendor: data.product.vendor
      })
    }).then(r => r.json());
    
    // Update product
    await updateProductDescription(data.product.id, description);
    
    setLoading(false);
  };
  
  return (
    <Button onPress={generateSEO} loading={loading}>
      Generate SEO Description
    </Button>
  );
}

Common Admin Patterns

  • Bulk Product Tagger
  • Order Export
  • Customer Segmentation
  • Inventory Alert
Use Case: Auto-tag products based on attributesTarget: admin.product-index.action.renderFeatures:
  • Select multiple products
  • Analyze titles/descriptions
  • Apply relevant tags
  • Show progress
Prompt Example:
"Create a bulk action for products that automatically adds 
relevant tags based on product titles. For example, products 
with 'cotton' get 'natural-fiber' tag. Show progress bar."

UI Components for Admin

  • <Button> - Primary/secondary actions
  • <ActionList> - Multiple action options
  • <Modal> - Confirmation dialogs
  • <Toast> - Success/error messages
  • <TextField> - Text inputs
  • <Select> - Dropdowns
  • <Checkbox> - Boolean options
  • <Form> - Form container
  • <Spinner> - Loading indicator
  • <ProgressBar> - Progress tracking
  • <Banner> - Info/warnings
  • <Badge> - Status indicators
  • useApi() - Access admin data
  • useData() - Current resource
  • useSessionToken() - Authentication
  • useLocale() - Internationalization

Making API Calls

Admin extensions can call external APIs and Shopify Admin API:
  • External API
  • Admin API
  • Bulk Operations
Call your own backend:
const { data } = useApi();
const sessionToken = await getSessionToken();

const response = await fetch('https://your-api.com/endpoint', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${sessionToken}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    productId: data.product.id,
    action: 'generate-seo'
  })
});

const result = await response.json();

Best Practices

Performance

  • Batch Operations: Process bulk actions in chunks
  • Background Jobs: Use webhooks for long operations
  • Caching: Cache API responses where appropriate
  • Rate Limits: Respect Shopify API rate limits

UX Guidelines

  • Clear Feedback: Show progress and results
  • Confirmation: Ask before destructive actions
  • Error Handling: Graceful failure with retry options
  • Undo: Provide undo for reversible actions

Security

  • Authentication: Always verify session tokens
  • Validation: Validate all inputs
  • Permissions: Check user permissions
  • Audit Logs: Log all actions for compliance

Advanced Features

Webhooks

Trigger on Shopify events:
// Handle order creation
app.post('/webhooks/orders/create', async (req, res) => {
  const order = req.body;
  
  // Custom processing
  await processNewOrder(order);
  
  res.status(200).send();
});

Background Jobs

Long-running tasks:
// Queue job
await queue.add('process-bulk', {
  productIds: selectedIds,
  action: 'update-seo'
});

// Show progress
return <Text>Processing in background...</Text>;

Custom Settings

Store app configuration:
const settings = await getAppSettings();

const apiKey = settings.external_api_key;
const threshold = settings.low_stock_threshold;

Analytics

Track usage:
await analytics.track('extension_used', {
  extension: 'seo-generator',
  resource: 'product',
  count: selectedIds.length
});

Example Prompts

Create an admin extension for product pages that analyzes 
competitor prices and suggests optimal pricing. Show current 
price, suggested price, and expected revenue impact. Add 
button to apply suggested price with confirmation modal.
Add an action to order details that checks for fraud signals 
like mismatched billing/shipping addresses, high order value, 
new customer. Display risk score and recommended action 
(approve/review/cancel). Add note to order.
Create bulk action for products that syncs inventory levels 
with our warehouse API. Send SKU and location, receive 
available quantity, update Shopify inventory. Show progress 
bar and sync status for each product.
Add action to customer pages that calculates lifetime value, 
average order value, and predicts next purchase date. Display 
in a nice summary card with charts. Tag customer based on 
value tier (bronze/silver/gold).

Testing Admin Extensions

1

Deploy to Dev Store

Extensions automatically deploy to your development store’s admin
2

Access Extension

Navigate to the admin page where your extension appears
3

Test Different Scenarios

  • Single item actions
  • Bulk actions with multiple items
  • Error conditions
  • Edge cases
4

Verify Results

  • Check data updates correctly
  • Confirm error handling works
  • Test loading states
  • Validate permissions

Troubleshooting

Causes:
  • Wrong extension target
  • Not installed in dev store
  • Permissions issue
Solutions:
  • Verify target in shopify.extension.toml
  • Check Apps in admin settings
  • Review app scopes
  • Clear browser cache
Causes:
  • Session token expired
  • Missing permissions
  • Rate limit exceeded
Solutions:
  • Refresh session token
  • Add required scopes to app
  • Implement rate limit handling
  • Check API error responses
Causes:
  • Processing too many items at once
  • Not batching requests
  • Blocking UI thread
Solutions:
  • Process in smaller batches
  • Use Promise.all for parallel requests
  • Show progress indicator
  • Consider background jobs

Next Steps