---
editLink: false
lastUpdated: false
---

[@salesforce/b2c-tooling-sdk](../../../modules.md) / [operations/object-types](../index.md) / ObjectTypesClient

# Class: ObjectTypesClient

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:100](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L100)

Operations over the SCAPI Object Definitions API: system object types,
attribute definitions, and attribute groups.

List methods page through all results. Attribute IDs may be passed with or
without the `c_` prefix.

## Example

```ts
const ot = new ObjectTypesClient(instance.scapiClientConfig!);
const attrs = await ot.listAttributeDefinitions('Product', {kind: 'custom'});
```

## Constructors

### Constructor

> **new ObjectTypesClient**(`config`): `ObjectTypesClient`

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:104](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L104)

#### Parameters

##### config

[`ObjectTypesConfig`](../interfaces/ObjectTypesConfig.md)

#### Returns

`ObjectTypesClient`

## Properties

### client

> `readonly` **client**: [`ObjectDefinitionsClient`](../../../clients/type-aliases/ObjectDefinitionsClient.md)

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:101](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L101)

***

### organizationId

> `readonly` **organizationId**: `string`

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:102](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L102)

## Methods

### assignAttributeToGroup()

> **assignAttributeToGroup**(`objectType`, `groupId`, `attributeId`): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:110](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L110)

Assigns an attribute definition to a group.

#### Parameters

##### objectType

`string`

##### groupId

`string`

##### attributeId

`string`

#### Returns

`Promise`\<`void`\>

***

### createOrReplaceAttributeDefinition()

> **createOrReplaceAttributeDefinition**(`objectType`, `definition`): `Promise`\<\{ `created`: `boolean`; `definition`: \{ \}; \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:128](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L128)

Creates or fully replaces an attribute definition. Properties omitted from
`definition` are reset to their defaults; use
[updateAttributeDefinition](#updateattributedefinition) for partial changes.

#### Parameters

##### objectType

`string`

##### definition

#### Returns

`Promise`\<\{ `created`: `boolean`; `definition`: \{ \}; \}\>

***

### createOrReplaceAttributeGroup()

> **createOrReplaceAttributeGroup**(`objectType`, `group`): `Promise`\<\{ `created`: `boolean`; `group`: \{ \}; \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:145](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L145)

Creates or fully replaces an attribute group. Replacing a group removes
its attribute assignments.

#### Parameters

##### objectType

`string`

##### group

#### Returns

`Promise`\<\{ `created`: `boolean`; `group`: \{ \}; \}\>

***

### deleteAttributeDefinition()

> **deleteAttributeDefinition**(`objectType`, `attributeId`): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:159](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L159)

Deletes a custom attribute definition.

#### Parameters

##### objectType

`string`

##### attributeId

`string`

#### Returns

`Promise`\<`void`\>

***

### deleteAttributeGroup()

> **deleteAttributeGroup**(`objectType`, `groupId`): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:169](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L169)

Deletes an attribute group.

#### Parameters

##### objectType

`string`

##### groupId

`string`

#### Returns

`Promise`\<`void`\>

***

### getAttributeDefinition()

> **getAttributeDefinition**(`objectType`, `attributeId`, `options`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:183](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L183)

Gets one attribute definition. With `includeValues`, uses the search
endpoint so enum `valueDefinitions` are returned (requires `.rw` scope).

#### Parameters

##### objectType

`string`

##### attributeId

`string`

##### options

###### includeValues?

`boolean`

#### Returns

`Promise`\<\{ \}\>

***

### getAttributeGroup()

> **getAttributeGroup**(`objectType`, `groupId`, `options`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:205](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L205)

Gets one attribute group, optionally with its assigned definitions.

#### Parameters

##### objectType

`string`

##### groupId

`string`

##### options

[`ListAttributeGroupsOptions`](../interfaces/ListAttributeGroupsOptions.md) = `{}`

#### Returns

`Promise`\<\{ \}\>

***

### getObjectType()

> **getObjectType**(`objectType`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:225](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L225)

Gets one system object type with its attribute and group counts.

#### Parameters

##### objectType

`string`

#### Returns

`Promise`\<\{ \}\>

***

### listAttributeDefinitions()

> **listAttributeDefinitions**(`objectType`, `options`): `Promise`\<`object`[]\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:239](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L239)

Lists attribute definitions of an object type. Filtering and enum values
go through the search endpoint (requires `.rw` scope); a plain listing
uses the list endpoint and works with the read-only scope.

#### Parameters

##### objectType

`string`

##### options

[`ListAttributeDefinitionsOptions`](../interfaces/ListAttributeDefinitionsOptions.md) = `{}`

#### Returns

`Promise`\<`object`[]\>

***

### listAttributeGroups()

> **listAttributeGroups**(`objectType`, `options`): `Promise`\<`object`[]\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:257](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L257)

Lists attribute groups of an object type.

#### Parameters

##### objectType

`string`

##### options

[`ListAttributeGroupsOptions`](../interfaces/ListAttributeGroupsOptions.md) = `{}`

#### Returns

`Promise`\<`object`[]\>

***

### listObjectTypes()

> **listObjectTypes**(): `Promise`\<`object`[]\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:281](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L281)

Lists system object types. Custom object types are not addressable by
this API; they appear as unnamed `CustomObject` entries and are omitted.

#### Returns

`Promise`\<`object`[]\>

***

### searchAttributeDefinitions()

> **searchAttributeDefinitions**(`objectType`, `query`): `Promise`\<`object`[]\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:292](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L292)

Runs an attribute definition search and returns all hits (requires `.rw` scope).

#### Parameters

##### objectType

`string`

##### query

#### Returns

`Promise`\<`object`[]\>

***

### unassignAttributeFromGroup()

> **unassignAttributeFromGroup**(`objectType`, `groupId`, `attributeId`): `Promise`\<`void`\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:306](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L306)

Removes an attribute definition from a group.

#### Parameters

##### objectType

`string`

##### groupId

`string`

##### attributeId

`string`

#### Returns

`Promise`\<`void`\>

***

### updateAttributeDefinition()

> **updateAttributeDefinition**(`objectType`, `attributeId`, `changes`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:323](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L323)

Partially updates an attribute definition. `valueType` cannot be changed,
and enum values (`valueDefinitions`) are ignored by the API.

#### Parameters

##### objectType

`string`

##### attributeId

`string`

##### changes

`Partial`\<[`ObjectAttributeDefinition`](../../../clients/type-aliases/ObjectAttributeDefinition.md)\>

#### Returns

`Promise`\<\{ \}\>

***

### updateAttributeGroup()

> **updateAttributeGroup**(`objectType`, `groupId`, `changes`): `Promise`\<\{ \}\>

Defined in: [packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts:338](https://github.com/SalesforceCommerceCloud/b2c-developer-tooling/blob/d7ff38c7ca2b1411cd718b9554500c9416f00266/packages/b2c-tooling-sdk/src/operations/object-types/object-types.ts#L338)

Partially updates an attribute group.

#### Parameters

##### objectType

`string`

##### groupId

`string`

##### changes

`Partial`\<[`ObjectAttributeGroup`](../../../clients/type-aliases/ObjectAttributeGroup.md)\>

#### Returns

`Promise`\<\{ \}\>
