Company endpoint

The Company endpoint and fields are described below including details of the supported RESTful CRUD verbs. For details of the conventions of the API see the general conventions.

Endpoint path prefix:

/n/v1/company/

company was introduced in API version V1

Company has not been marked for deprecation

Description

Company endpoint with support for companies used both internally for account structure and CRM company representations. Baack supports Company structures under an Organisation. Each company includes it's own usage / billing context. Typically an organisation with an account will include a Company for test / development purposes as well as one for production. Baack keeps company related concepts separate and each company has it's own encryption setup for data encryption at rest for Customer Information.

Companies typically have associated content in the CRM context.
Company structures can be used to create structured scopes for an account.
Company groups ownership for most concepts.

Verbs / methods

This endpoint supports the following CRUD operations in line with our API conventions. See the conventions section for more details.

CREATE HTTP POST

Request payload

Company reference

{
  "name" : "Example company name",
  "owner" : {
    "urn" : "7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56",
    "url" : "/n/v1/company/7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56"
  }
}

Response payload

Company reference
Representation of a company object which may have a parent company (in structured companies), an owner, if this company represents some CRM company owned by a customer company and an organisation for which this company and associated accounts are provisioned.

{
  "urn" : "32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
  "url" : "/n/v1/company/32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
  "name" : "Example company name",
  "parentCompany" : {
    "urn" : "fe7f2716-3541-45d5-833d-b8a14ad386d0",
    "url" : "/n/v1/company/fe7f2716-3541-45d5-833d-b8a14ad386d0"
  },
  "owner" : {
    "urn" : "7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56",
    "url" : "/n/v1/company/7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56"
  },
  "organisation" : {
    "urn" : "0225cc24-77fc-40fe-88dd-66f358a17d56",
    "url" : "/n/v1/organisation/0225cc24-77fc-40fe-88dd-66f358a17d56"
  }
}

Response codes / scenarios

  • CREATE_SUCCESS

    API code CREATE_SUCCESS HTTP status code 201 : When the representation provided was successfully created return HTTP created (201). Note that when other context like authorisation and permissions are satisfied but the representation is invalid or missing required information typically a error representation with details of the missing information may be returned instead with REPRESENTATION_MISSING_REQUIRED_FIELD api error for example

  • INVALID_REPRESENTATION

    API code INVALID_REPRESENTATION HTTP status code 400 : When creating or updating a representation and the provided representation is invalid. May include an error representation with details of the issue

  • REPRESENTATION_MISSING_REQUIRED_FIELD

    API code REPRESENTATION_MISSING_REQUIRED_FIELD HTTP status code 400 : When creating or updating a representation the provided representation was missing a required filed. Typically has a error response representation with details of the missing required field.

READ HTTP GET

Response example

Company
Representation of a company object which may have a parent company (in structured companies), an owner, if this company represents some CRM company owned by a customer company and an organisation for which this company and associated accounts are provisioned.

{
  "urn" : "32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
  "url" : "/n/v1/company/32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
  "name" : "Example company name",
  "parentCompany" : {
    "urn" : "fe7f2716-3541-45d5-833d-b8a14ad386d0",
    "url" : "/n/v1/company/fe7f2716-3541-45d5-833d-b8a14ad386d0"
  },
  "owner" : {
    "urn" : "7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56",
    "url" : "/n/v1/company/7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56"
  },
  "organisation" : {
    "urn" : "0225cc24-77fc-40fe-88dd-66f358a17d56",
    "url" : "/n/v1/organisation/0225cc24-77fc-40fe-88dd-66f358a17d56"
  }
}

Response codes / scenarios

  • NOT_FOUND

    API code NOT_FOUND HTTP status code 404 : When the request referenced a representation or a concept that was not found including other request context requirements. Note that if a request is missing other concepts including authorisation, permissions or restrictions on the visibility HTTP not found (404) will typically be returned. Note that when creating a representation if the owner or other references can't be resolved the endpoint may return not found.

  • READ_SUCCESS

    API code READ_SUCCESS HTTP status code 200 : On read when the request is successful. The returned representation is given with the relevant 2XX HTTP code without further detail.

UPDATE HTTP PUT

Response example

Company
Representation of a company object which may have a parent company (in structured companies), an owner, if this company represents some CRM company owned by a customer company and an organisation for which this company and associated accounts are provisioned.

{
  "urn" : "32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
  "url" : "/n/v1/company/32a90f18-aaa0-4bdc-a63e-4efd2e16c28c",
  "name" : "Example company name",
  "parentCompany" : {
    "urn" : "fe7f2716-3541-45d5-833d-b8a14ad386d0",
    "url" : "/n/v1/company/fe7f2716-3541-45d5-833d-b8a14ad386d0"
  },
  "owner" : {
    "urn" : "7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56",
    "url" : "/n/v1/company/7f8a5363-3a24-4ca1-a9a8-986bbbe7ee56"
  },
  "organisation" : {
    "urn" : "0225cc24-77fc-40fe-88dd-66f358a17d56",
    "url" : "/n/v1/organisation/0225cc24-77fc-40fe-88dd-66f358a17d56"
  }
}

Response codes / scenarios

  • UPDATE_SUCCESS

    API code UPDATE_SUCCESS HTTP status code 202 : When creation was successful and the representation was created. Returns HTTP accepted (202) response and typically includes the representation of the created representation for reference. Note that CREATE / UPDATE can trigger async operations after the representation is accepted which can update state.

  • REPRESENTATION_MISSING_REQUIRED_FIELD

    API code REPRESENTATION_MISSING_REQUIRED_FIELD HTTP status code 400 : When creating or updating a representation the provided representation was missing a required filed. Typically has a error response representation with details of the missing required field.

DELETE HTTP DELETE

Response codes / scenarios

  • DELETE_SUCCESS

    API code DELETE_SUCCESS HTTP status code 202 : When deletion of a representation was successful. Note that returns HTTP accepted (202) to represent the success of the deletion state transfer rather than HTTP gone (410) as 4XX represent client errors for semantic consistency

  • NOT_FOUND

    API code NOT_FOUND HTTP status code 404 : When the request referenced a representation or a concept that was not found including other request context requirements. Note that if a request is missing other concepts including authorisation, permissions or restrictions on the visibility HTTP not found (404) will typically be returned. Note that when creating a representation if the owner or other references can't be resolved the endpoint may return not found.

Change history

0.1.0

  • Endpoint introduced with support for baseline company structures