moego.business.company.v1)The Company module provides APIs to manage business entities in the system. Each company represents a top-level organizational unit that can contain multiple business locations, staff members, and service offerings.
This interface enables:
Useful for scenarios such as company management, multi-location administration, and integration with third-party systems.
Applicable to scenarios like company onboarding, configuration management, and enterprise-level reporting.
CompanyRepresents a business entity in the system.
| Field Name | Type | Description |
|---|---|---|
id |
string |
Unique identifier (e.g., "cmp_001"), obfuscated ID string |
name |
string |
Legal name used in official communications and documents. |
country |
string |
ISO 3166-1 alpha-2 country code indicating where the company is registered. |
timezone |
TimeZone |
Primary timezone for company operations (used for scheduling and reporting). |
{
"id": "cmp_001",
"name": "Moego Pet Care Inc.",
"country": "US",
"timezone": {
"id": "America/New_York"
}
}
Here is a typical integration flow:
GetCompany)GetCompany/v1/companies/{id}Retrieves detailed information about a specific company.
| Field Name | Type | Required | Description |
|---|---|---|---|
id |
string |
Yes | Unique identifier of the company, obfuscated ID string |
| Field Name | Type | Description |
|---|---|---|
company |
Company |
The retrieved company object |
| Error Code | Description |
|---|---|
NOT_FOUND |
Specified company ID does not exist |
PERMISSION_DENIED |
Permission denied |
ListCompanies)ListCompanies/v1/companies:listLists companies based on specified criteria.
Results are paginated and can be used for system administration and multi-company management scenarios. Companies are returned in alphabetical order by name.
| Field Name | Type | Required | Description |
|---|---|---|---|
pagination |
Pagination | Yes | Pagination info: pageSize, pageToken |
β οΈ
pageTokenis optional. Leave empty for the first page. Obtain from previous response for subsequent pages.
| Field Name | Type | Description |
|---|---|---|
nextPageToken |
string |
Token for retrieving the next page |
companies |
Array(Company) |
List of companies matching criteria |
| Error Code | Description |
|---|---|
INVALID_ARGUMENT |
Invalid pagination parameters |
PERMISSION_DENIED |
Permission denied |
Request
GET /v1/companies/cmp_001
Response
{
"id": "cmp_001",
"name": "Moego Pet Care Inc.",
"country": "US",
"timezone": {
"id": "America/New_York"
}
}
Request
POST /v1/companies:list
Content-Type: application/json
{
"pagination": {
"pageSize": 20,
"pageToken": "1"
}
}
Response
{
"nextPageToken": "CBAQAA==",
"companies": [
{
"id": "cmp_001",
"name": "Moego Pet Care Inc.",
"country": "US",
"timezone": {
"id": "America/New_York"
}
},
{
"id": "cmp_002",
"name": "PetCare Australia Pty Ltd",
"country": "AU",
"timezone": {
"id": "Australia/Sydney"
}
}
]
}
TODO
| Question | Answer |
|---|---|
| How to verify if a company exists? | Use GetCompany to check if the company ID returns a valid response. |
| Can I list all companies at once? | No. Results are paginated. Use pageToken to fetch next set. |
| Why does listing companies return βpermission deniedβ? | Ensure you have the correct access rights for this operation. |
| How to handle large result sets efficiently? | Use pagination via pageSize and pageToken. |
| Error Code | Description |
|---|---|
NOT_FOUND |
The requested company ID does not exist. |
PERMISSION_DENIED |
Caller lacks access rights to perform operation. |
INVALID_ARGUMENT |
Invalid request parameters provided. |
INTERNAL |
Internal server error occurred. |