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_COMPANYorREAD_WRITE_COMPANY
Path Parameters
| Parameter | Type | Description |
|---|---|---|
id | String | The 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
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the company. |
entityId | Number | Sequential company number. |
name | String | Name of the company. |
email | String | Email address of the company. |
phoneNumber | String | Phone number of the company. |
status | String | pending, active or inactive. Default is pending. |
notes | String | Internal notes about the company. |
logo | String | URL of the company logo, or null. |
isLock | Boolean | Whether the company is locked. Default is false. |
priceLists | Array | IDs of the price lists assigned to the company. |
companyGroup | Object | The company group the company belongs to, if any. |
productGroups | Object | Product visibility rules for the company. See below. |
shippingMethods | Array | IDs of the shipping methods assigned to the company. |
paymentMethods | Array | IDs of the payment methods allowed for the company. |
paymentAccess | Object | Payment method access rule for the company. See below. |
paymentTerms | Array | Payment terms of the company. See below. |
isSubCompany | Boolean | true when the company has at least one parent. Read-only: it follows parentIds and cannot be set through the API. |
parents | Array | IDs of every company that has this company as a direct sub-company. Same values and order as parentIds. |
parentId | String | Deprecated. 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. |
parentIds | Array | Same as parents. Prefer this name in new integrations. Oldest link first. |
isTaxExempt | Boolean | Whether the company is tax exempt. Default is false. |
taxExemptCode | String | Tax exemption code. |
taxExemptFileUrl | String | URL of the tax exemption certificate, or null. |
warehouses | Array | IDs of the warehouses assigned to the company. |
budget | Object | Budget settings (enabled, amount, period), when a budget is set. |
metaFields | Array | Custom field values. See Metafields. |
createdBy | Object | Who created the company (id, name, type). |
createdAt | String | Date and time the company was created (ISO 8601). |
updatedAt | String | Date and time the company was last updated (ISO 8601). |
shippingAddress | Array | Shipping addresses of the company. See below. |
billingAddress | Array | Billing addresses of the company. See below. |
Product Groups Object
| Field | Type | Description |
|---|---|---|
groups | Array | Product group rules. Each has productGroup (ID) and type (include or exclude). |
restrictStoreProductVisibility | Boolean | When true, the company only sees products allowed by these rules. |
Payment Access Object
| Field | Type | Description |
|---|---|---|
mode | String | inherit uses the company group or store setting. selected allows only the listed methods. |
methods | Array | Allowed methods. Each has method (payment method ID) and types (allowed payment types, empty for all). |
Payment Terms Object
| Field | Type | Description |
|---|---|---|
paymentTerm | String | ID of the payment term. |
depositRequired | Boolean | Whether a deposit is required. Default is false. |
depositPercentage | Number | Deposit percentage. Default is 0. |
Address Object
| Field | Type | Description |
|---|---|---|
id | String | Unique identifier of the address. |
company | String | ID of the company the address belongs to. |
type | String | shipping or billing. |
companyName | String | Company name shown on the address. |
companyEmail | String | Email address for the address. |
firstName | String | First name of the contact. |
lastName | String | Last name of the contact. |
address1 | String | Address line 1. |
address2 | String | Address line 2. |
phoneNumber | String | Phone number of the contact. |
city | String | City. |
state | Object | State name and code. |
country | Object | Country name and code. |
zipcode | String | Postal code. |
isDefaultAddress | Boolean | Whether this is the default address of its type. |
status | Boolean | Whether the address is active. |
metaFields | Array | Custom field values. |
createdAt | String | Date and time the address was created (ISO 8601). |
updatedAt | String | Date and time the address was last updated (ISO 8601). |
Notes
shippingAddressandbillingAddressinclude both active and inactive addresses.- To manage addresses, use the Address endpoints.
parentIdandparentIdsare returned by the Get endpoints and by Update Company. Create Company returnsparentsbut notparentIdorparentIds.- Parents are set with
parentCompanieson Update Company, or through the Corporate endpoints. See Corporate Hierarchy and Access.
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"]
}