# Upsert a company by Id This endpoint allows you to update (default behaviour) or insert a new Company. You are responsible to give a unique business identifier with your company. If this business identifier can't be found then a new company will be created. If a company with the given business identifier can be found then it will be updated. When you specify 'if-match', which is filled in with a weak ETAG representing a version, then you can protect yourself from updates by someone else before committing your updates. (see also Optimistic locking). When such a conflict is detected, a 412 PreconditionFailed response is returned. Endpoint: PUT /companies/{business_id} Version: 1.6.1 Security: clientCredentials ## Path parameters: - `business_id` (string, required) The business identifier of an entity instance ## Header parameters: - `Prefer` (array) The RFC7240 Prefer header indicates that a particular server behavior is preferred by the client but is not required for successful completion of the request (see RFC 7240). The following behavior is supported by this API: * return= is used to suggest the server to return using status code 204 without a resource in the response body (minimal) or using status codes 200 or 201 with the resource in the response body on success (representation). - `If-Match` (string) weak Etag as optimistic locking check ## Request fields (application/json): - `business_id` (string) A unique reference ID Example: "624ec196-4c5c-4fb4-bb43-9ffd8a6b8844" - `name` (string) The name of this Company Example: "a name" ## Response 200 fields (application/json): - `business_id` (string) A unique reference ID Example: "624ec196-4c5c-4fb4-bb43-9ffd8a6b8844" - `name` (string) The name of this Company Example: "a name" ## Response 404 fields (application/problem+json): - `type` (string) An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). Example: "https://api.conundra.eu/problem/constraint-violation" - `title` (string) A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable Example: "Invalid ..." - `status` (integer) The HTTP status code generated by the origin server for this occurrence of the problem. Example: 400 - `detail` (string) A human readable explanation specific to this occurrence of the problem. Example: "string" - `instance` (string) An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. Example: "https://api.conundra.eu/orderbook/v1/orders/deliveries/chilled" - `violations` (array) - `violations.field` (string) A reference to the field in the request that triggered this violation. Example: "class.field" - `violations.message` (string) A message explaining the violation in the referenced field. Example: "a violation message" ## Response 412 fields (application/problem+json): - `type` (string) An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). Example: "https://api.conundra.eu/problem/constraint-violation" - `title` (string) A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable Example: "Invalid ..." - `status` (integer) The HTTP status code generated by the origin server for this occurrence of the problem. Example: 400 - `detail` (string) A human readable explanation specific to this occurrence of the problem. Example: "string" - `instance` (string) An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. Example: "https://api.conundra.eu/orderbook/v1/orders/deliveries/chilled" - `violations` (array) - `violations.field` (string) A reference to the field in the request that triggered this violation. Example: "class.field" - `violations.message` (string) A message explaining the violation in the referenced field. Example: "a violation message" ## Response default fields (application/problem+json): - `type` (string) An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). Example: "https://api.conundra.eu/problem/constraint-violation" - `title` (string) A short, summary of the problem type. Written in english and readable for engineers (usually not suited for non technical stakeholders and not localized); example: Service Unavailable Example: "Invalid ..." - `status` (integer) The HTTP status code generated by the origin server for this occurrence of the problem. Example: 400 - `detail` (string) A human readable explanation specific to this occurrence of the problem. Example: "string" - `instance` (string) An absolute URI that identifies the specific occurrence of the problem. It may or may not yield further information if dereferenced. Example: "https://api.conundra.eu/orderbook/v1/orders/deliveries/chilled" - `violations` (array) - `violations.field` (string) A reference to the field in the request that triggered this violation. Example: "class.field" - `violations.message` (string) A message explaining the violation in the referenced field. Example: "a violation message" ## Response 204 fields