Skip to main content
object

Requires read_customers access scope or read_companies access scope. Also: The API client must be installed on a Shopify Plus store.

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. CompanyLocation objects can have custom pricing through Catalog and PriceList configurations.

•CompanyContactRoleConnection!
non-null

The list of roles for the company contacts.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•CompanyContactRoleSortKeys
Default:ID

Sort the underlying list by the given key.


•CompanyContactConnection!
non-null

The list of contacts in the company.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•CompanyContactSortKeys
Default:ID

Sort the underlying list by the given key.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to company_id
•id
Anchor to company_location_id
•id
Anchor to created_at
•time
•string
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to location_name
•string
•string
Anchor to role_name
•string
•string
Anchor to updated_at
•time

•Count

The number of contacts that belong to the company.

•DateTime!
non-null

The date and time (ISO 8601 format) at which the company was created in Shopify.

•DateTime!
non-null

The date and time (ISO 8601 format) at which the company became the customer.

•String!
non-null

A default cursor that returns the single next record, sorted ascending by ID.

•CompanyContactRole

The role proposed by default for a contact at the company.

•DraftOrderConnection!
non-null

The list of the company's draft orders.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•DraftOrderSortKeys
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.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to created_at
•time
Anchor to customer_id
•id
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
•string
•string
•string
Anchor to updated_at
•time

•EventConnection!
non-null

The paginated list of events associated with the host subject.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•EventSortKeys
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.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

•string

The action that occured.

Example:

  • action:create
Anchor to comments
•boolean

Whether or not to include comment-events in your search, passing false will exclude comment-events, any other value will include comment-events.

Example:

  • false
  • true
Anchor to created_at
•time

Filter by the date and time when the event happened.

Example:

  • created_at:>2020-10-21
  • created_at:<now
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to subject_type
•string

The resource type affected by this event. See EventSubjectType for possible values.

Example:

  • PRODUCT_VARIANT
  • PRODUCT
  • COLLECTION

•String

A unique externally-supplied ID for the company.

•Boolean!
non-null

Whether the merchant added a timeline comment to the company.

•ID!
non-null

A globally-unique ID.

•String!
non-null

The lifetime duration of the company, since it became a customer of the shop. Examples: 2 days, 3 months, 1 year.

•CompanyLocationConnection!
non-null

The list of locations in the company.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•CompanyLocationSortKeys
Default:ID

Sort the underlying list by the given key.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to company_id
•id
Anchor to created_at
•time
Anchor to external_id
•string
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
•string
Anchor to metafields.{namespace}.{key}
•mixed

Filters resources by metafield value. Format: metafields.{namespace}.{key}:{value}. Learn more about querying by metafield value.

Example:

  • metafields.custom.on_sale:true
  • metafields.product.material:"gid://shopify/Metaobject/43458085"
•string
Anchor to updated_at
•time

•Count

The number of locations that belong to the company.

•CompanyContact

The main contact for the company.

•Metafield

A custom field, including its namespace and key, that's associated with a Shopify resource for the purposes of adding and storing additional information.

Arguments

•String

The container the metafield belongs to. If omitted, the app-reserved namespace will be used.

•String!
required

The key for the metafield.


•MetafieldConnection!
non-null

A list of custom fields that a merchant associates with a Shopify resource.

Arguments

•String

The metafield namespace to filter by. If omitted, the app-reserved namespace will be used.

•[String!]

List of keys of metafields in the format namespace.key, will be returned in the same format.

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.


•String!
non-null

The name of the company.

•String

A note about the company.

•OrderConnection!
non-null

The list of the company's orders.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•OrderSortKeys
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.


•Count

The total number of orders placed for this company, across all its locations.

•MoneyV2!
non-null

The total amount spent by this company, across all its locations.

•DateTime!
non-null

The date and time (ISO 8601 format) at which the company was last modified.

Deprecated fields

•Int!
non-nullDeprecated
Anchor to metafieldDefinitionsmetafieldDefinitions
•MetafieldDefinitionConnection!
non-nullDeprecated

Arguments

•String

Filter metafield definitions by namespace.

•MetafieldDefinitionPinnedStatus
Default:ANY

Filter by the definition's pinned status.

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•MetafieldDefinitionSortKeys
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.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to created_at
•time

Filter by the date and time when the metafield definition was created.

Example:

  • created_at:>2020-10-21T23:39:20Z
  • created_at:<now
  • created_at:<=2024
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
•string

Filter by the metafield definition key field.

Example:

  • key:some-key
Anchor to namespace
•string

Filter by the metafield definition namespace field.

Example:

  • namespace:some-namespace
Anchor to owner_type
•string

Filter by the metafield definition ownerType field.

Example:

  • owner_type:PRODUCT
•string

Filter by the metafield definition type field.

Example:

  • type:single_line_text_field
Anchor to updated_at
•time

Filter by the date and time when the metafield definition was last updated.

Example:

  • updated_at:>2020-10-21T23:39:20Z
  • updated_at:<now
  • updated_at:<=2024


Was this section helpful?

•query

A paginated list of companies in the shop. Company objects are business entities that purchase from the merchant.

Use the query argument 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.

Arguments

•Int

The first n elements from the paginated list.

•String

The elements that come after the specified cursor.

•Int

The last n elements from the paginated list.

•String

The elements that come before the specified cursor.

•Boolean
Default:false

Reverse the order of the underlying list.

•CompanySortKeys
Default:ID

Sort the underlying list by the given key.

•String

A filter made up of terms, connectives, modifiers, and comparators. You can apply one or more filters to a query. Learn more about Shopify API search syntax.

Anchor to default
•string

Filter by a case-insensitive search of multiple fields in a document.

Example:

  • query=Bob Norman
  • query=title:green hoodie
Anchor to active_customers_count
•integer
Anchor to created_at
•time
Anchor to external_id
•id
•id

Filter by id range.

Example:

  • id:1234
  • id:>=1234
  • id:<=1234
Anchor to metafields.{namespace}.{key}
•mixed

Filters resources by metafield value. Format: metafields.{namespace}.{key}:{value}. Learn more about querying by metafield value.

Example:

  • metafields.custom.on_sale:true
  • metafields.product.material:"gid://shopify/Metaobject/43458085"
•string
Anchor to since_date
•time
Anchor to updated_at
•time

•query

Returns a Company resource by ID.

Arguments

•ID!
required

The ID of the Company to return.



Was this section helpful?

•mutation

Assigns the main contact for the company.

Arguments

•ID!
required

The ID of the company to assign the main contact to.

•ID!
required

The ID of the company contact to be assigned as the main contact.


•mutation

Creates a Company for B2B commerce. This mutation creates the company and can optionally create an initial CompanyContact and CompanyLocation in 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.


Note

Creating a company without a name returns an error.


Learn more about creating companies for B2B.

Arguments

•CompanyCreateInput!
required

The fields to use when creating the company.


•mutation

Revokes the main contact from the company.

Arguments

•ID!
required

The ID of the company to revoke the main contact from.


•mutation

Updates a Company with 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.

Arguments

•ID!
required

The ID of the company to be updated.

•CompanyInput!
required

The input fields to update the company.



Was this section helpful?