Company
Requires access scope or access scope. Also: The shop must have access to B2B. Some operations may require additional plan capabilities.
A business entity that purchases from the shop as part of B2B commerce.
Companies organize multiple locations and contacts who can place orders on
behalf of the organization.
objects can have custom pricing through Catalog and
configurations.
Anchor to FieldsFields
- contactRoles (CompanyContactRoleConnection!)
- contacts (CompanyContactConnection!)
- contactsCount (Count)
- createdAt (DateTime!)
- customerSince (DateTime!)
- defaultCursor (String!)
- defaultRole (CompanyContactRole)
- draftOrders (DraftOrderConnection!)
- events (EventConnection!)
- externalId (String)
- hasTimelineComment (Boolean!)
- id (ID!)
- lifetimeDuration (String!)
- locations (CompanyLocationConnection!)
- locationsCount (Count)
- mainContact (CompanyContact)
- metafield (Metafield)
- metafields (MetafieldConnection!)
- name (String!)
- note (String)
- orders (OrderConnection!)
- ordersCount (Count)
- totalSpent (MoneyV2!)
- updatedAt (DateTime!)
- Anchor to contactRolescontact•Company
Roles Contact Role Connection! non-null The list of roles for the company contacts.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Company
Key Contact Role Sort Keys Default:ID Sort the underlying list by the given key.
Arguments
- Anchor to contactscontacts•Company
Contact Connection! non-null The list of contacts in the company.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators.
name type description acceptable_values default_value example_use default string Filter by a case-insensitive search of multiple fields in a document. - query=Bob Norman
-query=title:green hoodiecompany_id id company_location_id id created_at time email string id id Filter by idrange.- id:1234
-id:>=1234
-id:<=1234location_name string name string role_name string status string updated_at time You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). - Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Company
Key Contact Sort Keys Default:ID Sort the underlying list by the given key.
Arguments
- Anchor to contactsCountcontacts•Count
Count The number of contacts that belong to the company.
- Anchor to createdAtcreated•Date
At Time! non-null The date and time (ISO 8601 format) at which the company was created in Shopify.
- Anchor to customerSincecustomer•Date
Since Time! non-null The date and time (ISO 8601 format) at which the company became the customer.
- Anchor to defaultCursordefault•String!
Cursor non-null A default cursor that returns the single next record, sorted ascending by ID.
- Anchor to defaultRoledefault•Company
Role Contact Role The role proposed by default for a contact at the company.
- Anchor to draftOrdersdraft•Draft
Orders Order Connection! non-null The list of the company's draft orders.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators.
name type description acceptable_values default_value example_use default string Filter by a case-insensitive search of multiple fields in a document. - query=Bob Norman
-query=title:green hoodiecreated_at time customer_id id id id Filter by idrange.- id:1234
-id:>=1234
-id:<=1234source string status string tag string updated_at time You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). - Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Draft
Key Order Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
Arguments
- Anchor to eventsevents•Event
Connection! non-null The paginated list of events associated with the host subject.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators. | comments | boolean | Whether or not to include comment-events in your search, passing
falsewill exclude comment-events, any other value will include comment-events. | | | -false
-true| | created_at | time | Filter by the date and time when the event occurred. Event data is retained for 1 year. | | | -
-| | id | id | Filter byidrange. | | | -id:1234
-id:>=1234
-id:<=1234| | subject_type | string | The resource type affected by this event. See EventSubjectType for possible values. | | | -
-
-| You can apply one or more filters to a query. Learn more about Shopify API search syntax.- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Event
Key Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
Arguments
- Anchor to externalIdexternal•String
Id A unique externally-supplied ID for the company.
- Anchor to hasTimelineCommenthas•Boolean!
Timeline Comment non-null Whether the merchant added a timeline comment to the company.
- •ID!non-null
A globally-unique ID.
- Anchor to lifetimeDurationlifetime•String!
Duration non-null The lifetime duration of the company, since it became a customer of the shop. Examples:
2 days,3 months,1 year.- Anchor to locationslocations•Company
Location Connection! non-null The list of locations in the company.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators.
name type description acceptable_values default_value example_use default string Filter by a case-insensitive search of multiple fields in a document. - query=Bob Norman
-query=title:green hoodiecompany_id id created_at time external_id string id id Filter by idrange.- id:1234
-id:>=1234
-id:<=1234ids string metafields.{namespace}.{key} mixed Filters resources by metafield value. Format: metafields.{namespace}.{key}:{value}. Learn more aboutquerying by metafield value. -
-name string updated_at time You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). - Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Company
Key Location Sort Keys Default:ID Sort the underlying list by the given key.
Arguments
- Anchor to locationsCountlocations•Count
Count The number of locations that belong to the company.
- Anchor to mainContactmain•Company
Contact Contact The main contact for the company.
- Anchor to metafieldmetafield•Metafield
A custom field, including its
namespaceandkey, that's associated with a Shopify resource for the purposes of adding and storing additional information.- •String!required
The key for the metafield.
- Anchor to namespacenamespace•String
The container the metafield belongs to. If omitted, the app-reserved namespace will be used.
Arguments
- •String!
- Anchor to metafieldsmetafields•Metafield
Connection! non-null A list of custom fields that a merchant associates with a Shopify resource.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to keyskeys•[String!]
List of keys of metafields in the format
namespace.key, will be returned in the same format.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to namespacenamespace•String
The metafield namespace to filter by. If omitted, all metafields are returned.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
Arguments
- Anchor to namename•String!non-null
The name of the company.
- Anchor to notenote•String
A note about the company.
- Anchor to ordersorders•Order
Connection! non-null The list of the company's orders.
- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Order
Key Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
Arguments
- Anchor to ordersCountorders•Count
Count The total number of orders placed for this company, across all its locations.
- Anchor to totalSpenttotal•Money
Spent V2! non-null The total amount spent by this company, across all its locations.
- Anchor to updatedAtupdated•Date
At Time! non-null The date and time (ISO 8601 format) at which the company was last modified.
Deprecated fields
- contactCount (Int!): deprecated
- metafieldDefinitions (MetafieldDefinitionConnection!): deprecated
- Anchor to contactCountcontact•Int!
Count non-nullDeprecated - Anchor to metafieldDefinitionsmetafield•Metafield
Definitions Definition Connection! non-nullDeprecated - Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to namespacenamespace•String
Filter metafield definitions by namespace.
- Anchor to pinnedStatuspinned•Metafield
Status Definition Pinned Status Default:ANY Filter by the definition's pinned status.
- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators.
name type description acceptable_values default_value example_use default string Filter by a case-insensitive search of multiple fields in a document. - query=Bob Norman
-query=title:green hoodiecreated_at time Filter by the date and time when the metafield definition was created. -
-
-id id Filter by idrange.- id:1234
-id:>=1234
-id:<=1234key string Filter by the metafield definition keyfield. - key:some-keynamespace string Filter by the metafield definition namespacefield. - namespace:some-namespaceowner_type string Filter by the metafield definition field. - type string Filter by the metafield definition typefield. - updated_at time Filter by the date and time when the metafield definition was last updated. -
-| You can apply one or more filters to a query. Learn more about Shopify API search syntax.
- Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Metafield
Key Definition Sort Keys Default:ID Sort the underlying list using a key. If your query is slow or returns an error, then try specifying a sort key that matches the field used in the search.
Arguments
Anchor to QueriesQueries
- companies (CompanyConnection!)
- company (Company)
- •query
A paginated list of companies in the shop.
Companyobjects are business entities that purchase from the merchant.Use the
queryargument to filter companies by attributes like name or externalId. Sort and paginate results to handle large datasets efficiently. Learn more about Shopify API search syntax.- Anchor to afterafter•String
The elements that come after the specified cursor.
- Anchor to beforebefore•String
The elements that come before the specified cursor.
- Anchor to firstfirst•Int
The first
nelements from the paginated list.- Anchor to lastlast•Int
The last
nelements from the paginated list.- Anchor to queryquery•String
A filter made up of terms, connectives, modifiers, and comparators.
name type description acceptable_values default_value example_use default string Filter by a case-insensitive search of multiple fields in a document. - query=Bob Norman
-query=title:green hoodieactive_customers_count integer created_at time external_id id id id Filter by idrange.- id:1234
-id:>=1234
-id:<=1234metafields.{namespace}.{key} mixed Filters resources by metafield value. Format: metafields.{namespace}.{key}:{value}. Learn more aboutquerying by metafield value. -
-name string ordering_status string since_date time updated_at time You can apply one or more filters to a query. Learn more about [Shopify API search syntax](https://shopify.dev/api/usage/search-syntax). - Anchor to reversereverse•BooleanDefault:false
Reverse the order of the underlying list.
- Anchor to sortKeysort•Company
Key Sort Keys Default:ID Sort the underlying list by the given key.
Arguments
- •query
Returns a
Companyresource by ID.- •ID!required
The ID of the
Companyto return.
Arguments
- •ID!
Anchor to MutationsMutations
- companyAssignMainContact (CompanyAssignMainContactPayload)
- companyCreate (CompanyCreatePayload)
- companyRevokeMainContact (CompanyRevokeMainContactPayload)
- companyUpdate (CompanyUpdatePayload)
- •mutation
Assigns the main contact for the company.
- Anchor to companyContactIdcompany•ID!
Contact Id required The ID of the company contact to be assigned as the main contact.
- Anchor to companyIdcompany•ID!
Id required The ID of the company to assign the main contact to.
Arguments
- •mutation
Creates a
Companyfor B2B commerce. This mutation creates the company and can optionally create an initialandin a single operation. Company contacts are people who place orders on behalf of the company. Company locations are branches or offices with their own billing and shipping addresses.NoteCreating a company without a
namereturns an error.Note:Creating a company without a
namereturns an error.Note: Creating a company without a <code>name</code> <a href="https://shopify.dev/docs/api/admin-graphql/latest/mutations/companycreate?example=creating-a-company-without-a-name-returns-an-error">returns an error</a>.
Learn more about creating companies for B2B.
- Anchor to inputinput•Company
Create Input! required The fields to use when creating the company.
Arguments
- •mutation
Revokes the main contact from the company.
- Anchor to companyIdcompany•ID!
Id required The ID of the company to revoke the main contact from.
Arguments
- •mutation
Updates a
Companywith new information. Companies represent business customers that can have multiple contacts and locations with specific pricing, payment terms, and checkout settings.The mutation accepts the company's ID and an input object containing the fields to update. You can modify the company name, add or update internal notes, set an external ID for integration with other systems, or adjust the customer relationship start date.
Learn more about building B2B features.
- Anchor to companyIdcompany•ID!
Id required The ID of the company to be updated.
- Anchor to inputinput•Company
Input! required The input fields to update the company.
Arguments
Anchor to InterfacesInterfaces
- CommentEventSubject
- HasEvents
- HasMetafieldDefinitions
- HasMetafields
- Navigable
- Node
- •interface
- •interface
- •interface
- •interface
- •interface