Skip to main content
PUT
/
api
/
adm
/
companies
/
{id}
Update Company
curl --request PUT \
  --url https://localhost:44371/api/adm/companies/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "companyName": "<string>",
  "id": "<string>"
}
'
{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Description

Modifies an existing company’s details. This operation supports partial updates - only fields included in the request will be modified. Common use cases include updating billing addresses, contact information, changing company status (active/inactive), or renaming the company.

Input

  • Path Parameter: id (guid, required) — Unique identifier of the company to update.
  • Body: model (CompanyUpdateCommandRequest, required) — Updated company information including:
    • name (string, optional) — New company name.
    • contactEmail (string, optional) — Updated contact email.
    • contactPhone (string, optional) — Updated contact phone.
    • isActive (bool, optional) — Active status.

Output

Returns a CompanyUpdateCommandResponse indicating whether the update was successful.

Example Request

PUT /api/admin/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6
Content-Type: application/json
Authorization: Bearer {token}

{
  "name": "Acme Corporation Ltd",
  "contactEmail": "[email protected]",
  "contactPhone": "555-0199",
  "isActive": true
}

Example Response

{
  "success": true,
  "code": 200,
  "errorMessage": null
}

Errors

  • 400 Bad Request — Validation errors, invalid field values, duplicate company name, or field exceeds maximum length.
  • 404 Not Found — No company exists with the specified ID.

Notes

  • Setting isActive to false will prevent all users from accessing the company.
  • Inactive companies cannot process new transactions.
  • Changing the company name does not affect existing transactions or historical data.

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

id
string<guid>
required

The unique identifier of the company to update.

Body

application/json

The updated company information (name, address, contact details, status).

Represents a request to update an existing company entry. Used by company management endpoints when editing basic company profile information.

companyName
string
required

Company Name

Maximum string length: 50
id
string<guid>

The identifier of the company being updated. Determines which company record receives the changes submitted by the administrator.

Response

Always returned. Check the success property in the response body to determine if the operation succeeded.

Standard response structure containing operation status and error information. Standard command response indicating the result of a data modification. Represents the response returned after updating a company entry. Confirms completion of the company update without returning additional payload data.

success
boolean

True if the operation completed successfully; false if an error occurred.

Example:

true

code
enum<string>

Result code indicating the outcome of the operation.

Available options:
Unknown,
Success,
BadRequest,
Unauthorized,
NotFound,
Error
Example:

200

errorMessage
string | null

Human-readable error message when an error occurs.

Example:

null