Zid Docs
Apps
ThemesPayments
Apps
ThemesPayments
Help Center
Slack
  1. Apps
  • πŸ—‚οΈ Overview
  • πŸš€ Start Here
  • Create your First App
  • Responses
  • Rate Limiting
  • Authorization
  • Embedded Apps
  • StoreFront Events
  • Zid MUI
  • Zid SDKs
  • Our custom MCP server
  • Merchant APIs
    • Account
      • Me
        • Me
        • Profile
      • Store
        • Store
        • Branding
        • Localization
        • Social
        • Operations
        • Business
        • Upload Logo Image
        • Delete Logo Image
        • Upload Icon Image
        • Delete Icon Image
        • Upload Cover Image
        • Delete Cover Image
    • Orders
      • Validate Order Request
      • Create Order
      • Change Order Status
      • Add Order Comment
      • View Order
      • List Orders
      • List Custom Order Statuses
      • List Order Credit Notes
    • Reverse Orders
      • Create Reverse Orders
      • Create Reverse Orders Waybill
      • Add Reverse Order Reasons
      • List Reverse Reasons
      • Calculate Reverse Totals
      • Create refund for reverse order
      • Upload bank transfer receipt
      • Update return products
      • Order Details – View for Return
    • Abandoned Carts
      • List Carts
      • View Cart
    • Products
      • Managing Products
        • Create Product Types
        • Create Product
        • List Products
        • View Product
        • List Product Settings
        • Update Product
        • Bulk Update Products
        • Delete Product
      • Digital Vouchers
        • List Vouchers
        • Order Vouchers
        • Create Voucher
        • Import Vouchers
        • Export Vouchers
        • Update Voucher
        • Remove Voucher
      • Product Categories
        • List Categories
        • View Category
        • Create Category
        • Create Subcategory
        • Update Category
        • Assign Product to Category
        • Bulk Assign Products to Category
        • Publish Category
        • Detach Category from All Products
        • Remove Product from Category
      • Product Badge
        • List Badges
      • Product Attributes
        • List Attributes
        • View Attribute
        • Create Attribute
        • Update Attribute
        • Delete Attribute
      • Product Attribute Presets
        • List Presets
        • Create Preset
        • Update Preset
        • Delete Preset
      • Product Variants
        • Create Variants
        • Create Custom Option
        • Update Custom Option
        • Delete Custom Option Field
        • Create Custom Input Field
        • Update Custom Input Field
        • Delete Custom Input Field
      • Product Sorting
        • Set Manual Product Order
        • Reset Manual Product Order
      • Product Images
        • List Images
        • Upload Image
        • Update Image Order
        • Delete Image
      • Product Availability Notifications
        • Notification Stats
        • Noticiation Settings
        • List Notifications
        • Create Notification
        • Update Settings
        • Send Notification Email
        • Export Notifications
      • Product Export
        • Email All Products to Store Owner
        • Import Products via CSV or xlsx File
      • Product Stock
        • Retrieve Product Stock
        • List Product Stock Records
        • Create Product Stock
        • Update Product Stock
        • Bulk Update Product Stock Records
      • Product Questions & Answers
        • Retrieve Product Question
        • Retrieve Product Answer
        • List Product Questions
        • List Answers for Question
        • Create Product Question
        • Create Product Answer
        • Update Product Question
        • Update Product Answer
        • Delete Product Question
        • Delete Product Answer
      • Product Reviews
        • List Reviews
        • Count Reviews
      • Digital Products
        • Create Downloadable Product
        • Generate Upload URL
        • Upload File to S3
        • Create Product Downloadable
        • Get Product Downloadables
        • Delete Product Downloadable
        • List Store Downloadables
        • Create Store Downloadable
        • Delete Store Downloadable
    • Inventories
      • Create Location
      • Update Location
      • Update Product Stock for Location
      • List Locations
      • View Location
    • Shipping
      • List Store Shipping Methods
    • Marketing
      • Coupons
        • List Coupons
        • View Coupon
        • Create Coupon
        • Generate Bulk Coupons
        • Duplicate Coupon
        • Duplicate Bulk Coupons
        • Update Coupon Note
        • Update Coupon
        • Update Bulk Coupons
        • Update Coupon Status
        • Update Bulk Coupons Status
        • Delete Coupon
        • Delete Bulk Coupons
      • Bundle Offers
        • List Bundle Offers
      • Loyalty Program
        • Loyalty Program Status
        • Loyalty Program Details
        • Loyalty Program Info
        • Customer Loyalty Summary
        • Customer Points History
        • Activate Loyalty Program
        • Set Points Expiration Rules
        • Update Cashback Rule
        • Create Points Redemption Method
        • Update Points Redemption Method
        • Delete Points Redemption Method
        • Adjust Customer Points
      • Discount Rules
        • List Discount Rules
        • View Discount Rule
        • Create Discount Rule
        • Update Discount Rule
    • Customers
      • Customer Tags
        • List Customer Tags
        • Add Customer Tag
        • Ω’Update Customer Tag
        • Delete Customer Tag
      • List Customers
      • View Customer
      • Primary Customer List
      • FInd Customer By Phone Number
      • Customer Profile
      • Add Customer
      • Update Customer
      • Delete Customer
      • Add Bulk Customers
      • Import Customers
    • Store Settings
      • πŸ“„ User Roles and Permissions
      • Retrieve Store Manager Profile
      • Retrieve VAT Settings
      • List Payment Methods
      • List Store Operating Countries
    • Countries and Cities
      • List Countries
      • List Cities for Country
  • Webhooks
    • Overview
    • Webhook Health Tracking
    • Events
      • Order
      • Product
      • Abandoned Cart
      • Customer
      • Product Category
    • APIs
      • Health Summary
      • Broken Webhooks
      • Recover Broken Webhooks
      • List Webhooks
      • Create Webhook
      • Delete Webhook
      • Delete Webhook By subscriber
  • App Management
    • Events
    • APIs
      • Subscription Details
      • Update Usage-Based Charges
  1. Apps

Embedded Apps

Developer Guide#

Embedded Apps within the Merchant Dashboard offer a seamless integration experience for both Merchants and Zid Partners. These applications are integrated directly into the dashboard through an iframe, allowing merchants to access and interact with your app without leaving the Zid Merchant Dashboard.

Benefits for Partners#

Seamless Integration: Embed your app within Zid Merchant Dashboard for a unified merchant experience.
Enhanced Visibility: Increase app exposure and engagement.
Simplified Access: No separate logins required, making it easier for merchants to use your app.
Customer Loyalty: A seamless experience fosters higher satisfaction and long-term use.

Authentication Flow#

The embedded apps feature is designed to bypass standard logins. The flow consists of 6 mandatory steps:

Step 1 β€” Merchant installs the app#

The merchant initiates installation from the Zid Merchant Dashboard. Zid redirects to your Redirect URL with an authorization code. Ensure you include the embedded_apps_tokens_write scope in your initial OAuth request. After your app completes the OAuth flow, redirect the merchant to the Zid Dashboard embedded app route to open the app inside the dashboard.:

Step 2 β€” Exchange code for tokens#

Your callback endpoint receives ?code=.... Exchange it for tokens:
Save the access_token, authorization, and refresh_token in your database, associated with this merchant's store_id.

Step 3 β€” Register a lookup token with Zid#

Generate a UUID (version 4) on your server. Do not use the authorization JWT β€” JWTs are too long and will fail due to URL truncation when passed to the iframe.
Store this UUID in your database alongside the merchant's tokens, and register it with Zid:

Step 4 β€” Configure the Application URL#

In your Zid Developer Dashboard, set the Application URL to a fixed endpoint on your server that will serve the iframe content (e.g., https://your-app.com/embedded).

Step 5 β€” Merchant opens the embedded app#

When a merchant accesses your app, Zid loads your Application URL in an iframe, appending the UUID you registered:

Step 6 β€” Identify the merchant and render#

Your Application URL handler must:
1.
Read the token query parameter.
2.
Look up the UUID in your database to retrieve the merchant's store_id and stored tokens.
3.
Render the embedded page.

Redirecting Merchants to the Embedded App After Installation#

After a merchant successfully installs your embedded app and your app completes the OAuth flow, you can redirect the merchant to the embedded app inside Zid Merchant Dashboard.
Use the following URL structure:
https://dashboard.zid.sa/{language_code}/stores/{store_id}/apps/{app_id}/embedded
Example:
https://dashboard.zid.sa/ar-sa/stores/1/apps/4820/embedded

URL Behavior#

When redirecting merchants to the embedded app URL:
{app_id} must be your actual Zid app ID.
{store_id} can contain any valid value.
{language_code} can contain any supported dashboard language value, such as ar-sa.
Hermes automatically resolves the correct store ID and language based on the merchant’s dashboard session.
This means your app does not need to detect the merchant’s current dashboard language before redirecting. Zid will handle the final store and language context automatically.

When to Use This URL#

Use this URL after your app completes the installation and authorization flow, especially when you want the merchant to continue using the app directly inside Zid Merchant Dashboard.

Identifying the Merchant (Multi-Store)#

Each store that installs your app must get its own unique UUID lookup key.
Recommended Database Schema:

Content Security Policy (CSP)#

For the security of embedded applications, Zid enforces CSP. Every page served inside the iframe must include these headers:
Content-Security-Policy:
  style-src 'self' 'unsafe-inline' *;
  font-src 'self' 'unsafe-inline' data: *;
  default-src 'self' *.zid.dev web.zid.sa dashboard.zid.sa;
  script-src 'self' 'unsafe-inline' *;
  frame-ancestors 'self' *.zid.dev web.zid.sa dashboard.zid.sa;
  connect-src 'self' 'unsafe-inline' *
Note: Without the frame-ancestors directive, Zid's dashboard will block the iframe.

Token Management#

Delete User Token#

When a merchant uninstalls the application, revoke their access by deleting the authorization token from Zid's system:

Common Pitfalls & Security Recommendations#

1.
Do not use the JWT as the token parameter β€” JWTs will cause URL truncation. Always map a short UUID to the JWT locally.
2.
URL encoding β€” Use URL-safe characters for your token. UUIDs (hex + hyphens) are safe.
3.
Missing scope β€” The embedded_apps_tokens_write scope must be present in the initial OAuth redirect.
4.
Re-installations β€” When a merchant reinstalls, generate a new UUID. The old UUID stored at Zid becomes stale.
5.
Secure storage β€” Store access_token and authorization securely on your server β€” never expose them to the browser or iframe HTML.

Starter Project (Community Version)#

A simple reference implementation for the authorization flow:
Zid Embedded App Starter β€” Authorization
A minimal Flask starter for the Zid Embedded Apps OAuth authorization flow. Implements steps 1–6 of the Embedded Apps Authentication Flow β€” install, token exchange, UUID registration, and iframe rendering β€” so you can focus on building your app logic.
Community project β€” open source, open for improvements. This is not an official Zid package. Contributions and forks are welcome.
Modified atΒ 2026-06-10 04:31:46
Previous
Authorization
Next
StoreFront Events
Built with