API reference
All operations
COMPANY

Partially updates a company

List the names of the company fields to change in `UpdatedFields` (case-insensitive); only those fields are written, and unknown names are ignored. Fields that can be updated this way: `CompanyName`, `LegalName`, `AccountNo`, `Status`, `Address1`, `Address2`, `Address3`, `City`, `State`, `Zip`, `County`, `Country`, `Phone`, `Fax`, `Web`, `RecordTypeId`, `SourceId`, `BranchId`, `ParentId`, `Mailing`, `Longitude` and `Latitude`. The address is geocoded again when an address field changes. Other parts of the body are not controlled by `UpdatedFields`: `Udfs` are saved when sent. `AssignedNationalAccountIds` replaces the company's national accounts when sent (an empty list removes them all), and `SourcewellMemberNo`/`SourcewellMembershipDate` update the Sourcewell membership when sent (an empty member number and no date removes it); leave them out to keep the current values. Unless `UpdatedFields` contains `Address1`, non-empty `AssignedCategories` (by ID) and `AssignedRanks` replace the current ones.

PATCH/api/v2/companies/{id}

Authentication

Choose one supported method for this request.

OAuth 2.0 client credentialsAPI key

Parameters

idpathinteger · int32required

The ID of the company to update.

Request body

application/jsonrequired

The fields and values to update, and the list of field names in `UpdatedFields`.

UpdateCompanyRequest
  • updatedFieldsstring[]required
    min items 1
  • sourcewellMemberNostringnullable

    Sourcewell member number. The Sourcewell membership is only changed when this or `SourcewellMembershipDate` is sent; send an empty string and no date to remove it.

  • sourcewellMembershipDatestring · date-timenullable

    Sourcewell membership date. See `SourcewellMemberNo`.

  • assignedNationalAccountIdsinteger[]nullable

    IDs of the company's national accounts. When sent, they replace the current assignments (an empty list removes them all); when omitted, the assignments are left unchanged.

  • mailingboolean
  • longitudenumber · double
  • latitudenumber · double
  • companyNamestring
  • legalNamestringnullable
  • accountNostring
  • statusstring
  • address1string
  • address2string
  • address3string
  • citystring
  • statestring
  • zipstring
  • countystring
  • countrystring
  • phonestring
  • faxstring
  • webstring
  • recordTypeIdinteger · int32
  • branchIdinteger · int32
  • parentIdinteger · int32
  • sourceIdinteger · int32
  • assignedRepPrimaryIdinteger · int32
  • assignedRepSecondaryIdsinteger[]

Responses

Company updated successfully.

Standard response envelopeisSuccessmessageerrorsdata

Read the result from data. When isSuccess is false, errors lists what went wrong. Handling errors

dataCompanyDto
  • companyIdinteger · int32
  • parentIdinteger · int32
  • recordTypeIdinteger · int32
  • branchIdinteger · int32
  • companyNamestring
  • legalNamestring
  • accountNostring
  • address1string
  • address2string
  • address3string
  • citystring
  • statestring
  • zipstring
  • countystring
  • countrystring
  • mailingbooleannullable
  • latitudenumber · double
  • longitudenumber · double
  • phonestring
  • faxstring
  • webstring
  • linkedboolean
  • sourceIdinteger · int32
  • statusstring
  • enteredstring · date-time
  • lastModifiedstring · date-time
  • completeboolean
  • parentNamestring
  • parentAccountNostring
  • assignedRecordTypestring
  • assignedBranchstring
  • assignedNationalAccountsstring
  • assignedNationalAccountIdsstring
  • assignedSourcestring
  • buyIDstring