Skip to main content

Update Company

This PUT endpoint updates the details of an existing company identified by its unique ID.

Endpoint

  • URL: /companies/{company_id/email}
  • Method: PUT

Path Parameters

ParameterTypeDescription
company_id/emailstringThe unique identifier of the company to be updated.

Authentication

  • Header: accessToken
  • Type: Bearer Token
  • Value: <ACCESS-TOKEN>

Request Headers

HeaderTypeDescription
Content-TypestringMust be application/json.
accessTokenstringAccess token for authentication. (required)

Request Body

The request body should be a JSON object containing fields to update for the company.

FieldTypeDescription
namestringThe name of the company. Required.
emailstringThe email address associated with the company. Required.
phoneNumberstringThe primary contact number for the company. Required.
statusstringCurrent status of the company (e.g., "active"). Required.
shippingAddressarrayAn array of objects representing the company's shipping addresses.
billingAddressarrayAn array of objects representing the company's billing addresses.
paymentMethodsArrayAn array containing ids of payment method.
paymentTermsArrayAn array containing details of payment terms.
isTaxExemptBooleanDoes company is Tax Exempt
metaFieldsarrayAn array of meta-information fields for the company.
notesstringOptional field for additional notes on the company.

Address Structure

For both shippingAddress and billingAddress:

FieldTypeDescription
companyNamestringCompany name of this contact (Optional).
companyEmailstringCompany email of the contact (Optional)
firstNamestringFirst name of the contact person at this address.
lastNamestringLast name of the contact person at this address.
address1stringPrimary address line.
address2stringSecondary address line. Optional.
citystringCity of the address.
statestringState code of the address (e.g., "NJ").
countrystringCountry code of the address (e.g., "US").
zipcodestringPostal code of the address.
phoneNumberstringContact phone number for the address.
isDefaultAddressbooleanIndicates whether this address is the default for shipping addresses.
metaFieldsarrayMeta-information related to the address, such as p21_shipto_id.
addressIdidAddressId of either billing / shipping regarding to the address updating.

Payment Terms

FieldTypeDescription
paymentTermidId of payment Term.
depositRequiredbooleanIs deposit required for placing order
depositPercentagenumberDeposit percentage need to place order

Sample Request Body

{
"name": "spruce",
"email": "John@aximcommerce.com",
"phoneNumber": "65161861",
"status": "active"
}

Response

  • Status Code: 200 OK

Success Response Body

A successful response will confirm the update of the company details:

{
"success": true,
"message": "Company updated successfully",
"data": {
"id": "637e18fc741020de0693227a"
// other company details...
}
}

Error Responses

Status CodeDescription
400 Bad RequestThe request body contains invalid data or is missing required fields.
401 UnauthorizedThe access token is invalid or missing.
404 Not FoundNo company matches the specified company_id/email.
500 Internal Server ErrorAn error occurred on the server.

Notes

  • Ensure the company_id/email in the URL is replaced with the actual ID/email of the company you wish to update.
  • Only provide fields in the request body that need to be updated.
  • Confirm the access token is active and valid.