BitCenter REST API & Webhooks
Built on Cloudflare Workers + D1 SQLite for fast POS sync, ERP inventory automation, custom storefronts, and WhatsApp lead notifications.
Public Endpoints (No Auth Required)
GET /api/v1/health— Edge health & D1 database connectivityGET /api/v1/products?category=laptops&q=macbook&sort=price_asc— Filterable catalog with PKR prices & installment mathGET /api/v1/products/:slug— Single product specs, warranty, and 3/6/12m installment breakdownGET /api/v1/categories— Product categories with live item countsGET /api/v1/areas&GET /api/v1/guides— Regional coverage & buyer guidesPOST /api/v1/preorders— Capture customer pre-order lead & trigger signed webhooksPOST /api/v1/service-requests— Book 10–60 min repairs, software support, or warranty claims
Authenticated Integration Endpoints
Generate a scoped key in /admin and pass Authorization: Bearer bc_live_….
# Bulk sync stock & PKR prices from a POS or spreadsheet
curl -X POST https://store.phantom.pk/api/v1/admin/products/bulk-stock \
-H "Authorization: Bearer bc_live_YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"items":[{"sku":"BC-LAP-001","stock_status":"in_stock","price_pkr":362000}]}'
# Export all pre-order leads as CSV
curl -H "Authorization: Bearer bc_live_YOUR_KEY" \
"https://store.phantom.pk/api/v1/admin/preorders?format=csv"
Signed Webhooks (HMAC-SHA256)
Configure webhook URLs in /admin for events preorder.created, service_request.created, and product.updated. Every delivery includes X-BitCenter-Event and X-BitCenter-Signature: sha256=….