Build a Storefront
Use the Infuse Cloud dashboard to create and manage listings first. Build a custom storefront only when you need to sell marketplace products from your own website or application.
Your storefront owns the customer experience: product browsing, customer authentication, device selection, post-checkout status, and install actions. Infuse remains the source of truth for published products, checkout sessions, purchase entitlements, release compatibility, and install access.
Dashboard Setup
Before integrating a custom storefront:
- Open Marketplace.
- Select the marketplace instance.
- Open Provider.
- Open Discover and choose products to sell.
- Create listings for those products.
- Open Listings and confirm each listing is active.
- Open Purchases to understand how completed purchases are reviewed.
- Open Devices to understand device state and install actions.
The dashboard is the operational control surface for products, listings, purchases, and installs. Store Preview can be useful later as a manual example of listing selection and checkout session creation, but a production storefront should use your own backend boundary so provider credentials never run in the customer browser.
At a high level, your backend reads products from Infuse, creates a checkout session for the selected products and devices, redirects the customer to Stripe Checkout, then reads purchase state from Infuse after Stripe confirms payment.
How the Integration Works
Your storefront should call Infuse APIs from your server. Do not call Infuse Marketplace APIs directly from customer browsers with provider credentials.
For manual dashboard verification of checkout states, see Checkout Flow.
Before You Start
You need:
- An Infuse organisation with access to the marketplace instance you want to sell from.
- Server-side API credentials for that organisation.
- Permissions for published catalogue reads, checkout session creation, provider devices, provider purchases, and install access if your site will trigger installs.
- The
marketplaceInstanceIdfor the marketplace instance your storefront should display. - Absolute
successUrlandcancelUrlroutes hosted by your site. - A way to map signed-in customers in your system to one or more Infuse device IDs.
Keep API credentials on your backend. Your frontend should receive only the product, device, checkout, and purchase data needed to render the customer experience.
Recommended Backend Boundary
Expose your own customer-facing routes and keep Infuse authentication behind them. For example:
| Your route | Infuse API used by your backend |
|---|---|
GET /storefront/products | GET /marketplace/marketplace-items |
GET /storefront/products/:id | GET /marketplace/marketplace-items/{id} |
GET /storefront/devices | Your device system or GET /marketplace/providers/devices |
POST /storefront/checkout | POST /marketplace/checkout/session |
GET /storefront/purchases | GET /marketplace/providers/purchases |
POST /storefront/devices/:deviceId/products/:itemId/install | POST /marketplace/providers/devices/{deviceId}/purchases/{marketplaceItemId}/install |
This boundary lets you enforce your own customer authentication, hide provider credentials, validate selected devices belong to the signed-in customer, and store local audit records such as the returned checkoutSessionId.
1. Load Published Products
Use the public marketplace item APIs to build your catalogue and product detail pages.
GET /marketplace/marketplace-items?marketplaceInstanceId={marketplaceInstanceId}&page=1&pageSize=24
Authorization: Bearer {provider_access_token}
Common query fields:
| Field | Required | Use |
|---|---|---|
marketplaceInstanceId | Yes | Selects the marketplace instance to display. |
page | No | Page number for pagination. |
pageSize | No | Number of items per page. |
search | No | Text search for storefront search boxes. |
type | No | Filters by marketplace item type when your UI separates product categories. |
For a product detail page, fetch the current listed item before showing price or allowing checkout.
GET /marketplace/marketplace-items/{id}?marketplaceInstanceId={marketplaceInstanceId}
Authorization: Bearer {provider_access_token}
Use Infuse as the source of truth for marketplace item IDs, listing visibility, price, currency, version metadata, icons, images, and developer-provided descriptions. If you cache catalogue data, refresh it before checkout so you do not sell an item that has changed price or visibility.
2. Resolve Customer Devices
Checkout sessions are created for one or more target devices. Your storefront must know which devices the customer can buy for before creating checkout.
Most providers resolve this through their own account system:
- Authenticate the customer in your site.
- Load the customer-owned devices from your system.
- Map each selectable device to the corresponding Infuse
deviceId. - Send only valid selected
deviceIdsto your checkout route.
If the devices are registered in your provider Infuse IoT organisation, your backend can also read provider devices from Infuse:
GET /marketplace/providers/devices?limit=50&offset=0
Authorization: Bearer {provider_access_token}
Before checkout, validate that you have:
- At least one selected
deviceId. - At least one selected
marketplaceItemId. - A signed-in customer who is allowed to buy for those devices.
- Current product data from Infuse for the selected marketplace items.
3. Create a Checkout Session
When the customer confirms their basket, create an Infuse checkout session from your backend.
POST /marketplace/checkout/session
Authorization: Bearer {provider_access_token}
Content-Type: application/json
{
"deviceIds": ["device_123", "device_456"],
"marketplaceItemIds": ["mi_abc"],
"successUrl": "https://example.com/marketplace/checkout/success",
"cancelUrl": "https://example.com/marketplace/checkout/cancel",
"livemode": true
}
The request includes:
| Field | Use |
|---|---|
deviceIds | Devices the purchase applies to. |
marketplaceItemIds | Marketplace items selected by the customer. |
successUrl | Absolute URL Stripe redirects to after successful checkout. |
cancelUrl | Absolute URL Stripe redirects to if the customer cancels. |
livemode | Use true for production transactions and false for test or preview purchases where available. |
The response includes:
{
"checkoutSessionId": "mcs_123",
"checkoutUrl": "https://checkout.stripe.com/c/session...",
"livemode": true
}
Store the checkoutSessionId with your local order, customer action, or audit record if you need reconciliation. Then redirect the customer to checkoutUrl.
4. Redirect to Stripe Checkout
Infuse creates the Stripe Checkout session. Your integration should not create Stripe products, prices, line items, or fulfillment records directly for Marketplace purchases.
After the customer pays or cancels, Stripe redirects the browser to the successUrl or cancelUrl you supplied. Treat this redirect as a browser navigation event, not proof that the purchase is active. Infuse validates successful payment, records purchase state, and creates the relevant entitlements.
5. Read Purchase State
After the customer returns to your site, read purchase state from Infuse through your backend.
GET /marketplace/providers/purchases?deviceId={deviceId}&livemode=true&page=1&pageSize=20
Authorization: Bearer {provider_access_token}
Useful query fields:
| Field | Use |
|---|---|
deviceId | Limits results to one device. |
livemode | Separates production purchases from test purchases. |
page and pageSize | Paginates purchase history. |
Use this endpoint to drive "Your purchases", checkout confirmation, pending payment, and entitlement-aware UI states.
For a device detail page, load the device and purchase context:
GET /marketplace/providers/devices/{deviceId}/details
Authorization: Bearer {provider_access_token}
For release and compatibility information for a purchased product on a device:
GET /marketplace/providers/devices/{deviceId}/purchases/{marketplaceItemId}/releases
Authorization: Bearer {provider_access_token}
Your success page should be able to show a pending state while Infuse confirms the purchase. Poll or refresh purchase state from your backend until the purchase is active, failed, or requires customer support.
6. Queue Installs
Payment and installation are separate steps. A successful checkout grants purchase entitlements. Your storefront decides whether to install immediately after purchase or present install controls later.
First, read available releases for the purchased item and device:
GET /marketplace/providers/devices/{deviceId}/purchases/{marketplaceItemId}/releases
Authorization: Bearer {provider_access_token}
Then queue an install for the selected version:
POST /marketplace/providers/devices/{deviceId}/purchases/{marketplaceItemId}/install
Authorization: Bearer {provider_access_token}
Content-Type: application/json
{
"version": "1.4.2"
}
Only show install actions for active purchases and compatible releases. If a release is not compatible with the target device, keep the action disabled and explain the device or version requirement in your UI.
Provider Listing APIs
Provider listing APIs are useful for provider administration screens, but customer-facing storefront pages should normally read from the public marketplace item APIs so the storefront reflects what is currently published and visible to customers.
GET /marketplace/providers/listings
Authorization: Bearer {provider_access_token}
GET /marketplace/providers/listings/{marketplaceId}
Authorization: Bearer {provider_access_token}
Use these APIs when you need to inspect or manage the products your provider organisation lists. Do not use them as the only checkout-time availability check.
Customer Experience States
Build explicit states into your storefront:
| State | What to show |
|---|---|
| Catalogue loading | Products are being loaded from your backend. |
| Product unavailable | The item is no longer published, listed, or valid for the current marketplace instance. |
| No eligible devices | The customer must register or select a compatible device before checkout. |
| Checkout redirecting | The session was created and the customer is being sent to Stripe Checkout. |
| Checkout cancelled | The customer returned from the cancel URL. Keep the basket editable. |
| Purchase pending | The customer returned from success, but Infuse has not finished confirming purchase state. |
| Purchase active | The entitlement exists and install or management actions can be shown. |
| Install queued | An install request has been accepted for the selected device and version. |
Implementation Checklist
- Keep provider API credentials server-side.
- Build around Infuse
marketplaceItemIds; avoid a separate product ID system unless it maps directly back to Infuse IDs. - Validate selected devices against your signed-in customer before creating checkout.
- Refresh product details before checkout so price, currency, and visibility are current.
- Use absolute, stable
successUrlandcancelUrlvalues. - Store
checkoutSessionIdif you need local order tracking or support diagnostics. - Treat
successUrlas a return route, not fulfillment confirmation. - Read purchase state from
GET /marketplace/providers/purchases. - Use
livemode: trueonly for real customer transactions. - Trigger installs only for active purchases and compatible releases.
- Do not call Stripe directly to fulfill Marketplace purchases.
Endpoint Summary
| Purpose | Method | Endpoint |
|---|---|---|
| List published storefront products | GET | /marketplace/marketplace-items |
| Get published product detail | GET | /marketplace/marketplace-items/{id} |
| List provider devices | GET | /marketplace/providers/devices |
| Create checkout session | POST | /marketplace/checkout/session |
| List provider purchases | GET | /marketplace/providers/purchases |
| Get provider device details | GET | /marketplace/providers/devices/{deviceId}/details |
| Get purchased product releases | GET | /marketplace/providers/devices/{deviceId}/purchases/{marketplaceItemId}/releases |
| Queue purchased product install | POST | /marketplace/providers/devices/{deviceId}/purchases/{marketplaceItemId}/install |
| List provider listings | GET | /marketplace/providers/listings |
| Get provider listing | GET | /marketplace/providers/listings/{marketplaceId} |