Skip to content

Upsert a company by Id

Request

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.

Security
clientCredentials
Path
business_idstring^[a-zA-Z0-9.~\-_]{1,512}$required

The business identifier of an entity instance

Headers
PreferArray of strings

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=<minimal|representation> 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-Matchstring

weak Etag as optimistic locking check

Bodyapplication/jsonrequired
business_idstring^[a-zA-Z0-9.~\-_]+$

A unique reference ID

Example:"624ec196-4c5c-4fb4-bb43-9ffd8a6b8844"
namestring

The name of this Company

Example:"a name"
Payload
{ "business_id": "624ec196-4c5c-4fb4-bb43-9ffd8a6b8844", "name": "a name" }

Responses

OK

Headers
ETagstring

weak Etag (ex W/<etag_value>) which contains the (updated) version of the entity

Preference-Appliedstring

to indicate whether a preference has been applied. (ex Preference-Applied: return=representation)

Bodyapplication/json
business_idstring^[a-zA-Z0-9.~\-_]+$

A unique reference ID

Example:"624ec196-4c5c-4fb4-bb43-9ffd8a6b8844"
namestring

The name of this Company

Example:"a name"
Response
{ "business_id": "624ec196-4c5c-4fb4-bb43-9ffd8a6b8844", "name": "a name" }