{"service":"react-native-pos-stripe-api","baseUrl":"https://pos1.hcann.com","auth":{"pos":"Authorization: Bearer <token> from POST /api/auth/login","admin":"pos_token cookie from POST /api/admin/login, or same Bearer token","stripe":"Stripe-Signature header on webhook requests"},"sections":[{"title":"Health","endpoints":[{"method":"GET","path":"/api/health","auth":"none","description":"Service health check."}]},{"title":"Auth","endpoints":[{"method":"POST","path":"/api/auth/login","auth":"none","description":"POS tablet PIN login. Returns JWT.","body":"{ \"pin\": \"1234\" }"},{"method":"GET","path":"/api/auth/me","auth":"pos","description":"Current logged-in user."},{"method":"POST","path":"/api/admin/login","auth":"none","description":"Admin panel login. Sets pos_token cookie.","body":"{ \"email\": \"you@example.com\", \"pin\": \"your-password\" }"},{"method":"GET","path":"/api/admin/login","auth":"admin","description":"Current admin session."},{"method":"DELETE","path":"/api/admin/login","auth":"admin","description":"Log out of admin panel."}]},{"title":"POS — items","description":"Used by the React Native tablet after PIN login.","endpoints":[{"method":"GET","path":"/api/config","auth":"pos","description":"Merchant config (tax rate, register, Stripe readiness)."},{"method":"GET","path":"/api/categories","auth":"pos","description":"Category names for POS filters."},{"method":"GET","path":"/api/products","auth":"pos","description":"Active items for the POS menu.","query":"?category=Appetizers&search=wings"},{"method":"GET","path":"/api/products/{id}","auth":"pos","description":"Single product by ID."}]},{"title":"POS — orders","endpoints":[{"method":"GET","path":"/api/orders","auth":"pos","description":"List and search order history.","query":"?limit=50&offset=0&search=ORD-2026&status=pending|completed|failed|refunded"},{"method":"POST","path":"/api/orders","auth":"pos","description":"Create order. Use paymentStatus pending for open tabs.","body":"{ \"lineItems\": [{ \"productId\": \"20\", \"quantity\": 2 }], \"discountCents\": 0, \"paymentMethod\": \"card\", \"paymentStatus\": \"pending\", \"tabLabel\": \"Table 5\", \"idempotencyKey\": \"<uuid>\" }","notes":"Inventory deducts only when paymentStatus is completed."},{"method":"GET","path":"/api/orders/{id}","auth":"pos","description":"Retrieve any order by UUID or receipt number.","notes":"Example id: ORD-20260906-0003"},{"method":"PATCH","path":"/api/orders/{id}","auth":"pos","description":"Update a pending open tab (lines, discount, tabLabel).","body":"{ \"lineItems\": [{ \"productId\": \"20\", \"quantity\": 3 }], \"discountCents\": 0, \"tabLabel\": \"Table 5\" }","notes":"Accepts UUID or receipt number. Omitted fields keep their current value. 404 if missing, 409 if already paid."},{"method":"DELETE","path":"/api/orders/{id}","auth":"pos","description":"Delete a pending open tab. Completed orders cannot be deleted.","notes":"Returns 409 when the order is already paid."},{"method":"POST","path":"/api/orders/{id}/complete","auth":"pos","description":"Complete and pay a pending tab. Deducts inventory.","body":"{ \"paymentMethod\": \"cash|card|online\", \"cashReceivedCents\": 5000, \"lineItems\": [...], \"discountCents\": 0, \"stripePaymentIntentId\": \"...\" }","notes":"Accepts UUID or receipt number. Omit lineItems/discountCents to pay the tab as it stands."}]},{"title":"POS — reports","endpoints":[{"method":"GET","path":"/api/reports/best-sellers","auth":"pos","description":"Best-selling products from completed orders.","query":"?days=30&limit=20"}]},{"title":"Stripe","endpoints":[{"method":"POST","path":"/api/stripe/connection-token","auth":"pos","description":"Stripe Terminal connection token for the connected account."},{"method":"POST","path":"/api/stripe/payment-intent","auth":"pos","description":"Create a PaymentIntent for in-person card payment.","body":"{ \"amountCents\": 1500, \"orderId\": \"...\", \"idempotencyKey\": \"<uuid>\" }"},{"method":"POST","path":"/api/stripe/webhook","auth":"stripe","description":"Stripe webhook handler (checkout, payments, Connect)."}]},{"title":"Public menu","description":"No auth — customer-facing online ordering.","endpoints":[{"method":"GET","path":"/api/public/menu/{slug}","auth":"none","description":"Public menu JSON for /menu/{slug}."},{"method":"POST","path":"/api/public/checkout/{slug}","auth":"none","description":"Create Stripe Checkout session for online order.","body":"{ \"lineItems\": [{ \"productId\": \"1\", \"quantity\": 1 }] }","notes":"If customer_token cookie is set, order is linked to that account."},{"method":"POST","path":"/api/public/auth/{slug}/register","auth":"none","description":"Create a customer account and send a verification email.","body":"{ \"email\": \"you@example.com\", \"name\": \"Jane\", \"password\": \"...\", \"turnstileToken\": \"...\" }","notes":"Sends a verification email. Customer must verify before sign-in. turnstileToken required when TURNSTILE_SECRET_KEY is set."},{"method":"GET","path":"/api/public/auth/{slug}/verify-email","auth":"none","description":"Email verification link from customer inbox.","notes":"Query: ?token=... Redirects to /menu/{slug}?verified=1 or ?verified=error."},{"method":"POST","path":"/api/public/auth/{slug}/resend-verification","auth":"none","description":"Resend customer verification email.","body":"{ \"email\": \"you@example.com\", \"turnstileToken\": \"...\" }"},{"method":"POST","path":"/api/public/auth/{slug}/login","auth":"none","description":"Customer sign-in. Sets customer_token cookie.","body":"{ \"email\": \"you@example.com\", \"password\": \"...\", \"turnstileToken\": \"...\" }","notes":"Requires verified email. turnstileToken required when TURNSTILE_SECRET_KEY is set."},{"method":"GET","path":"/api/public/auth/{slug}/me","auth":"none","description":"Current customer session (customer_token cookie)."},{"method":"DELETE","path":"/api/public/auth/{slug}/logout","auth":"none","description":"Clear customer session cookie."},{"method":"GET","path":"/api/public/orders/{slug}","auth":"none","description":"Completed order history for signed-in customer.","notes":"Requires customer_token cookie."},{"method":"GET","path":"/api/public/orders/{slug}/{id}","auth":"none","description":"Single order for signed-in customer (UUID or order number)."}]},{"title":"Admin","description":"Admin panel CRUD. Auth via pos_token cookie or Bearer JWT with ADMIN/MANAGER role.","endpoints":[{"method":"GET","path":"/api/admin/settings","auth":"admin","description":"Merchant settings."},{"method":"PATCH","path":"/api/admin/settings","auth":"admin","description":"Update merchant settings."},{"method":"GET","path":"/api/admin/products","auth":"admin","description":"List products (search, sort, pagination).","query":"?search=wings&sort=name|category|price|stock|sku"},{"method":"POST","path":"/api/admin/products","auth":"admin","description":"Create product."},{"method":"PATCH","path":"/api/admin/products/{id}","auth":"admin","description":"Update product."},{"method":"DELETE","path":"/api/admin/products/{id}","auth":"admin","description":"Delete product."},{"method":"GET","path":"/api/admin/categories","auth":"admin","description":"List categories."},{"method":"POST","path":"/api/admin/categories","auth":"admin","description":"Create category."},{"method":"PATCH","path":"/api/admin/categories","auth":"admin","description":"Reorder categories.","body":"{ \"orderedIds\": [\"id1\", \"id2\"] }"},{"method":"PATCH","path":"/api/admin/categories/{id}","auth":"admin","description":"Update category."},{"method":"DELETE","path":"/api/admin/categories/{id}","auth":"admin","description":"Delete category."},{"method":"GET","path":"/api/admin/staff","auth":"admin","description":"List staff users."},{"method":"POST","path":"/api/admin/staff","auth":"admin","description":"Create staff user with PIN."},{"method":"PATCH","path":"/api/admin/staff/{id}","auth":"admin","description":"Update staff user."},{"method":"GET","path":"/api/admin/stripe/connect","auth":"admin","description":"Stripe Connect account status."},{"method":"POST","path":"/api/admin/stripe/connect","auth":"admin","description":"Create Connect account or onboarding link."},{"method":"POST","path":"/api/admin/upload","auth":"admin","description":"Upload product image (multipart form)."},{"method":"GET","path":"/api/admin/orders","auth":"admin","description":"Order history with search and pagination.","query":"?limit=25&offset=0&search=Table 5&status=pending|completed|failed|refunded"},{"method":"GET","path":"/api/admin/orders/{id}","auth":"admin","description":"Single order by UUID or receipt number."},{"method":"DELETE","path":"/api/admin/orders/{id}","auth":"admin","description":"Delete a pending open tab."},{"method":"GET","path":"/api/admin/reports/best-sellers","auth":"admin","description":"Best sellers report for admin UI.","query":"?days=30&limit=20"}]}]}