
Traditional e-commerce platforms often limit how you can design and manage your store. Templates, fixed workflows, and rigid integrations can slow you down and reduce flexibility.
droplinked Headless APIs solve this.
By separating the frontend (what your customers see) from the backend (where inventory, orders, and payments are handled), droplinked gives you the freedom to:
This guide is designed for anyone who needs a custom commerce experience:
With droplinked Headless APIs, the "walled garden" is gone. Here is what you can build today:
Ready to see droplinked Headless APIs in action? We have created a full API Cookbook, complete with step-by-step tutorials and code examples.
Follow the guide below to build a headless store that fits your platform or app perfectly:
👉 Read the Guide: Building a Custom Store with droplinked Headless APIs
droplinked Headless APIs give you the flexibility, control, and scalability to create a seamless, fully custom commerce experience, without the limits of traditional platforms.
Before you begin, you'll need:
All droplinked API requests use:
code Code
downloadcontent_copy
expand_less
Every API request requires your API key in the headers:
code Code
downloadcontent_copy
expand_less
x-droplinked-api-key: YOUR_API_KEY_HERE
Content-Type: application/json
Example using cURL:
code Bash
downloadcontent_copy
expand_less
curl -X GET "https://api.io.droplinked.com/shops/v2/public/name/lumen" \
-H "x-droplinked-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Get your shop details to display your branding.
API Request:
code Code
downloadcontent_copy
expand_less
GET https://api.io.droplinked.com/shops/v2/public/name/{shopName}
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"_id": "69103f6e530855f4b75c4da2",
"id": "69103f6e530855f4b75c4da2",
"name": "Lumen",
"url": "lumen",
"description": "We believe light is an art form. We curate sculptural lamps and architectural lighting designed to transform your space.",
"currency": {
"abbreviation": "USD",
"symbol": "$",
"conversionRateToUSD": 1
}
}
What to do with this data:
Fetch all products to create your product catalog.
API Request:
code Code
downloadcontent_copy
expand_less
GET https://api.io.droplinked.com/product-v2/public/shop/{shopName}
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"data": [
{
"id": "6911a2390b1483ce323968e0",
"title": "The Altar Table Lamp",
"slug": "the-altar-table-lamp-f11e0",
"type": "physical",
"status": "published",
"images": [
{
"original": "https://upload-file-droplinked.s3.amazonaws.com/28cefe88...png",
"thumbnail": "https://upload-file-droplinked.s3.amazonaws.com/28cefe88..._small.png",
"alt": "031_Output_Lamp.png"
}
],
"thumbnail": "https://upload-file-droplinked.s3.amazonaws.com/28cefe88..._small.png",
"isPurchasable": true,
"lowestPrice": 899
}
],
"currentPage": 1,
"totalPages": 1,
"totalDocuments": 10
}
Important Note: The lowestPrice shown here is for display only. To add items to cart, you need the SKU ID from the product details.
When a customer clicks on a product, fetch the complete details including the SKU (Stock Keeping Unit) which contains the actual price and inventory.
API Request:
code Code
downloadcontent_copy
expand_less
GET https://api.io.droplinked.com/product-v2/public/{productId}
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"id": "6911a2390b1483ce323968e0",
"title": "The Altar Table Lamp",
"description": "A stunning sculptural lamp...",
"images": [
{
"original": "https://upload-file-droplinked.s3.amazonaws.com/...",
"thumbnail": "https://upload-file-droplinked.s3.amazonaws.com/..._small.png"
}
],
"skus": [
{
"id": "sku_lamp_abc123",
"price": 899,
"currency": "USD",
"inventory": {
"quantity": 10,
"available": true
}
}
]
}
Understanding SKUs:
When a customer wants to add their first item, create a cart.
API Request:
code Code
downloadcontent_copy
expand_less
POST https://api.io.droplinked.com/v2/carts
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Body:
{
"shopId": "69103f6e530855f4b75c4da2"
}
Response:
code JSON
downloadcontent_copy
expand_less
{
"items": [],
"availableShipping": [],
"giftcard": null,
"additional": null,
"financialDetails": {
"tax": {
"total": 0,
"taxRate": null,
"droplinked": 0,
"producer": 0
},
"shipping": {
"total": 0,
"dropLinkedShare": 0,
"merchantShare": 0
},
"discounts": {
"ruleset": 0,
"giftCard": 0
},
"amounts": {
"productTotal": 0,
"productTotalAfterDiscount": null,
"discountTotal": 0,
"taxTotal": 0,
"shippingTotal": 0,
"totalBeforeDiscount": 0,
"totalCost": 0,
"finalTotalBeforeTax": 0,
"totalAmount": 0
}
},
"id": "6927faf705c8819a2dd672ae",
"shopId": "69103f6e530855f4b75c4da2",
"status": "ACTIVE",
"expiredAt": "2025-11-28T07:17:11.570Z",
"createdAt": "2025-11-27T07:17:11.571Z",
"updatedAt": "2025-11-27T07:17:11.571Z",
"_id": "6927faf705c8819a2dd672ae"
}
Save the cart ID: Store 6927faf705c8819a2dd672ae in localStorage (browser) or session (server) so customers can continue shopping.
Add items using the SKU ID (not the product ID).
API Request:
code Code
downloadcontent_copy
expand_less
POST https://api.io.droplinked.com/v2/carts/{cartId}/products
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Accept: /
Body:
{
"skuId": "sku_lamp_abc123",
"quantity": 1
}
Optional field m2m_data (only for made-to-measure/custom products):
code JSON
downloadcontent_copy
expand_less
{
"skuId": "sku_custom_item",
"quantity": 1,
"m2m_data": {
"position": "front",
"artworkUrl": "https://example.com/custom-design.png"
}
}
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"data": {},
"message": "Product added to cart"
}
API Request:
code Code
downloadcontent_copy
expand_less
GET https://api.io.droplinked.com/v2/carts/{cartId}
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"items": [
{
"skuId": "sku_lamp_abc123",
"title": "The Altar Table Lamp",
"price": 899,
"quantity": 1,
"subtotal": 899,
"image": "https://upload-file-droplinked.s3.amazonaws.com/..."
}
],
"financialDetails": {
"amounts": {
"productTotal": 899,
"totalAmount": 899
}
}
}
API Request:
code Code
downloadcontent_copy
expand_less
PATCH https://api.io.droplinked.com/v2/carts/{cartId}/products/{skuId}
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Body:
{
"quantity": 3
}
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"message": "Quantity updated"
}
API Request:
code Code
downloadcontent_copy
expand_less
DELETE https://api.io.droplinked.com/v2/carts/{cartId}/products/{skuId}
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"message": "Product removed from cart"
}
API Request:
code Code
downloadcontent_copy
expand_less
GET https://api.io.droplinked.com/v2/carts/{cartId}/shipping
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"data": [
{
"shipmentId": "shipment_001",
"rateId": "rate_standard",
"name": "Standard Shipping",
"price": 5.99,
"estimatedDays": "5-7 days"
},
{
"shipmentId": "shipment_001",
"rateId": "rate_express",
"name": "Express Shipping",
"price": 15.99,
"estimatedDays": "2-3 days"
}
]
}
API Request:
code Code
downloadcontent_copy
expand_less
POST https://api.io.droplinked.com/v2/carts/{cartId}/shipping
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Body:
{
"selectedShippingRate": [
{
"shipmentId": "shipment_001",
"rateId": "rate_standard"
}
]
}
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"message": "Shipping rate selected"
}
API Request:
code Code
downloadcontent_copy
expand_less
GET https://api.io.droplinked.com/v2/carts/{cartId}/payment-methods
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"data": [
{
"id": "stripe",
"name": "Credit Card",
"type": "card"
},
{
"id": "paypal",
"name": "PayPal",
"type": "paypal"
}
]
}
API Request:
code Code
downloadcontent_copy
expand_less
POST https://api.io.droplinked.com/v2/orders
Headers:
x-droplinked-api-key: YOUR_API_KEY
Content-Type: application/json
Body:
{
"cartId": "6927faf705c8819a2dd672ae"
}
Response:
code JSON
downloadcontent_copy
expand_less
{
"success": true,
"data": {
"orderId": "order_final_123",
"total": 904.99,
"status": "pending_payment",
"items": [
{
"title": "The Altar Table Lamp",
"quantity": 1,
"price": 899
}
],
"shipping": 5.99
}
}
code JavaScript
downloadcontent_copy
expand_less
const API_KEY = "your-api-key-here";
const SHOP_NAME = "lumen";
const BASE_URL = "https://api.io.droplinked.com";
// Helper function for API calls
async function callAPI(endpoint, method = "GET", body = null) {
const options = {
method,
headers: {
"x-droplinked-api-key": API_KEY,
"Content-Type": "application/json"
}
};
if (body) {
options.body = JSON.stringify(body);
}
const response = await fetch(`${BASE_URL}${endpoint}`, options);
return response.json();
}
// 1. Get shop info
async function getShop() {
return callAPI(`/shops/v2/public/name/${SHOP_NAME}`);
}
// 2. Get all products
async function getProducts() {
return callAPI(`/product-v2/public/shop/${SHOP_NAME}`);
}
// 3. Get product details (with SKU)
async function getProductDetails(productId) {
return callAPI(`/product-v2/public/${productId}`);
}
// 4. Create cart
async function createCart(shopId) {
return callAPI("/v2/carts", "POST", { shopId });
}
// 5. Add to cart
async function addToCart(cartId, skuId, quantity = 1) {
return callAPI(`/v2/carts/${cartId}/products`, "POST", {
skuId,
quantity
});
}
// 6. Get cart
async function getCart(cartId) {
return callAPI(`/v2/carts/${cartId}`);
}
// 7. Update quantity
async function updateQuantity(cartId, skuId, quantity) {
return callAPI(`/v2/carts/${cartId}/products/${skuId}`, "PATCH", {
quantity
});
}
// 8. Remove item
async function removeFromCart(cartId, skuId) {
return callAPI(`/v2/carts/${cartId}/products/${skuId}`, "DELETE");
}
// 9. Get shipping rates
async function getShipping(cartId) {
return callAPI(`/v2/carts/${cartId}/shipping`);
}
// 10. Select shipping
async function selectShipping(cartId, shipmentId, rateId) {
return callAPI(`/v2/carts/${cartId}/shipping`, "POST", {
selectedShippingRate: [{ shipmentId, rateId }]
});
}
// 11. Get payment methods
async function getPaymentMethods(cartId) {
return callAPI(`/v2/carts/${cartId}/payment-methods`);
}
// 12. Create order
async function createOrder(cartId) {
return callAPI("/v2/orders", "POST", { cartId });
}
// Usage Example
async function completeShoppingFlow() {
try {
// Get shop
const shop = await getShop();
console.log("Shop:", shop.name);
// Get products
const productsData = await getProducts();
const products = productsData.data;
console.log(`Found ${products.length} products`);
// Get first product details
const product = await getProductDetails(products[0].id);
console.log("Product:", product.title);
// Get SKU ID
const skuId = product.skus[0].id;
console.log("SKU ID:", skuId);
// Create cart
const cartData = await createCart(shop.id);
const cartId = cartData.id;
console.log("Cart created:", cartId);
// Add to cart
await addToCart(cartId, skuId, 1);
console.log("Product added to cart");
// Get cart contents
const cart = await getCart(cartId);
console.log("Cart total:", cart.financialDetails.amounts.totalAmount);
// Get shipping options
const shipping = await getShipping(cartId);
console.log("Shipping options:", shipping.data.length);
// Select shipping
await selectShipping(
cartId,
shipping.data[0].shipmentId,
shipping.data[0].rateId
);
// Get payment methods
const paymentMethods = await getPaymentMethods(cartId);
console.log("Payment methods:", paymentMethods.data.length);
// Create order
const order = await createOrder(cartId);
console.log("Order created:", order.data.orderId);
} catch (error) {
console.error("Error:", error);
}
}
// Run the flow
completeShoppingFlow();
code Python
downloadcontent_copy
expand_less
import requests
API_KEY = "your-api-key-here"
SHOP_NAME = "lumen"
BASE_URL = "https://api.io.droplinked.com"
class DroplinkedAPI:
def init(self, api_key, shop_name):
self.api_key = api_key
self.shop_name = shop_name
self.headers = {
"x-droplinked-api-key": api_key,
"Content-Type": "application/json"
}
def get_shop(self):
url = f"{BASE_URL}/shops/v2/public/name/{self.shop_name}"
response = requests.get(url, headers=self.headers)
response.raise_for_status()
return response.json()
def get_products(self):
url = f"{BASE_URL}/product-v2/public/shop/{self.shop_name}"
response = requests.get(url, headers=self.headers)
response.raise_for_status()
return response.json()
def get_product_details(self, product_id):
url = f"{BASE_URL}/product-v2/public/{product_id}"
response = requests.get(url, headers=self.headers)
response.raise_for_status()
return response.json()
def create_cart(self, shop_id):
url = f"{BASE_URL}/v2/carts"
response = requests.post(
url,
headers=self.headers,
json={"shopId": shop_id}
)
response.raise_for_status()
return response.json()
def add_to_cart(self, cart_id, sku_id, quantity=1):
url = f"{BASE_URL}/v2/carts/{cart_id}/products"
response = requests.post(
url,
headers=self.headers,
json={"skuId": sku_id, "quantity": quantity}
)
response.raise_for_status()
return response.json()
def get_cart(self, cart_id):
url = f"{BASE_URL}/v2/carts/{cart_id}"
response = requests.get(url, headers=self.headers)
response.raise_for_status()
return response.json()
def update_quantity(self, cart_id, sku_id, quantity):
url = f"{BASE_URL}/v2/carts/{cart_id}/products/{sku_id}"
response = requests.patch(
url,
headers=self.headers,
json={"quantity": quantity}
)
response.raise_for_status()
return response.json()
def remove_from_cart(self, cart_id, sku_id):
url = f"{BASE_URL}/v2/carts/{cart_id}/products/{sku_id}"
response = requests.delete(url, headers=self.headers)
response.raise_for_status()
return response.json()
def get_shipping(self, cart_id):
url = f"{BASE_URL}/v2/carts/{cart_id}/shipping"
response = requests.get(url, headers=self.headers)
response.raise_for_status()
return response.json()
def select_shipping(self, cart_id, shipment_id, rate_id):
url = f"{BASE_URL}/v2/carts/{cart_id}/shipping"
response = requests.post(
url,
headers=self.headers,
json={
"selectedShippingRate": [
{"shipmentId": shipment_id, "rateId": rate_id}
]
}
)
response.raise_for_status()
return response.json()
def get_payment_methods(self, cart_id):
url = f"{BASE_URL}/v2/carts/{cart_id}/payment-methods"
response = requests.get(url, headers=self.headers)
response.raise_for_status()
return response.json()
def create_order(self, cart_id):
url = f"{BASE_URL}/v2/orders"
response = requests.post(
url,
headers=self.headers,
json={"cartId": cart_id}
)
response.raise_for_status()
return response.json()
# Usage Example
def main():
api = DroplinkedAPI(API_KEY, SHOP_NAME)
try:
# Get shop
shop = api.get_shop()
print(f"Shop: {shop['name']}")
# Get products
products_data = api.get_products()
products = products_data['data']
print(f"Found {len(products)} products")
# Get first product details
product = api.get_product_details(products[0]['id'])
print(f"Product: {product['title']}")
# Get SKU ID
sku_id = product['skus'][0]['id']
print(f"SKU ID: {sku_id}")
# Create cart
cart_data = api.create_cart(shop['id'])
cart_id = cart_data['id']
print(f"Cart created: {cart_id}")
# Add to cart
api.add_to_cart(cart_id, sku_id, 1)
print("Product added to cart")
# Get cart contents
cart = api.get_cart(cart_id)
total = cart['financialDetails']['amounts']['totalAmount']
print(f"Cart total: ${total}")
# Get shipping options
shipping = api.get_shipping(cart_id)
print(f"Shipping options: {len(shipping['data'])}")
# Select shipping
api.select_shipping(
cart_id,
shipping['data'][0]['shipmentId'],
shipping['data'][0]['rateId']
)
# Get payment methods
payment_methods = api.get_payment_methods(cart_id)
print(f"Payment methods: {len(payment_methods['data'])}")
# Create order
order = api.create_order(cart_id)
print(f"Order created: {order['data']['orderId']}")
except Exception as e:
print(f"Error: {e}")
if name == "__main__":
main()
Always wrap API calls in try-catch blocks:
code JavaScript
downloadcontent_copy
expand_less
try {
const shop = await getShop();
} catch (error) {
console.error("Failed to fetch shop:", error);
// Show user-friendly error message
}
Store the cart ID so customers can continue shopping:
code JavaScript
downloadcontent_copy
expand_less
// Save cart ID
localStorage.setItem("cart_id", cartId);
// Retrieve on page load
const cartId = localStorage.getItem("cart_id");
if (cartId) {
// Load existing cart
const cart = await getCart(cartId);
}
Show loading indicators while fetching data:
code JavaScript
downloadcontent_copy
expand_less
setLoading(true);
try {
const products = await getProducts();
setProducts(products.data);
} finally {
setLoading(false);
}
Before adding to cart, check if items are in stock:
code JavaScript
downloadcontent_copy
expand_less
const product = await getProductDetails(productId);
const sku = product.skus[0];
if (sku.inventory.available && sku.inventory.quantity > 0) {
await addToCart(cartId, sku.id, 1);
} else {
alert("This item is out of stock");
}
Format prices according to currency:
code JavaScript
downloadcontent_copy
expand_less
const formatPrice = (price, currency) => {
return new Intl.NumberFormat('en-US', {
style: 'currency',
currency: currency
}).format(price);
};
// Usage
formatPrice(899, 'USD'); // "$899.00"
Issue: "API key not configured"
Issue: "Cart ID not found"
Issue: "Product not found"
Issue: "No products returned"
Issue: Can't add to cart
You now have everything you need to build a custom e-commerce store with droplinked APIs. The key steps are:
Remember:
Ready to build? Start with the shop and products endpoints, then add cart functionality, and finally implement checkout. Good luck building your custom store!
Need Help? Contact droplinked support or consult the official API documentation for more details
Category
Use Case Blog
Published
Dec 22, 2025
Share
In this article
Why Headless Commerce Matters
Who Can Use This Guide?
Who Benefits & How
What You Can Build
Get Started Today
Bottom Line
Getting Started
Prerequisites
Getting Your API Key
Base URL
Authentication
Building Your Shop: Step by Step
Step 1: Fetch Shop Information
Step 2: Display Your Products
Step 3: Get Product Details (Including SKU)
Shopping Cart System
Step 1: Create a Cart
Step 2: Add Product to Cart
Step 3: View Cart Contents
Step 4: Update Item Quantity
Step 5: Remove Item from Cart
Checkout Process
Step 1: Get Shipping Rates
Step 2: Select Shipping Rate
Step 3: Get Payment Methods
Step 4: Create Order
Complete Code Example (JavaScript/TypeScript)
Complete Code Example (Python)
Best Practices
1. Error Handling
2. Cart Persistence
3. Loading States
4. Inventory Checking
5. Price Formatting
Troubleshooting
Common Issues
API Reference Quick Guide
Conclusion
Tags