Runbits/API Reference

API Reference

All endpoints are served from https://api.runbits.dev. Protected endpoints require a Authorization: Bearer <token> header. All responses are JSON.

Methods:GETPOSTPATCHPUTDELETE·PublicAuth

Gateway

Health check and infrastructure endpoints.

GETPublic
/healthGateway liveness check
GETPublic
/api/config/flagsReturns all feature flags

Auth

Registration, login, social auth, passwordless, and token management. Rate-limited to 10 req / 60 s per IP.

POSTPublic
/api/auth/registerCreate a new user account
POSTPublic
/api/auth/loginAuthenticate with email + password
POSTPublic
/api/auth/googleSign in or register via Google OAuth
POSTPublic
/api/auth/apple/callbackSign in or register via Apple Sign-In
GETPublic
/api/auth/facebook/callbackOAuth 2.0 callback for Facebook login
POSTPublic
/api/auth/magic-link/requestSend a magic link to the given email
GETPublic
/api/auth/magic-link/verifyExchange a magic-link token for session tokens
POSTPublic
/api/auth/otp/requestSend a one-time password to the given email
POSTPublic
/api/auth/otp/verifyVerify OTP and issue session tokens
POSTPublic
/api/auth/refreshIssue a new access token using a valid refresh token
POSTAuth
/api/auth/logoutRevoke a refresh token
GETAuth
/api/auth/meReturn the authenticated user's profile
PATCHAuth
/api/auth/meUpdate name and/or phone
GETPublic
/api/auth/verify-emailVerify an email address via token
POSTAuth
/api/auth/resend-verificationRe-send email verification link
POSTAuth
/api/auth/switch-roleSwitch the active role for the current session
POSTAuth
/api/auth/switch-profileSwitch active profile (multi-profile)
POSTAuth
/api/auth/add-roleAdd a new role to the existing account

Stores

Store listing, detail, and management. GET requests are public; mutations require auth.

GETPublic
/api/storesList stores — paginated, filterable by zone, category, search
GETPublic
/api/stores/:idSingle store detail
PATCHAuth
/api/stores/:idUpdate store fields (owner or admin)
GETPublic
/api/stores/:id/menuList menu items for a store — paginated
POSTAuth
/api/stores/:id/menuCreate a menu item
PATCHAuth
/api/stores/:storeId/menu/:itemIdUpdate a menu item
DELETEAuth
/api/stores/:storeId/menu/:itemIdRemove a menu item
GETAuth
/api/stores/:id/statsAggregated store metrics (owner or admin)

Orders

Order placement and management. All endpoints require auth. Rate-limited to 60 req / 60 s per user.

GETAuth
/api/ordersList orders for the authenticated user or store — paginated
POSTAuth
/api/ordersPlace a new order
GETAuth
/api/orders/:idOrder detail
PATCHAuth
/api/orders/:idUpdate order status (owner/rider)
DELETEAuth
/api/orders/:idCancel an order (within cancellation window)

Billing

Subscription management, usage, limits, and billing history. All endpoints require auth.

GETAuth
/api/subscriptions/:storeIdCurrent subscription for a store
POSTAuth
/api/subscriptionsCreate a new subscription
POSTAuth
/api/subscriptions/:id/upgradeUpgrade to a higher plan immediately
POSTAuth
/api/subscriptions/:id/downgradeDowngrade plan (takes effect at period end)
POSTAuth
/api/subscriptions/:id/cancelCancel subscription at period end
GETAuth
/api/subscriptions/:storeId/usageCurrent usage counters for the store's plan
GETAuth
/api/subscriptions/:storeId/limitsPlan limits for the store
GETAuth
/api/subscriptions/:storeId/billingBilling history and payment method
GETAuth
/api/subscriptions/account/:accountId/consolidatedConsolidated billing view across all stores for an account

Modules

Add-on marketplace for extending store functionality. All endpoints require auth.

GETAuth
/api/subscriptions/:storeId/modulesList available and active modules for the store
POSTAuth
/api/subscriptions/:storeId/modulesAdd a module to the store's subscription
DELETEAuth
/api/subscriptions/:storeId/modules/:moduleIdRemove a module (takes effect at period end)

Social

Coupons, promotions, favorites, and in-order chat.

GETAuth
/api/couponsList coupons — owners see their store coupons; customers see applicable ones
POSTAuth
/api/couponsCreate a coupon (code, discount, type, expiry)
GETAuth
/api/coupons/:idSingle coupon detail
DELETEAuth
/api/coupons/:idDelete / deactivate a coupon
GETAuth
/api/promotionsList promotions — paginated
POSTAuth
/api/promotionsCreate a promotion
GETAuth
/api/promotions/:idSingle promotion detail
DELETEAuth
/api/promotions/:idDelete a promotion
GETAuth
/api/favoritesList the user's favorited stores — paginated
POSTAuth
/api/favoritesAdd a store to favorites
DELETEAuth
/api/favorites/:storeIdRemove a store from favorites

Chat

In-order messaging between customers, store owners, and riders. Rate-limited to 120 req / 60 s per user.

GETAuth
/api/chat/orders/:orderId/messagesRetrieve message history for an order's chat thread
POSTAuth
/api/chat/orders/:orderId/messagesSend a message in an order's chat thread
PATCHAuth
/api/chat/orders/:orderId/messages/readMark all messages in a thread as read
GETAuth
/api/chat/unread-countTotal unread messages across all order threads

Profiles

Multi-profile support per user account. All endpoints require auth.

GETAuth
/api/profilesList profiles for the authenticated user — paginated
POSTAuth
/api/profilesCreate a new profile
PATCHAuth
/api/profiles/:idUpdate a profile
DELETEAuth
/api/profiles/:idSoft-delete a profile

Config

Zones, push tokens, and internal endpoints.

GETPublic
/api/zonesList delivery zones — public
POSTAuth
/api/push-tokensRegister a device push notification token
DELETEAuth
/api/push-tokens/:tokenUnregister a device token

Delivery

Rider and fleet management. All endpoints require auth.

GETAuth
/api/riders/*Rider management: registration, location updates, availability, assignment
GETAuth
/api/fleets/*Fleet management: groups of riders under an operator

Conventions

Pagination

Query params: ?limit=20&offset=0 (default limit 20, max 100).

{
"data": [...],
"total": 100,
"limit": 20,
"offset": 0
}

Error Shape

All errors return a consistent JSON body. Every response includes X-Request-Id for tracing.

{
"error": "Human-readable message"
}

Rate Limits

Auth endpoints10 req / 60 s per IP
Order endpoints60 req / 60 s per user
Chat endpoints120 req / 60 s per user

Status Codes

200OK
201Created
204No content
400Bad request
401Unauthorized
403Forbidden
404Not found
429Rate limit exceeded