ShoppingateShoppingateDevelopers
shoppinggate.app ↗
Documentation
  • What is a Mini App
  • Why Mini Apps
  • API integration
  • SDK
  • Webview
  • Mini App architecture
  • Getting started
  • Choosing your path
  • Introduction
    • Introduction
    • Sign up & login
    • Dashboard & analytics
    • Mini-Programs
    • Submit & publish a version
    • App Binding
    • Privacy Settings
    • Allowed URL
    • Users & roles
    • Introduction
    • Become a Mini-App vendor
    • API keys
    • My Mini-Apps
    • Orders
    • Webhook
    • Deep-link config
    • Introduction
    • Install & log in
    • Create a project
    • The workspace
    • Preview & upload
  • Introduction
  • Configuration
  • Lifecycle
  • Routing & query
  • Host functions
  • orderPayment
  • Permissions
  • User info
  • Introduction
  • Configuration
  • SDK
  • Lifecycle
  • Routing & query
  • Host functions
  • orderPayment
  • Permissions
  • User info
  • Web app and shell calls
  • Look and feel
  • Overview
    • Verify user
    • Create order
    • Get order
    • Update order status
    • Charge an order
    • Send a notification
  • Subscriptions
    • Create a subscription
    • List subscriptions
    • Get a subscription
    • Update a subscription
    • Reschedule next charge
    • Change plan (upgrade)
    • Cancel a subscription
  • Webhooks
Introduction

Mini App architecture

What runs on the phone, what runs on the servers, and how a Mini App, the Shoppingate app and the backends work together.

THE USER'S PHONESHOPPINGATE APPNATIVE MINI APPPagesdrawn by the appLogicyour JavaScriptWEB VIEW MINI APPShell pageholds the <web-view>Your web appwith the SDKPermissions and approvalthe user allows each feature · Private functions need approvalThe app's functionsuser · orderPaymentrefunds · support ticketsThe phonecamera · locationphotos and moreMini App runtimeruns each Mini App in its own spaceloads the published versionYour backendon your approved domainsyour callsShoppingate backendusers · orders · paymentsAPIwebhooksDev portalreview, publishMerchantorders, keysSG Studiowrite, test, uploaduploadpublish
The Mini App architecture: what runs on the phone, and what runs on the servers.

On the phone

Everything on the phone runs inside the Shoppingate app, in layers:

Your Mini App

Your code, in one of two forms:

  • Native Mini App — pages and logic. You write the pages; the Shoppingate app draws them as real app screens. Your JavaScript holds the logic. See Native mini-app.
  • Web view Mini App — a small shell page that holds a <web-view>. Your web app opens inside it and loads the SDK to reach the app. See Web view mini-app.

Permissions and approval

Between your Mini App and anything sensitive, there is a gate. Some functions are Public — open to every Mini App. Others are Private, like payment: your Mini App must request them in the Dev portal, and Shoppingate approves them for your Mini App only. Features that touch the user or the phone also need the user's permission, asked when the user needs the feature. See Permissions.

The app's functions and the phone

Behind the gate: the app's own functions — the signed-in user, orders and payment, refunds, support tickets — and the phone's features — camera, location, photos and more. See Host functions.

The runtime

The base layer. It runs each Mini App in its own space, separate from the app and from other Mini Apps, and loads the version you published. A native Mini App is downloaded on the first open and kept on the phone, so it opens fast every time after.

On the servers

  • Your backend — your products, prices, stock and orders. Your Mini App calls it directly, on domains approved in the Dev portal. See Allowed URL.
  • Shoppingate backend — users, orders and payments. Your backend calls its API with your API key, and it sends your backend webhooks when an order changes. See Backend integration.
  • Dev portal — where your Mini App is created, its versions reviewed and published.
  • Merchant portal — orders, API keys, webhooks and deep links.
  • SG Studio — where you write, test and upload your Mini App.

One order, from start to end

Saloni's story

Here is everything above working together, when a user books a massage at Saloni:

  1. 1OpenThe user searches for Saloni in the Shoppingate app and opens it. The runtime loads Saloni's published version.
  2. 2Who is it?Saloni's Mini App reads the signed-in user, with the user's permission. It sends the user's token to Saloni's backend, which confirms it with Shoppingate's backend. See Verify user.
  3. 3BrowseThe Mini App loads services, prices and free times from Saloni's own backend, on its approved domain.
  4. 4PayThe Mini App calls the app's orderPayment function. Shoppingate creates the order and shows its own payment screen. The result comes back to the Mini App.
  5. 5UpdatesWhen the order changes, Shoppingate's backend tells Saloni's backend with a webhook. Saloni's backend moves the order on with the API.
  6. 6Come backThe user taps the order in the Shoppingate app, and a deep link opens Saloni's Mini App on that order's page.

Where security sits

  • Review — every version is reviewed before it goes live.
  • Approved domains — your Mini App loads and calls only domains approved for it.
  • Approved functions — Private functions only for Mini Apps approved for them.
  • User permission — each feature asked for only when the user needs it.
  • Privacy policy — shown to users inside the app, the same way for every Mini App.
  • Separate spaces — each Mini App runs apart from the app and from the others.
  • Server to server — your backend confirms the user and handles orders with your API key, never from the phone.
NextGetting startedFrom a new account to your first published Mini App.→