Skip to main content

Get Company

Retrieves the details of a single company, including its company group, payment settings, parent companies and all of its billing and shipping addresses.

HTTP Request​

  • URL: /companies/{id}
  • Method: GET
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_COMPANY or READ_WRITE_COMPANY

Path Parameters​

ParameterTypeDescription
idStringThe ID of the company to retrieve.

cURL Example​

curl --location '<BASE_URL>/companies/66b9b3b166169eecd60e5ba8' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The company was returned successfully.
  • 400 Bad Request: The access token is missing or invalid, or the company ID is not valid.
  • 404 Not Found: No company matches the ID.

Sample JSON Response​

{
"success": true,
"data": {
"id": "66b9b3b166169eecd60e5ba8",
"entityId": 22,
"name": "Keystone Building Supply",
"email": "purchasing@keystonebuild.com",
"phoneNumber": "9085551234",
"status": "active",
"notes": "Net 30 approved by finance.",
"logo": null,
"isLock": false,
"priceLists": ["66ad153dbf8641f96544341d"],
"companyGroup": {
"_id": "66a6dd927d6c18df2d9eb836",
"name": "Wholesale",
"priceList": "66ad153dbf8641f96544341d",
"status": true,
"createdAt": "2024-07-29T00:08:50.416Z",
"updatedAt": "2024-10-03T11:07:39.111Z"
},
"productGroups": {
"groups": [
{
"productGroup": "66cda944ee801563b8eec563",
"type": "include"
}
],
"restrictStoreProductVisibility": false
},
"shippingMethods": [],
"paymentMethods": ["6650a1c2e4b0a1b2c3d4e5f6"],
"paymentAccess": {
"mode": "selected",
"methods": [
{
"method": "6650a1c2e4b0a1b2c3d4e5f6",
"types": ["card", "us_bank_account"]
}
]
},
"paymentTerms": [
{
"paymentTerm": "6650a2d3e4b0a1b2c3d4e5f7",
"depositRequired": false,
"depositPercentage": 0
}
],
"isSubCompany": true,
"parents": ["66b9b3b166169eecd60e5b10"],
"parentId": "66b9b3b166169eecd60e5b10",
"parentIds": ["66b9b3b166169eecd60e5b10"],
"isTaxExempt": false,
"taxExemptCode": "",
"taxExemptFileUrl": null,
"warehouses": [],
"metaFields": [],
"createdBy": {
"id": "64f0a70c6212cdcbe89a2402",
"name": "ERP integration",
"type": "api"
},
"createdAt": "2024-08-12T07:03:13.111Z",
"updatedAt": "2024-10-09T13:05:59.036Z",
"shippingAddress": [
{
"id": "66b9b3b166169eecd60e5baa",
"company": "66b9b3b166169eecd60e5ba8",
"type": "shipping",
"firstName": "John",
"lastName": "Doe",
"address1": "3700 Old Seward Hwy",
"address2": "",
"phoneNumber": "9075615173",
"city": "Anchorage",
"state": { "name": "Alaska", "code": "AK" },
"country": { "name": "United States", "code": "US" },
"zipcode": "99503",
"isDefaultAddress": true,
"status": true,
"metaFields": [],
"createdAt": "2024-08-23T13:27:13.715Z",
"updatedAt": "2024-08-23T13:27:13.715Z"
}
],
"billingAddress": [
{
"id": "66b9b3b166169eecd60e5ba9",
"company": "66b9b3b166169eecd60e5ba8",
"type": "billing",
"firstName": "John",
"lastName": "Doe",
"address1": "102 East Green Milton Road",
"address2": "",
"phoneNumber": "9085551234",
"city": "Elizabeth",
"state": { "name": "New Jersey", "code": "NJ" },
"country": { "name": "United States", "code": "US" },
"zipcode": "07202",
"isDefaultAddress": true,
"status": true,
"metaFields": [],
"createdAt": "2024-08-12T07:03:13.111Z",
"updatedAt": "2024-08-12T07:03:13.111Z"
}
]
}
}

Response Details​

Company Data​

FieldTypeDescription
idStringUnique identifier of the company.
entityIdNumberSequential company number.
nameStringName of the company.
emailStringEmail address of the company.
phoneNumberStringPhone number of the company.
statusStringpending, active or inactive. Default is pending.
notesStringInternal notes about the company.
logoStringURL of the company logo, or null.
isLockBooleanWhether the company is locked. Default is false.
priceListsArrayIDs of the price lists assigned to the company.
companyGroupObjectThe company group the company belongs to, if any.
productGroupsObjectProduct visibility rules for the company. See below.
shippingMethodsArrayIDs of the shipping methods assigned to the company.
paymentMethodsArrayIDs of the payment methods allowed for the company.
paymentAccessObjectPayment method access rule for the company. See below.
paymentTermsArrayPayment terms of the company. See below.
isSubCompanyBooleantrue when the company has at least one parent. Read-only: it follows parentIds and cannot be set through the API.
parentsArrayIDs of every company that has this company as a direct sub-company. Same values and order as parentIds.
parentIdStringDeprecated. Use parentIds. Returns the first parent in parentIds (parentIds[0], the oldest link), or null. A company can have several parents, so this is not "the" parent.
parentIdsArraySame as parents. Prefer this name in new integrations. Oldest link first.
isTaxExemptBooleanWhether the company is tax exempt. Default is false.
taxExemptCodeStringTax exemption code.
taxExemptFileUrlStringURL of the tax exemption certificate, or null.
warehousesArrayIDs of the warehouses assigned to the company.
budgetObjectBudget settings (enabled, amount, period), when a budget is set.
metaFieldsArrayCustom field values. See Metafields.
createdByObjectWho created the company (id, name, type).
createdAtStringDate and time the company was created (ISO 8601).
updatedAtStringDate and time the company was last updated (ISO 8601).
shippingAddressArrayShipping addresses of the company. See below.
billingAddressArrayBilling addresses of the company. See below.

Product Groups Object​

FieldTypeDescription
groupsArrayProduct group rules. Each has productGroup (ID) and type (include or exclude).
restrictStoreProductVisibilityBooleanWhen true, the company only sees products allowed by these rules.

Payment Access Object​

FieldTypeDescription
modeStringinherit uses the company group or store setting. selected allows only the listed methods.
methodsArrayAllowed methods. Each has method (payment method ID) and types (allowed payment types, empty for all).

Payment Terms Object​

FieldTypeDescription
paymentTermStringID of the payment term.
depositRequiredBooleanWhether a deposit is required. Default is false.
depositPercentageNumberDeposit percentage. Default is 0.

Address Object​

FieldTypeDescription
idStringUnique identifier of the address.
companyStringID of the company the address belongs to.
typeStringshipping or billing.
companyNameStringCompany name shown on the address.
companyEmailStringEmail address for the address.
firstNameStringFirst name of the contact.
lastNameStringLast name of the contact.
address1StringAddress line 1.
address2StringAddress line 2.
phoneNumberStringPhone number of the contact.
cityStringCity.
stateObjectState name and code.
countryObjectCountry name and code.
zipcodeStringPostal code.
isDefaultAddressBooleanWhether this is the default address of its type.
statusBooleanWhether the address is active.
metaFieldsArrayCustom field values.
createdAtStringDate and time the address was created (ISO 8601).
updatedAtStringDate and time the address was last updated (ISO 8601).

Notes​

danger

parentId is deprecated. It always equals parentIds[0], so it hides every other parent of a company that has several. Read parentIds instead. An integration that reads parentId for a company with several parents may see a different value than before: it is now always the first parent in parentIds.

A company with two parents returns:

{
"isSubCompany": true,
"parents": ["66b9b3b166169eecd60e5b10", "66b9b3b166169eecd60e5b11"],
"parentId": "66b9b3b166169eecd60e5b10",
"parentIds": ["66b9b3b166169eecd60e5b10", "66b9b3b166169eecd60e5b11"]
}