Build a custom store with the headless APIs
From auth and shop discovery through cart, shipping, payment, and order creation — with
full JavaScript and Python implementations.
Build a custom store with Droplinked headless APIs
Learn how to build a fully custom store directly on your platform or app using Droplinked’s headless APIs for seamless inventory and checkout management.Prerequisites
Before you begin, you’ll need:- A Droplinked account — sign up at droplinked.com
- An API key — your authentication credential for API requests
- A shop name — your unique shop identifier
- Basic development knowledge (or a developer to help implement)
Get your API key
Log into the merchant dashboard
Go to droplinked.com and sign in.
Base configuration
Example — curl
Step 1 — Fetch shop information
Get your shop details to display branding on the storefront.Step 2 — List your products
Fetch all products to populate the catalog.Step 3 — Get product details (and the SKU)
When a customer clicks a product, fetch the complete details including SKUs.Product vs SKU
- A product is the general item (e.g. “Blue T-Shirt”)
- A SKU is a specific variant with its own price (e.g. “Blue T-Shirt — Size Large — $29.99”)
- A product can have many SKUs (sizes, colors, etc.)
- You add the SKU to the cart, not the product
Step 4 — Create a cart
Step 5 — Add product to cart
Add items using the SKU ID (not the product ID).m2m_data for made-to-measure / customized products:
Update or remove items
| Method | Endpoint | Purpose |
|---|---|---|
GET | /v2/carts/{cartId} | View cart contents |
PATCH | /v2/carts/{cartId}/products/{skuId} | Update quantity (body: { "quantity": 3 }) |
DELETE | /v2/carts/{cartId}/products/{skuId} | Remove an item |
Step 6 — Checkout — shipping, payment, order
Get shipping rates
Select a rate
List payment methods
Create the order
Complete reference implementations
Best practices
1. Error handling
Wrap every API call intry / catch (or its language equivalent) and surface user-friendly
messages:
2. Cart persistence
Store the cart ID so customers can resume:3. Loading states
Show loading indicators while fetching data — the public endpoints can take a few hundred milliseconds on first load.4. Inventory checking
Always confirm a SKU is available before adding to cart:5. Price formatting
Use the platform’sIntl.NumberFormat and the shop’s currency:
Troubleshooting
| Symptom | Likely cause |
|---|---|
API key not configured | Wrong header name (must be exactly x-droplinked-api-key) or revoked key |
Cart ID not found | Cart expired — check expiredAt; create a new cart |
Product not found | Product ID wrong, not published, or doesn’t belong to your shop |
| No products returned | Shop name wrong, products unpublished, or API key lacks access |
| Can’t add to cart | Using the product ID instead of the SKU ID; SKU out of stock; cart expired |
Endpoint quick reference
| Endpoint | Method | Purpose |
|---|---|---|
/shops/v2/public/name/:name | GET | Get shop info |
/product-v2/public/shop/:shopName | GET | List products |
/product-v2/public/:id | GET | Product details + SKU |
/v2/carts | POST | Create cart |
/v2/carts/:cartId | GET | Cart contents |
/v2/carts/:cartId/products | POST | Add to cart |
/v2/carts/:cartId/products/:skuId | PATCH | Update quantity |
/v2/carts/:cartId/products/:skuId | DELETE | Remove from cart |
/v2/carts/:cartId/shipping | GET | Get shipping rates |
/v2/carts/:cartId/shipping | POST | Select shipping |
/v2/carts/:cartId/payment-methods | GET | Get payment methods |
/v2/orders | POST | Create order |
Related
- API overview — request shape, auth, base URL
- Use cases — endpoint reference by surface
- Web3 shop tutorial — alternative tutorial-style walkthrough
- Live API Reference — interactive OpenAPI browser