Stores represent individual physical retail locations operating under a parent company. Every store is linked to exactly one company viaDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/RoyGeova07/Credith/llms.txt
Use this file to discover all available pages before exploring further.
companyId, carries a unique store number, and an optional free-text address. Stores can be independently activated or deactivated — only active stores can participate in billing transactions and inventory management. Users (admins and employees) are assigned to stores, and each store maintains its own product inventory through the stores_inventories junction table.
Endpoints overview
| Method | Path | Auth required | Description |
|---|---|---|---|
GET | /api/stores | No | List stores (paginated, includes company) |
GET | /api/stores/:id | No | Get a single store by UUID |
POST | /api/stores | Admin / Owner | Create a new store |
PUT | /api/stores/:id | Admin / Owner | Update store fields |
PUT | /api/stores/activate/:id | Admin / Owner | Activate a store |
PUT | /api/stores/deactivate/:id | Admin / Owner | Deactivate a store |
GET | /api/admin-stores | Owner | List admins with their assigned store |
DELETE | /api/admin-stores/:userId/store | Owner | Remove store assignment from an admin |
GET /api/stores, GET /api/stores/:id) are public. Write operations require a valid session with an Admin or Owner role. Admin-store assignment endpoints require the Owner role.
List stores
companyId, name, rtn).
Maximum number of store records to return per page.
Number of records to skip before starting the page. Use with
limit for pagination.Response 200
Get store by ID
UUID of the store to retrieve.
company object.
Responses
| Status | Description |
|---|---|
200 | Store object returned. |
404 | No store found with the given ID. |
Create a store
storeNumber is a positive integer — it identifies the store numerically within its company (e.g., Store 1, Store 2). It is not a street address. The optional address field holds the free-text street or location description.Request body
Numeric identifier for the store within its company. Must be a positive integer (e.g.,
1, 2, 5). Non-integer or non-positive values return a 400 error.UUID of the parent company. The company must already exist — a
404 is returned if it does not.Optional free-text street address or location description for this store (e.g.,
"Col. Palmira, Tegucigalpa"). Stored as NULL if omitted.Example request
Responses
| Status | Description |
|---|---|
201 | Store created successfully. |
400 | Validation failed — storeNumber missing, not a positive integer, or companyId blank. |
404 | Parent company not found. |
500 | Unexpected server error. |
Update a store
UUID of the store to update.
New store number. Must remain a positive integer if supplied.
New free-text address. Pass an empty string or omit to clear the field.
Reassign the store to a different company UUID. The target company must exist.
Responses
| Status | Description |
|---|---|
200 | Store updated successfully. |
400 | Validation failed — invalid storeNumber or blank companyId. |
404 | Store or target company not found. |
500 | Unexpected server error. |
Activate a store
isActive to true for the specified store. Returns 400 if the store is already active.
UUID of the store to activate.
Responses
| Status | Description |
|---|---|
200 | Store activated successfully. |
400 | Store is already active. |
404 | Store not found. |
Deactivate a store
isActive to false for the specified store. Returns 400 if the store is already inactive.
UUID of the store to deactivate.
Responses
| Status | Description |
|---|---|
200 | Store deactivated successfully. |
400 | Store is already inactive. |
404 | Store not found. |
Admin store assignment
Admin users can be assigned to a specific store so they manage that location. Theadmin-stores resource exposes two utility endpoints, both restricted to the Owner role and requiring a valid token cookie.
List admins with their assigned store
Owner role
Returns all users who hold the ADMIN role, each with their assigned store object embedded (or null if unassigned).
Remove store assignment from an admin
storeId field (NULL) on the specified user, effectively un-assigning them from their current store.
Authentication: ✅ Required — Owner role
UUID of the admin user whose store assignment should be removed.
| Status | Description |
|---|---|
200 | Assignment removed successfully. |
401 | Missing or invalid token cookie. |
403 | Authenticated user does not have the Owner role. |
404 | User not found. |
Store object reference
UUID v4 primary key, auto-generated on creation.
Numeric identifier for this store within its company. Positive integer, not nullable.
Optional free-text street address or location description.
Whether the store is currently active. Defaults to
true on creation. Only active stores can process bills.UUID of the parent company this store belongs to.
Embedded company object included in list and single-record GET responses.
ISO 8601 timestamp of record creation.
ISO 8601 timestamp of the most recent update.