# Business Units

## GraphQL partial SDLs

This is a graphql reference page. In the llms.txt variant, those components link to the shared partial SDL key list instead of trying to resolve inline GraphQL reference content.

Fetch all available partial SDL keys first:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:returnTypesList
```

Then fetch the one or more relevant partial SDL with a key from that list by calling the same endpoint with a schema ID:

```text
GET https://docs.commercetools.com/apis/rest/content/by-id?id=ctp:gql-sphere:schema:<key>
```

The response body is a JSON object keyed by the requested content ID. For example, the key-list request returns a `ctp:gql-sphere:returnTypesList` field and a schema request returns a `ctp:gql-sphere:schema:<key>` field.

**Queries and mutations for managing Business Units in the platform.**

## Queries

### Query Business Units

[fetch SDL for query businessUnits](#graphql-partial-sdls).

### Get Business Unit

[fetch SDL for query businessUnit](#graphql-partial-sdls).

### Get Associate in Business Unit

[fetch SDL for query associate](#graphql-partial-sdls).

## Mutations

To change a Business Unit, `updateBusinessUnit` takes a list of [update actions](/api/graphql/business-units.md#update-actions). For behavior, see [Business Units](/api/projects/business-units.md) in the HTTP API.

### Create Business Unit

[fetch SDL for mutation createBusinessUnit](#graphql-partial-sdls).

### Update Business Unit

[fetch SDL for mutation updateBusinessUnit](#graphql-partial-sdls).

### Delete Business Unit

[fetch SDL for mutation deleteBusinessUnit](#graphql-partial-sdls).

## Output types

### BusinessUnit

[fetch SDL for type BusinessUnit](#graphql-partial-sdls).

### BusinessUnitQueryResult

[fetch SDL for type BusinessUnitQueryResult](#graphql-partial-sdls).

### BusinessUnitAssociateProjection

[fetch SDL for type BusinessUnitAssociateProjection](#graphql-partial-sdls).

## Input types

### BusinessUnitDraft

[fetch SDL for type BusinessUnitDraft](#graphql-partial-sdls).

### AsAssociateArgument

[fetch SDL for type AsAssociateArgument](#graphql-partial-sdls).

### BusinessUnitUpdateAction

[fetch SDL for type BusinessUnitUpdateAction](#graphql-partial-sdls).

### Update actions

#### Addresses

##### Add Address

[fetch SDL for type AddBusinessUnitAddress](#graphql-partial-sdls).

##### Change Address

[fetch SDL for type ChangeBusinessUnitAddress](#graphql-partial-sdls).

##### Remove Address

[fetch SDL for type RemoveBusinessUnitAddress](#graphql-partial-sdls).

##### Add Billing Address ID

[fetch SDL for type AddBusinessUnitBillingAddressId](#graphql-partial-sdls).

##### Remove Billing Address ID

[fetch SDL for type RemoveBusinessUnitBillingAddressId](#graphql-partial-sdls).

##### Add Shipping Address ID

[fetch SDL for type AddBusinessUnitShippingAddressId](#graphql-partial-sdls).

##### Remove Shipping Address ID

[fetch SDL for type RemoveBusinessUnitShippingAddressId](#graphql-partial-sdls).

##### Set Default Billing Address

[fetch SDL for type SetBusinessUnitDefaultBillingAddress](#graphql-partial-sdls).

##### Set Default Shipping Address

[fetch SDL for type SetBusinessUnitDefaultShippingAddress](#graphql-partial-sdls).

#### Associates

##### Add Associate

[fetch SDL for type AddBusinessUnitAssociate](#graphql-partial-sdls).

##### Change Associate

[fetch SDL for type ChangeBusinessUnitAssociate](#graphql-partial-sdls).

##### Remove Associate

[fetch SDL for type RemoveBusinessUnitAssociate](#graphql-partial-sdls).

##### Set Associates

[fetch SDL for type SetBusinessUnitAssociates](#graphql-partial-sdls).

##### Change Associate Mode

[fetch SDL for type ChangeBusinessUnitAssociateMode](#graphql-partial-sdls).

#### Stores

##### Add Store

[fetch SDL for type AddBusinessUnitStore](#graphql-partial-sdls).

##### Remove Store

[fetch SDL for type RemoveBusinessUnitStore](#graphql-partial-sdls).

##### Set Stores

[fetch SDL for type SetBusinessUnitStores](#graphql-partial-sdls).

##### Set Store Mode

[fetch SDL for type SetBusinessUnitStoreMode](#graphql-partial-sdls).

#### Customer Group Assignments

##### Add Customer Group Assignment

[fetch SDL for type AddCustomerGroupAssignment](#graphql-partial-sdls).

##### Remove Customer Group Assignment

[fetch SDL for type RemoveCustomerGroupAssignment](#graphql-partial-sdls).

##### Set Customer Group Assignments

[fetch SDL for type SetCustomerGroupAssignments](#graphql-partial-sdls).

#### Custom Fields

##### Set Custom Type

[fetch SDL for type SetBusinessUnitCustomType](#graphql-partial-sdls).

##### Set Custom Field

[fetch SDL for type SetBusinessUnitCustomField](#graphql-partial-sdls).

##### Set Address Custom Type

[fetch SDL for type SetBusinessUnitAddressCustomType](#graphql-partial-sdls).

##### Set Address Custom Field

[fetch SDL for type SetBusinessUnitAddressCustomField](#graphql-partial-sdls).

#### Hierarchy and settings

##### Change Name

[fetch SDL for type ChangeBusinessUnitName](#graphql-partial-sdls).

##### Change Parent Unit

[fetch SDL for type ChangeBusinessUnitParentUnit](#graphql-partial-sdls).

##### Change Status

[fetch SDL for type ChangeBusinessUnitStatus](#graphql-partial-sdls).

##### Change Approval Rule Mode

[fetch SDL for type ChangeBusinessUnitApprovalRuleMode](#graphql-partial-sdls).

##### Set Contact Email

[fetch SDL for type SetBusinessUnitContactEmail](#graphql-partial-sdls).

##### Set Unit Type

[fetch SDL for type SetBusinessUnitUnitType](#graphql-partial-sdls).

## Related pages

- [Search documentation and API specs](/search.md)