Platform API
Reventory Store API
Read your catalog and storefront settings, accept customer orders from your own website. Hosted Reventory shop templates use Firestore directly — this API is for custom sites on your domain.
Base URL
Production: https://api.klorsr.com (after DNS setup)
Until then: https://us-central1-reventory-66edd.cloudfunctions.net/storeApi
https://us-central1-reventory-66edd.cloudfunctions.net/storeApi/v1/store
Paths: /v1/store, /v1/products, /v1/orders
Set up api.klorsr.com
Reventory runs on reventory.klorsr.com. The Store API lives on a separate subdomain so custom sites on your own domain call a stable URL.
- Deploy functions:
firebase deploy --only functions:storeApi - Firebase Console → Functions → select
storeApi→ Custom domains → addapi.klorsr.com - At your DNS host (where
klorsr.comis managed), add the CNAME or A records Firebase shows you - Wait for SSL (usually 15–60 minutes). Test:
https://api.klorsr.com/v1/store - Set
NEXT_PUBLIC_STORE_API_URL=https://api.klorsr.comon reventory.klorsr.com (optional — switches dashboard/docs default)
Your custom site .env: REVENTORY_API_URL=https://api.klorsr.com — no /storeApi in the path on the custom domain.
Authentication
Every request requires an API key tied to one business. Generate keys in Dashboard → Storefront → Store API. Store the key in your server environment only — never expose it in client-side JavaScript.
# .env (your custom site — server only) REVENTORY_API_KEY=rv_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # Header option A Authorization: Bearer rv_live_xxxxxxxx... # Header option B X-Api-Key: rv_live_xxxxxxxx...
Invalid or revoked keys return 401.
Endpoints
GET /v1/store
Company profile, categories, brands, branches, and curated blocks (hero, flash sale, new arrivals) using the same settings you configure in the Reventory app.
curl -s "https://us-central1-reventory-66edd.cloudfunctions.net/storeApi/v1/store" \ -H "Authorization: Bearer $REVENTORY_API_KEY"
GET /v1/products
Paginated active products. Query params: categoryId, brandId, q (search), limit (max 100), offset.
curl -s "https://us-central1-reventory-66edd.cloudfunctions.net/storeApi/v1/products?limit=20&q=shirt" \ -H "X-Api-Key: $REVENTORY_API_KEY"
GET /v1/products/:productId
Single active product by inventory ID.
curl -s "https://us-central1-reventory-66edd.cloudfunctions.net/storeApi/v1/products/PRODUCT_ID" \ -H "Authorization: Bearer $REVENTORY_API_KEY"
POST /v1/orders
Create a customer order from your website checkout. Orders are saved to customer_orders — separate from in-app worker pending sales. Stock is validated but not decremented until you fulfil the order in Reventory (UI coming).
curl -s -X POST "https://us-central1-reventory-66edd.cloudfunctions.net/storeApi/v1/orders" \
-H "Authorization: Bearer $REVENTORY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"customer": {
"name": "Ada Okafor",
"phone": "+2348012345678",
"email": "ada@example.com"
},
"items": [
{ "productId": "prod_abc123", "quantity": 2 }
],
"notes": "Deliver before 5pm"
}'GET /v1/orders/:orderId
Order status for thank-you pages (same API key, same company).
curl -s "https://us-central1-reventory-66edd.cloudfunctions.net/storeApi/v1/orders/web_order_1234567890_abc123" \ -H "Authorization: Bearer $REVENTORY_API_KEY"
Custom site integration
In your Next.js (or any) project, call the API from a server route or server component — not from the browser.
// app/api/products/route.ts (your site)
export async function GET() {
const res = await fetch(
process.env.REVENTORY_API_URL + '/v1/products?limit=50',
{
headers: {
Authorization: 'Bearer ' + process.env.REVENTORY_API_KEY,
},
next: { revalidate: 60 },
}
);
return Response.json(await res.json());
}Errors
Errors return JSON: { "error": { "code": "...", "message": "..." } }
401 unauthorized— missing or invalid API key400 invalid_argument— bad request body400 insufficient_stock— not enough inventory404 not_found— store, product, or order not found
Need a custom site built?
Request a bespoke storefront from Dashboard → Storefront, or email support. Your API key connects any developer-built site to live Reventory data.
Open storefront settings →