Skip to main content
RapidDev - Software Development Agency
lovable-integrationsEdge Function Integration

How to Integrate Lovable with ShipStation

Integrate ShipStation with your Lovable app using a Supabase Edge Function that authenticates with ShipStation's REST API via HTTP Basic auth (API key and secret). Store your ShipStation credentials in Cloud → Secrets, then build multi-channel order management and shipping dashboards that aggregate orders from all your sales channels, compare carrier rates, and create shipments — all from a custom Lovable interface without switching between ShipStation and your other tools.

What you'll learn

  • How to generate ShipStation API credentials and configure Basic auth for your Lovable Edge Function
  • How to store ShipStation credentials securely in Lovable's Cloud → Secrets panel
  • How to write a Deno Edge Function that handles ShipStation Basic auth and proxies API requests
  • How to build a multi-channel order dashboard that shows orders from all ShipStation-connected stores
  • How to implement shipment creation and carrier rate comparison in a Lovable-built shipping management UI
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Intermediate13 min read45 minutesE-commerceMarch 2026RapidDev Engineering Team
TL;DR

Integrate ShipStation with your Lovable app using a Supabase Edge Function that authenticates with ShipStation's REST API via HTTP Basic auth (API key and secret). Store your ShipStation credentials in Cloud → Secrets, then build multi-channel order management and shipping dashboards that aggregate orders from all your sales channels, compare carrier rates, and create shipments — all from a custom Lovable interface without switching between ShipStation and your other tools.

Build a custom shipping management dashboard with ShipStation in Lovable

ShipStation's key value proposition is multi-channel order aggregation — it pulls orders from Shopify, Amazon, eBay, Etsy, WooCommerce, BigCommerce, and 100+ other platforms into a single normalized view, then lets you create shipments across FedEx, UPS, USPS, DHL, and other carriers while comparing rates. If your business sells across multiple channels, ShipStation eliminates the need to log into each platform separately to check orders and print labels.

Building a custom Lovable interface on top of ShipStation lets you tailor the workflow to your specific operation. Instead of ShipStation's general-purpose interface, you can build a focused view that shows only the data your team needs — for example, a picking dashboard that displays today's orders sorted by warehouse location, or a shipping console that shows only orders ready to ship with pre-filled carrier preferences based on weight and destination.

ShipStation's API uses HTTP Basic authentication where your API key and secret are base64-encoded as the Authorization header. This must happen server-side — base64 encoding is trivially reversible, so the credentials are as sensitive as plaintext. Your Lovable Edge Function handles this encoding and proxies requests to ShipStation's API. The guide covers credentials setup, Edge Function deployment, and three core dashboard components: order management, shipment creation, and carrier rate lookup.

Integration method

Edge Function Integration

ShipStation's REST API uses HTTP Basic authentication with a base64-encoded API key and secret. A Supabase Edge Function in your Lovable project handles this authentication and proxies all ShipStation API calls for order retrieval, shipment creation, carrier rate comparison, and label generation. Your React frontend calls only your Edge Function URL, keeping ShipStation credentials encrypted in Cloud → Secrets.

Prerequisites

  • A Lovable account with an active project
  • A ShipStation account with at least one connected sales channel or store
  • ShipStation API credentials — generated from Settings → Account → API Settings in ShipStation
  • A ShipStation plan that includes API access (Starter plan and above include API access)
  • At least one carrier account configured in ShipStation for rate comparison and label creation

Step-by-step guide

1

Generate ShipStation API credentials

Log in to your ShipStation account at app.shipstation.com. Click the gear icon in the top right to open Settings. In the left sidebar, navigate to Account → API Settings. If you do not see API Settings, your account level may not include API access — check your plan or contact ShipStation support. On the API Settings page, click 'Generate New API Keys.' ShipStation creates two values: an API Key and an API Secret. Both are displayed only once — copy them to a secure location immediately. ShipStation uses HTTP Basic authentication, which means your API key and secret are combined into a base64-encoded string formatted as key:secret and sent as the Authorization: Basic header on every request. This is done by your Edge Function server-side, not by your React frontend. The API endpoint base URL is https://ssapi.shipstation.com — all endpoints are relative to this base. ShipStation's API rate limit is 40 requests per 30 seconds per API key — for high-volume operations, you may need to implement request queuing in your Edge Function.

Pro tip: ShipStation API Keys are account-level — they give full API access to your entire ShipStation account including all connected stores, carriers, and shipment history. Treat them with the same security as a master password.

Expected result: You have a ShipStation API Key and API Secret copied and ready to store as Lovable secrets.

2

Store ShipStation credentials in Cloud → Secrets

In Lovable, open the Cloud tab by clicking the '+' icon next to the Preview panel, then navigate to the Secrets section. Click 'Add Secret' and create two secrets. Add SHIPSTATION_API_KEY with your ShipStation API Key as the value. Add SHIPSTATION_API_SECRET with your API Secret as the value. Your Edge Function will combine these using btoa(key + ':' + secret) to generate the base64-encoded Basic auth credential at request time — this calculation happens server-side so neither the individual values nor the combined encoded credential ever appears in browser code. Lovable encrypts both secrets at rest and exposes them only to Edge Functions through Deno.env.get(). The platform's active security monitoring blocks approximately 1,200 hardcoded keys per day, providing an additional safety layer beyond the secrets storage itself.

Pro tip: Keep your ShipStation API key and secret separate in two secrets rather than pre-combining them. This makes it easier to verify each credential independently and rotate them if needed without manually recomputing the base64 combination.

Expected result: SHIPSTATION_API_KEY and SHIPSTATION_API_SECRET appear in your Cloud → Secrets panel.

3

Deploy the ShipStation proxy Edge Function

Use Lovable's chat to generate and deploy the ShipStation proxy Edge Function. This function accepts POST requests from your frontend containing the ShipStation endpoint path, the HTTP method, and an optional request body. It reads your API Key and Secret from Deno environment variables, computes the base64-encoded Basic auth header using btoa(), and forwards the request to ShipStation's API at https://ssapi.shipstation.com. The function handles both GET requests (for order lists, shipment lists, carrier lists) and POST requests (for creating shipments, updating orders). ShipStation uses query parameters for GET requests — your frontend passes these as part of the endpoint string (e.g., /orders?orderStatus=awaiting_shipment). The Edge Function appends them to the ShipStation URL unchanged.

Lovable Prompt

Create a Supabase Edge Function at supabase/functions/shipstation-proxy/index.ts. It should: 1) Read SHIPSTATION_API_KEY and SHIPSTATION_API_SECRET from Deno environment. 2) Compute Basic auth header as 'Basic ' + btoa(key + ':' + secret). 3) Accept POST requests with JSON body containing 'endpoint' (e.g. '/orders'), 'method' (GET/POST/PUT, defaults to GET), and optional 'body'. 4) Make the request to 'https://ssapi.shipstation.com' + endpoint with Authorization: Basic header. 5) Return the ShipStation response JSON. Include CORS headers.

Paste this in Lovable chat

supabase/functions/shipstation-proxy/index.ts
1import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
2
3const corsHeaders = {
4 "Access-Control-Allow-Origin": "*",
5 "Access-Control-Allow-Headers": "authorization, x-client-info, apikey, content-type",
6};
7
8serve(async (req) => {
9 if (req.method === "OPTIONS") {
10 return new Response("ok", { headers: corsHeaders });
11 }
12
13 try {
14 const apiKey = Deno.env.get("SHIPSTATION_API_KEY");
15 const apiSecret = Deno.env.get("SHIPSTATION_API_SECRET");
16
17 if (!apiKey || !apiSecret) {
18 throw new Error("ShipStation credentials not configured in Secrets");
19 }
20
21 const credentials = btoa(`${apiKey}:${apiSecret}`);
22 const { endpoint, method = "GET", body } = await req.json();
23
24 if (!endpoint) throw new Error("'endpoint' is required");
25
26 const url = `https://ssapi.shipstation.com${endpoint}`;
27
28 const fetchOptions: RequestInit = {
29 method,
30 headers: {
31 Authorization: `Basic ${credentials}`,
32 "Content-Type": "application/json",
33 Accept: "application/json",
34 },
35 };
36
37 if (body && method !== "GET") {
38 fetchOptions.body = JSON.stringify(body);
39 }
40
41 const response = await fetch(url, fetchOptions);
42 const data = await response.json();
43
44 return new Response(JSON.stringify(data), {
45 headers: { ...corsHeaders, "Content-Type": "application/json" },
46 status: response.ok ? 200 : response.status,
47 });
48 } catch (error) {
49 return new Response(
50 JSON.stringify({ error: error.message }),
51 { headers: { ...corsHeaders, "Content-Type": "application/json" }, status: 500 }
52 );
53 }
54});

Pro tip: ShipStation's API returns paginated results with a total count in the response body. When building order lists, check the 'total' field in the response and implement page navigation in your frontend for stores with more than 50-100 orders.

Expected result: The shipstation-proxy Edge Function is deployed. Calling /functions/v1/shipstation-proxy from your frontend returns ShipStation API data.

4

Build the multi-channel order management view

With the proxy deployed, build the order management dashboard that is the core of your ShipStation integration. ShipStation's orders endpoint returns normalized order data regardless of which sales channel the order came from — each order object includes the store name, order number, customer info, shipping address, line items, and order status. The status field uses ShipStation's standardized codes: awaiting_payment, awaiting_shipment, shipped, cancelled, on_hold. For most shipping operations, you filter to awaiting_shipment to show only orders ready to process. ShipStation also provides an order tags system and custom fields for organizing orders — these appear in the API response and can be used for filtering in your dashboard. The orders endpoint supports numerous filter parameters including storeId (to filter by sales channel), orderStatus, customerEmail, orderNumber, and date ranges — expose the most useful ones as filter controls in your Lovable interface.

Lovable Prompt

Build an OrderManagement component that calls /functions/v1/shipstation-proxy with endpoint '/orders?orderStatus=awaiting_shipment&pageSize=50'. Display a summary header showing count of awaiting shipment orders. Below, show a table of orders with columns: checkbox for multi-select, order number, store (from advancedOptions.storeId), customer name, order date, items summary (first item name + count), order total, and weight. Add a status filter row with buttons for Awaiting Shipment, On Hold, Shipped. Add a 'Select All' checkbox. When orders are selected, show a floating action bar with 'Create Labels' and 'Export to CSV' buttons.

Paste this in Lovable chat

Pro tip: ShipStation's order response includes an advancedOptions.storeId field, but the store name requires a separate call to GET /stores to build a storeId-to-name lookup table. Fetch and cache the stores list on component mount to avoid repeated API calls.

Expected result: Your dashboard displays a paginated list of ShipStation orders from all connected channels, filterable by status.

5

Implement carrier rate comparison and label creation

The shipping label workflow in ShipStation's API involves two steps: first get rate quotes from available carriers, then create the label with the chosen carrier and service. The getrates endpoint accepts a structured request with the from address (your warehouse), the to address (from the order), the package weight and dimensions, and returns an array of available services across all your configured carriers with rates, estimated delivery days, and service names. After the customer (or you) selects a rate, call the createlabelfororder endpoint with the orderId, carrierCode, serviceCode, and package details — ShipStation creates the label, marks the order as shipped, and returns a label download URL. Store the label URL and tracking number in your Supabase database so you can access them later. For teams with a consistent shipping profile (same carrier, same service, same box sizes every day), RapidDev's team can help configure default rule automation that pre-fills carrier selections based on order weight ranges.

Lovable Prompt

Add a CreateShipment panel that slides in when an order is clicked. The panel shows the order's ship-to address and item weights. Add a 'Compare Rates' button that calls /functions/v1/shipstation-proxy with POST to endpoint '/shipments/getrates' with body: { carrierCode: null, serviceCode: null, packageCode: 'package', fromPostalCode: '90210', toState: order.shipTo.state, toCountry: order.shipTo.country, toPostalCode: order.shipTo.postalCode, weight: { value: order.weight.value, units: order.weight.units }, dimensions: { length: 12, width: 8, height: 6, units: 'inches' } }. Display returned rates as radio button cards showing carrier name, service, delivery time, and price. After selecting a rate, show a 'Create Label' button that POSTs to '/orders/createlabelfororder' with the orderId, selected carrierCode, and serviceCode. Display the returned labelUrl for download.

Paste this in Lovable chat

Pro tip: ShipStation rate comparison includes residential delivery surcharges by default for USPS and FedEx. If your warehouse address is commercial, ensure your getrates request includes confirmation: 'none' and properly sets the from address to avoid inflated rate quotes.

Expected result: Clicking an order opens a rate comparison panel. Selecting a carrier and clicking Create Label generates a downloadable shipping label and marks the order as shipped in ShipStation.

Common use cases

Multi-channel order management dashboard

Build a unified order view that aggregates orders from all your ShipStation-connected sales channels (Shopify, Etsy, Amazon, etc.) in one place, with filtering by order status, store, and date — eliminating the need to check each platform separately for new orders.

Lovable Prompt

Build an order management dashboard that calls /functions/v1/shipstation-proxy with endpoint '/orders?orderStatus=awaiting_shipment&pageSize=50&page=1'. Display orders in a sortable table with columns: order number, store/channel name, customer name, order date, item count, order total, and status. Add filter buttons for status (Awaiting Shipment, Shipped, Cancelled). Add a date range picker. Show a badge count for 'awaiting shipment' orders at the top of the page.

Copy this prompt to try it in Lovable

Shipping label creation and carrier rate comparison

Build a shipment creation form where you select an order, choose a carrier service, enter package dimensions, and generate a label — with real-time carrier rate quotes so you always choose the most cost-effective option for each shipment.

Lovable Prompt

Build a shipment creation panel. When an order is selected from the table, show a 'Create Shipment' panel. First, call /functions/v1/shipstation-proxy to GET /carriers to show available carriers. Then add a 'Get Rates' button that POSTs to /shipments/getrates via the proxy with the order's ship-to address, from-address, and package weight/dimensions. Display returned rates as a selectable list showing carrier, service name, days in transit, and cost. When a rate is selected, allow clicking 'Create Label' which POSTs to /orders/createlabelfororder.

Copy this prompt to try it in Lovable

Fulfillment status tracking and customer notifications

Build an internal status board that shows all recent shipments with their current carrier tracking status, and identifies any shipments that are delayed, returned, or have carrier exceptions — helping your team proactively contact affected customers.

Lovable Prompt

Build a shipment tracking dashboard that calls /functions/v1/shipstation-proxy with endpoint '/shipments?createDateStart=7daysago&pageSize=100'. Show a table of shipments with: order number, recipient, carrier, tracking number, ship date, and current status. Highlight rows in yellow for shipments more than 5 days old without delivery confirmation, and red for shipments with 'exception' status. For highlighted rows, show a 'Notify Customer' button.

Copy this prompt to try it in Lovable

Troubleshooting

Edge Function returns 401 Unauthorized for all ShipStation requests

Cause: The Basic auth header is being constructed incorrectly, or the API Key and Secret are reversed in the btoa() call.

Solution: Verify in Cloud → Secrets that SHIPSTATION_API_KEY is the API Key (not the Secret) and SHIPSTATION_API_SECRET is the Secret. In your Edge Function, the btoa() call must be btoa(apiKey + ':' + apiSecret) — the key comes first, then a colon, then the secret. Regenerate your credentials in ShipStation under Settings → Account → API Settings if you are unsure which is which.

typescript
1// Correct Basic auth construction
2const credentials = btoa(`${apiKey}:${apiSecret}`);
3// Result should be Authorization: Basic {base64string}

Orders are missing from the list — orders from some stores do not appear

Cause: ShipStation's orders endpoint returns up to 500 orders per page and defaults to the first page. With high order volume or many pages, some orders may be on later pages not yet fetched.

Solution: Check the response's 'total' field and compare to 'pages' and 'page' to determine if there are more pages. Implement pagination in your frontend that loads additional pages when the user scrolls to the bottom or clicks 'Load More.' For initial dashboard load, the first 50-100 orders are usually sufficient to show pending work.

getrates returns empty array or 'No rates available' for some orders

Cause: The from or to address has a formatting issue, the package weight is missing or zero, or none of your configured ShipStation carriers service the destination.

Solution: Verify the weight value is greater than 0 (ShipStation requires a valid weight for rate calculation). Check that the toCountry code is a valid 2-letter ISO country code and toPostalCode matches the country's postal format. If the destination is international, verify your configured carriers support international shipping. Test with a domestic US-to-US shipment first to confirm the carrier connection is working before troubleshooting international rate issues.

ShipStation rate limit hit — API returns 429 after many quick requests

Cause: ShipStation limits the API to 40 requests per 30-second window. Bulk operations like getting rates for 50 orders simultaneously exceed this limit.

Solution: Implement request queuing that processes a maximum of 5-10 rate requests per second with delays between batches. For bulk label creation, process one order at a time with a 1-second delay, rather than sending all requests simultaneously. Display a progress indicator in your UI so users understand batch operations are running.

typescript
1// Throttled batch processing
2async function processWithThrottle<T>(
3 items: T[],
4 processor: (item: T) => Promise<void>,
5 delayMs = 1000
6) {
7 for (const item of items) {
8 await processor(item);
9 await new Promise(r => setTimeout(r, delayMs));
10 }
11}

Best practices

  • Use ShipStation's order tags and custom fields to annotate orders with processing information (e.g., 'fragile', 'gift wrap', 'priority customer') that your Lovable dashboard can use for sorting and filtering.
  • Store the ShipStation storeId-to-store-name mapping in your Supabase database on first load and refresh it daily rather than calling GET /stores on every order list refresh.
  • Implement optimistic UI updates for shipment creation — mark the order as 'processing' in your local state immediately when the user clicks 'Create Label,' rather than waiting for the API response to update the view.
  • Cache carrier and service information (from GET /carriers and GET /carriers/{code}/services) locally in Supabase to avoid repeated API calls when showing the rate comparison dropdown.
  • Use ShipStation's webhook system to push order status updates to a Lovable Edge Function rather than polling the orders endpoint repeatedly, reducing API calls and providing real-time status updates.
  • Always store generated label URLs in your Supabase database immediately after creation — ShipStation label URLs may expire and you need a persistent copy of the label file or its URL.
  • Test label creation with ShipStation's test/sandbox mode or by creating void-able test labels before going live in production to avoid generating real carrier shipments accidentally.
  • Configure ShipStation automation rules for your most common shipment profiles (e.g., 'if weight under 1lb, use USPS First Class') to pre-fill carrier selections in your Lovable dashboard, reducing click count per shipment.

Alternatives

Frequently asked questions

Does the ShipStation API include all the features from the ShipStation web app?

The ShipStation REST API covers orders, shipments, carriers, rates, customers, warehouses, and stores — the core features needed for a shipping management dashboard. Some advanced features like automation rules, custom reports, and user management are not exposed via the REST API and must be configured directly in the ShipStation web app. Plan to use the ShipStation web app for configuration and your Lovable dashboard for day-to-day operations.

Can I use ShipStation's API to print labels directly from my Lovable app?

Yes. The createlabelfororder endpoint returns a labelUrl pointing to a PDF or PNG of the label. Your Lovable app can display this URL as a download link, open it in a new tab, or trigger a print dialog using window.print() after loading the label in an iframe. For bulk printing workflows, generate labels in sequence and provide a combined download option. Thermal printer integration (Zebra, Dymo) requires the ZPL format which ShipStation can provide on supported services.

Will my existing ShipStation store connections and automation rules still work after adding the API integration?

Yes. The ShipStation API operates alongside the existing ShipStation web app — API-created shipments appear in the ShipStation dashboard, and web app-configured automation rules still apply to orders fetched via API. Your existing store connections (Shopify, Amazon, etc.) continue syncing orders normally. The API integration adds a custom frontend on top of ShipStation without changing its underlying configuration or functionality.

How do I handle carrier tracking updates in my Lovable app?

ShipStation provides tracking numbers in the shipment API response. For live tracking status, you have two options: set up ShipStation webhooks (Settings → Integrations → Webhooks) to push tracking updates to a Lovable Edge Function, or periodically poll the GET /shipments endpoint filtered by recent ship dates to check tracking status. Webhooks are more efficient for production — configure the SHIP_NOTIFY event to trigger when a shipment's tracking status changes.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.