The Companies API is the top level of Credith’s organizational hierarchy. Every store location, staff member, and point-of-sale terminal is ultimately rooted in a company record. A company holds the legal identity of a business — its name, tax registration number (RTN), contact email, and physical address — and acts as the parent container for all stores created beneath it. All endpoints are protected: only users with the Owner role may read or modify company data.Documentation 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.
Endpoints overview
All company endpoints require a validtoken cookie and the Owner role.
| Method | Path | Description |
|---|---|---|
GET | /api/companies | List companies (paginated, filterable) |
GET | /api/companies/:id | Get a single company by UUID |
POST | /api/companies | Create a new company |
PUT | /api/companies/:id | Update company fields |
DELETE | /api/companies/:id | Permanently delete a company |
List companies
Owner role
Maximum number of records to return per page.
Number of records to skip before starting the page — use together with
limit for pagination.Case-insensitive partial match on the company
name field (ILIKE %filter%). Omit to return all companies.Response 200
Get company by ID
Owner role
UUID of the company to retrieve.
Responses
| Status | Description |
|---|---|
200 | Company object returned. |
404 | No company found with the given ID. |
Create a company
Owner role
The
rtn (Registro Tributario Nacional) must be unique across all companies. Submitting a duplicate RTN returns 400 Bad Request. The RTN is also validated to be non-empty before any database lookup is performed.Request body
Legal trading name of the company. Cannot be blank or whitespace-only.
Tax registration number (Registro Tributario Nacional). Maximum 25 characters. Must be unique across all companies.
Contact email address for the company. Maximum 100 characters.
Physical address or location description for the company’s headquarters.
Example request
Responses
| Status | Description |
|---|---|
201 | Company created successfully. Returns the new company object. |
400 | Validation failed — name or rtn missing/blank, or RTN already exists. |
500 | Unexpected server error. |
Update a company
Owner role
UUID of the company to update.
New company name. Cannot be set to an empty or whitespace-only string.
New RTN value. Must be unique if it differs from the company’s current RTN.
New contact email address.
New headquarters address.
Responses
| Status | Description |
|---|---|
200 | Company updated successfully. Returns the updated company object. |
400 | Validation failed — blank name/RTN supplied, or new RTN already belongs to another company. |
404 | No company found with the given ID. |
500 | Unexpected server error. |
Delete a company
Owner role
UUID of the company to delete.
Responses
| Status | Description |
|---|---|
200 | Company deleted successfully. |
404 | No company found with the given ID. |
500 | Unexpected server error. |
Company object reference
UUID v4 primary key, auto-generated on creation.
Legal trading name of the company. Maximum 100 characters.
Registro Tributario Nacional — the company’s government-issued tax ID. Maximum 25 characters. Unique across all records.
Optional contact email address. Maximum 100 characters.
Optional free-text headquarters address.
ISO 8601 timestamp of when the record was created.
ISO 8601 timestamp of the most recent update.