Connect your FlutterFlow app to existing e-commerce backends like Shopify and WooCommerce via their REST APIs. Route all API calls through Cloud Functions to keep access tokens server-side. Set up a FlutterFlow API Group for product fetching, cart operations, and order creation. Map external product data to your FlutterFlow UI components and handle webhooks for order status synchronization.
Connecting FlutterFlow to External E-Commerce Platforms
Many businesses already run their store on Shopify, WooCommerce, or BigCommerce. Instead of rebuilding everything, this tutorial connects your FlutterFlow mobile app to your existing e-commerce backend. Users browse products, manage their cart, and checkout — all synced with your live store. Cloud Functions act as a secure proxy to keep API credentials safe.
Prerequisites
- A FlutterFlow project with Firebase authentication enabled
- A Shopify store with Admin API access (or WooCommerce with REST API consumer keys)
- Cloud Functions enabled on the Firebase Blaze plan
- Basic understanding of REST APIs and JSON data structures
Step-by-step guide
Create Cloud Functions as a secure API proxy for your e-commerce platform
Create Cloud Functions as a secure API proxy for your e-commerce platform
Create a set of Cloud Functions that act as a proxy between FlutterFlow and your e-commerce platform. For Shopify, use the Admin API with your access token stored in Firebase Functions config. Create three endpoints: getProducts (fetches products with pagination), getProduct (fetches a single product by ID), and createOrder (creates a new order). Each function adds the authorization header server-side so the access token never reaches the client. For WooCommerce, use the REST API with consumer key and secret in the config. The function pattern is the same — receive parameters from the client, make the authenticated API call, and return the formatted response.
1const functions = require('firebase-functions');2const admin = require('firebase-admin');3const fetch = require('node-fetch');4admin.initializeApp();56const SHOPIFY_STORE = functions.config().shopify.store;7const SHOPIFY_TOKEN = functions.config().shopify.token;8const BASE_URL = `https://${SHOPIFY_STORE}.myshopify.com/admin/api/2024-01`;910// GET products with pagination11exports.getProducts = functions.https.onCall(async (data) => {12 const { page = 1, limit = 20, collection } = data;13 let url = `${BASE_URL}/products.json?limit=${limit}`;14 if (collection) url += `&collection_id=${collection}`;1516 const res = await fetch(url, {17 headers: { 'X-Shopify-Access-Token': SHOPIFY_TOKEN },18 });19 const json = await res.json();20 return { products: json.products };21});2223// GET single product24exports.getProduct = functions.https.onCall(async (data) => {25 const res = await fetch(26 `${BASE_URL}/products/${data.productId}.json`,27 { headers: { 'X-Shopify-Access-Token': SHOPIFY_TOKEN } }28 );29 const json = await res.json();30 return { product: json.product };31});3233// POST create order34exports.createOrder = functions.https.onCall(async (data, ctx) => {35 if (!ctx.auth) throw new functions.https.HttpsError(36 'unauthenticated', 'Login required');3738 const res = await fetch(`${BASE_URL}/orders.json`, {39 method: 'POST',40 headers: {41 'X-Shopify-Access-Token': SHOPIFY_TOKEN,42 'Content-Type': 'application/json',43 },44 body: JSON.stringify({ order: data.order }),45 });46 const json = await res.json();47 return { order: json.order };48});Expected result: Cloud Functions securely proxy requests to your Shopify or WooCommerce store, keeping API credentials on the server.
Set up the FlutterFlow API Group for product endpoints
Set up the FlutterFlow API Group for product endpoints
In FlutterFlow, go to API Calls and create a new API Group named 'ECommerceAPI'. Add three API calls that map to your Cloud Functions: (1) GetProducts — calls the getProducts Cloud Function, returns a list of product objects. Map the response JSON paths for product id, title, description, images array, variants (with price and inventory), and tags. (2) GetProduct — calls getProduct with a productId parameter, returns a single product with full details. (3) CreateOrder — calls createOrder with the order payload. For each API call, define the response structure in FlutterFlow so you can bind product fields to widgets. Test each call in the API testing panel to verify the response mapping.
Expected result: Three API calls are configured in FlutterFlow, tested, and returning properly mapped product and order data from your e-commerce platform.
Build the product listing and detail pages
Build the product listing and detail pages
Create a ProductCatalog page. Add a ListView bound to the GetProducts API call. Each product card is a Container with the product's first image (from images[0].src), title Text, price Text (from variants[0].price formatted as currency), and an availability indicator (green dot if inventory > 0). Add ChoiceChips at the top for collection/category filtering — pass the selected collection ID to the API call. On card tap, navigate to a ProductDetail page with the productId. On the detail page, add a PageView for product images, the full description, variant selectors (DropDowns for size and color mapped from the product's options array), the price, and an Add to Cart button.
Expected result: Users browse products from your live e-commerce store, filter by category, and view detailed product pages with image galleries and variant selectors.
Implement the cart and checkout flow with order creation
Implement the cart and checkout flow with order creation
Use App State (persisted) to store the cart as a JSON list of objects: [{productId, variantId, title, price, quantity, imageUrl}]. The Add to Cart button appends an item to this list (or increments quantity if the variant already exists). Create a Cart page with a ListView bound to the App State cart list. Each item shows the product image, title, variant info, quantity with +/- buttons, line total, and a remove button. Show the subtotal, tax (if applicable), and total at the bottom. On Checkout tap, construct the order payload matching the Shopify/WooCommerce order format and call the CreateOrder Cloud Function. On success, clear the cart App State and navigate to an OrderConfirmation page showing the order number and status.
Expected result: Users add products to a persistent cart, adjust quantities, and complete checkout which creates a real order on the e-commerce platform.
Handle webhooks for order status updates and inventory sync
Handle webhooks for order status updates and inventory sync
Create an HTTP-triggered Cloud Function that receives webhooks from your e-commerce platform. For Shopify, configure webhooks in Shopify Admin → Settings → Notifications → Webhooks for events: orders/updated, products/update, inventory_levels/update. The webhook handler: (1) Verifies the webhook signature (HMAC) for security. (2) For order status changes, updates a local Firestore `orders` collection with the new status so your FlutterFlow app can display order tracking without calling the external API each time. (3) For inventory updates, optionally cache inventory levels in Firestore for faster product display. Register the webhook URL (your Cloud Function's HTTPS URL) in your e-commerce platform's webhook settings.
Expected result: Order status changes and inventory updates from your e-commerce platform automatically sync to Firestore via webhooks, keeping your FlutterFlow app data current.
Complete working example
1// functions/index.js — Shopify Integration2const functions = require('firebase-functions');3const admin = require('firebase-admin');4const fetch = require('node-fetch');5const crypto = require('crypto');6admin.initializeApp();78const STORE = functions.config().shopify.store;9const TOKEN = functions.config().shopify.token;10const WEBHOOK_SECRET = functions.config().shopify.webhook_secret;11const API = `https://${STORE}.myshopify.com/admin/api/2024-01`;1213// Fetch products14exports.getProducts = functions.https.onCall(async (data) => {15 const { limit = 20, collectionId } = data;16 let url = `${API}/products.json?limit=${limit}&status=active`;17 if (collectionId) url += `&collection_id=${collectionId}`;18 const res = await fetch(url, {19 headers: { 'X-Shopify-Access-Token': TOKEN },20 });21 return await res.json();22});2324// Fetch single product25exports.getProduct = functions.https.onCall(async (data) => {26 const res = await fetch(`${API}/products/${data.productId}.json`, {27 headers: { 'X-Shopify-Access-Token': TOKEN },28 });29 return await res.json();30});3132// Create order33exports.createOrder = functions.https.onCall(async (data, ctx) => {34 if (!ctx.auth) throw new functions.https.HttpsError(35 'unauthenticated', 'Login required');36 const { lineItems, email, shippingAddress } = data;37 const order = {38 line_items: lineItems.map(i => ({39 variant_id: i.variantId,40 quantity: i.quantity,41 })),42 email,43 shipping_address: shippingAddress,44 };45 const res = await fetch(`${API}/orders.json`, {46 method: 'POST',47 headers: {48 'X-Shopify-Access-Token': TOKEN,49 'Content-Type': 'application/json',50 },51 body: JSON.stringify({ order }),52 });53 const result = await res.json();54 // Cache order in Firestore55 await admin.firestore().collection('orders').doc(56 String(result.order.id)).set({57 userId: ctx.auth.uid,58 shopifyOrderId: result.order.id,59 orderNumber: result.order.order_number,60 status: result.order.financial_status,61 total: result.order.total_price,62 createdAt: admin.firestore.FieldValue.serverTimestamp(),63 });64 return result;65});6667// Webhook handler for order updates68exports.shopifyWebhook = functions.https.onRequest(async (req, res) => {69 // Verify HMAC signature70 const hmac = req.headers['x-shopify-hmac-sha256'];71 const hash = crypto.createHmac('sha256', WEBHOOK_SECRET)72 .update(req.rawBody).digest('base64');73 if (hmac !== hash) return res.status(401).send('Invalid');7475 const topic = req.headers['x-shopify-topic'];76 const body = req.body;7778 if (topic === 'orders/updated') {79 await admin.firestore().collection('orders')80 .doc(String(body.id)).update({81 status: body.financial_status,82 fulfillment: body.fulfillment_status || 'unfulfilled',83 });84 }85 res.status(200).send('OK');86});Common mistakes
Why it's a problem: Calling Shopify Admin API directly from the FlutterFlow client
How to avoid: Route ALL e-commerce API calls through Cloud Functions. The Cloud Function adds the authorization header server-side, and the access token never leaves your server.
Why it's a problem: Not verifying webhook signatures from the e-commerce platform
How to avoid: Always verify the HMAC signature in the webhook handler using the shared secret. Reject requests with invalid or missing signatures.
Why it's a problem: Fetching full product data from the external API on every page load
How to avoid: Cache product data in Firestore using webhooks to keep it fresh. Serve products from Firestore for listing pages and only call the external API for real-time inventory checks during checkout.
Best practices
- Route all e-commerce API calls through Cloud Functions to keep credentials server-side
- Cache product data in Firestore and keep it fresh via webhooks for faster page loads
- Verify webhook HMAC signatures to prevent spoofed requests
- Use App State (persisted) for the cart so it survives navigation and app restarts
- Map API response fields carefully in FlutterFlow's API Group to avoid null errors on missing fields
- Handle variant selection (size, color) with DropDowns mapped from the product's options array
- Add loading states and error handling for API calls that depend on external service availability
Still stuck?
Copy one of these prompts to get a personalized, step-by-step explanation.
I'm integrating my FlutterFlow app with Shopify's Admin API. I need Cloud Functions as a secure proxy for fetching products, creating orders, and handling webhooks for order status updates. Also need a FlutterFlow API Group setup and a cart using App State. Show me the Cloud Function code and FlutterFlow API configuration.
Create a product catalog page with a ListView bound to an API call that returns products from an external e-commerce platform. Each product card shows an image, title, price, and availability. On tap, navigate to a detail page with image gallery and variant selector.
Frequently asked questions
Can I connect to both Shopify and WooCommerce in the same app?
Yes. Create separate Cloud Function sets for each platform and a platform selector in the admin settings. Use the same FlutterFlow UI components but switch the API calls based on which platform the merchant has configured.
How do I handle Shopify API rate limits?
Shopify allows 40 requests per app per store, with a leak rate of 2 requests per second. Cache product data in Firestore and serve from cache for listing pages. Only call the live API for real-time operations like inventory checks and order creation.
Can I use Shopify's Storefront API instead of the Admin API?
Yes. The Storefront API is designed for customer-facing apps with more limited permissions. It supports product browsing and cart/checkout operations but not order management. It is a better fit if you only need read access and checkout.
How do I sync customer accounts between FlutterFlow and Shopify?
On user registration in FlutterFlow, create a matching Shopify customer via the Admin API. Store the Shopify customer ID on the user's Firestore document. Use this ID when creating orders to associate them with the correct Shopify customer.
What happens if the external API is down when a user tries to checkout?
Show a user-friendly error message and offer to save their cart for later. Implement retry logic in the Cloud Function with exponential backoff. For critical operations, consider a queue system that retries failed orders.
Can RapidDev help integrate multiple e-commerce platforms?
Yes. RapidDev can build a unified commerce layer that connects Shopify, WooCommerce, BigCommerce, and custom backends through a single API, with inventory synchronization, order management, and multi-channel fulfillment.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation