---
displayed_sidebar: servicesSidebar
---

import ParameterTypes from "@site/src/components/ParameterTypes"

# ProductService

## constructor

### Parameters

<ParameterTypes parameters={[
  {
    "name": "__namedParameters",
    "type": "`InjectedDependencies`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

___

## Properties

<ParameterTypes parameters={[
  {
    "name": "__configModule__",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__container__",
    "type": "`any`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "__moduleDeclaration__",
    "type": "`Record<string, unknown>`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "eventBus_",
    "type": "[EventBusService](services.EventBusService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "featureFlagRouter_",
    "type": "`FlagRouter`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "imageRepository_",
    "type": "Repository&#60;[Image](../../entities/classes/entities.Image.mdx)&#62; & `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "manager_",
    "type": "`EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productCategoryRepository_",
    "type": "TreeRepository&#60;[ProductCategory](../../entities/classes/entities.ProductCategory.mdx)&#62; & `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productOptionRepository_",
    "type": "Repository&#60;[ProductOption](../../entities/classes/entities.ProductOption.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productRepository_",
    "type": "Repository&#60;[Product](../../entities/classes/entities.Product.mdx)&#62; & `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productTagRepository_",
    "type": "Repository&#60;[ProductTag](../../entities/classes/entities.ProductTag.mdx)&#62; & `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productTypeRepository_",
    "type": "Repository&#60;[ProductType](../../entities/classes/entities.ProductType.mdx)&#62; & `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productVariantRepository_",
    "type": "Repository&#60;[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productVariantService_",
    "type": "[ProductVariantService](services.ProductVariantService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "searchService_",
    "type": "[SearchService](services.SearchService.mdx)",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "transactionManager_",
    "type": "`undefined` \\| `EntityManager`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "Events",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "Events.CREATED",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "\"product.created\"",
    "expandable": false,
    "children": []
  },
  {
    "name": "Events.DELETED",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "\"product.deleted\"",
    "expandable": false,
    "children": []
  },
  {
    "name": "Events.UPDATED",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "\"product.updated\"",
    "expandable": false,
    "children": []
  },
  {
    "name": "IndexName",
    "type": "`\"products\"`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

___

## Accessors

### activeManager\_

#### Returns

<ParameterTypes parameters={[
  {
    "name": "EntityManager",
    "type": "`EntityManager`",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

## Methods

### addOption

Adds an option to a product. Options can, for example, be "Size", "Color",
etc. Will update all the products variants with a dummy value for the newly
created option. The same option cannot be added more than once.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "the product to apply the new option to",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "optionTitle",
    "type": "`string`",
    "description": "the display title of the option, e.g. \"Size\"",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the model update operation",
    "expandable": false,
    "children": []
  }
]} />

___

### atomicPhase\_

Wraps some work within a transactional block. If the service already has
a transaction manager attached this will be reused, otherwise a new
transaction manager is created.

#### Type Parameters

<ParameterTypes parameters={[
  {
    "name": "TResult",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "TError",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "work",
    "type": "(`transactionManager`: `EntityManager`) => Promise&#60;TResult&#62;",
    "description": "the transactional work to be done",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "isolationOrErrorHandler",
    "type": "`IsolationLevel` \\| (`error`: `TError`) => Promise&#60;void \\| TResult&#62;",
    "description": "the isolation level to be used for the work.",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "maybeErrorHandlerOrDontFail",
    "type": "(`error`: `TError`) => Promise&#60;void \\| TResult&#62;",
    "description": "Potential error handler",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;TResult&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the transactional work",
    "expandable": false,
    "children": []
  }
]} />

___

### count

Return the total number of documents in database

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "selector",
    "type": "[Selector](../../medusa/types/medusa.Selector.mdx)&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "description": "the selector to choose products by",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;number&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the count operation",
    "expandable": false,
    "children": []
  }
]} />

___

### create

Creates a product.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productObject",
    "type": "`CreateProductInput`",
    "description": "the product to create",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "resolves to the creation result.",
    "expandable": false,
    "children": []
  }
]} />

___

### delete

Deletes a product from a given product id. The product's associated
variants will also be deleted.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "the id of the product to delete. Must be\n  castable as an ObjectId",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;void&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "empty promise",
    "expandable": false,
    "children": []
  }
]} />

___

### deleteOption

Delete an option from a product.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "the product to delete an option from",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "optionId",
    "type": "`string`",
    "description": "the option to delete",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;void \\| [Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the updated product",
    "expandable": false,
    "children": []
  }
]} />

___

### filterProductsBySalesChannel

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productIds",
    "type": "`string`[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "salesChannelId",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### isProductInSalesChannels

Check if the product is assigned to at least one of the provided sales channels.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "id",
    "type": "`string`",
    "description": "product id",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "salesChannelIds",
    "type": "`string`[]",
    "description": "an array of sales channel ids",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;boolean&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### list

Lists products based on the provided parameters.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "selector",
    "type": "`ProductSelector`",
    "description": "an object that defines rules to filter products\n  by",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "object that defines the scope for what should be\n  returned",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the find operation",
    "expandable": false,
    "children": []
  }
]} />

___

### listAndCount

Lists products based on the provided parameters and includes the count of
products that match the query.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "selector",
    "type": "`ProductSelector`",
    "description": "an object that defines rules to filter products\n  by",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "object that defines the scope for what should be\n  returned",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[[Product](../../entities/classes/entities.Product.mdx)[], number]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "an array containing the products as\n  the first element and the total count of products that matches the query\n  as the second element.",
    "expandable": false,
    "children": []
  }
]} />

___

### listTagsByUsage

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "take",
    "type": "`number`",
    "description": "",
    "optional": false,
    "defaultValue": "10",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[ProductTag](../../entities/classes/entities.ProductTag.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### listTypes

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[ProductType](../../entities/classes/entities.ProductType.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### prepareListQuery\_

Temporary method to be used in place we need custom query strategy to prevent typeorm bug

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "selector",
    "type": "[FilterableProductProps](../../medusa/classes/medusa.FilterableProductProps.mdx) \\| [Selector](../../medusa/types/medusa.Selector.mdx)&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "object",
    "type": "`object`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

<ParameterTypes parameters={[
  {
    "name": "q",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "query",
    "type": "`FindWithoutRelationsOptions`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "relations",
    "type": "keyof [Product](../../entities/classes/entities.Product.mdx)[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

___

### reorderVariants

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "variantOrder",
    "type": "`string`[]",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieve

Gets a product by id.
Throws in case of DB Error and if product was not found.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "id of the product to get.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "object that defines what should be included in the\n  query response",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the find one operation.",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieveByExternalId

Gets a product by external id.
Throws in case of DB Error and if product was not found.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "externalId",
    "type": "`string`",
    "description": "handle of the product to get.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "details about what to get from the product",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the find one operation.",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieveByHandle

Gets a product by handle.
Throws in case of DB Error and if product was not found.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productHandle",
    "type": "`string`",
    "description": "handle of the product to get.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "details about what to get from the product",
    "optional": false,
    "defaultValue": "{}",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the find one operation.",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieveOptionByTitle

Retrieve product's option by title.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "title",
    "type": "`string`",
    "description": "title of the option",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "productId",
    "type": "`string`",
    "description": "id of a product",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;null \\| [ProductOption](../../entities/classes/entities.ProductOption.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "product option",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieveVariants

Gets all variants belonging to a product.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "the id of the product to get variants from.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "The config to select and configure relations etc...",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[ProductVariant](../../entities/classes/entities.ProductVariant.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "an array of variants",
    "expandable": false,
    "children": []
  }
]} />

___

### retrieve\_

Gets a product by selector.
Throws in case of DB Error and if product was not found.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "selector",
    "type": "[Selector](../../medusa/types/medusa.Selector.mdx)&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "description": "selector object",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "config",
    "type": "`FindProductConfig`",
    "description": "object that defines what should be included in the\n  query response",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the result of the find one operation.",
    "expandable": false,
    "children": []
  }
]} />

___

### shouldRetryTransaction\_

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "err",
    "type": "`Record<string, unknown>` \\| `object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "boolean",
    "type": "`boolean`",
    "optional": true,
    "defaultValue": "",
    "description": "",
    "expandable": false,
    "children": []
  }
]} />

___

### update

Updates a product. Product variant updates should use dedicated methods,
e.g. `addVariant`, etc. The function will throw errors if metadata or
product variant updates are attempted.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "the id of the product. Must be a string that\n  can be casted to an ObjectId",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "update",
    "type": "`UpdateProductInput`",
    "description": "an object with the update values.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "resolves to the update result.",
    "expandable": false,
    "children": []
  }
]} />

___

### updateOption

Updates a product's option. Throws if the call tries to update an option
not associated with the product. Throws if the updated title already exists.

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productId",
    "type": "`string`",
    "description": "the product whose option we are updating",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "optionId",
    "type": "`string`",
    "description": "the id of the option we are updating",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "data",
    "type": "`ProductOptionInput`",
    "description": "the data to update the option with",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "the updated product",
    "expandable": false,
    "children": []
  }
]} />

___

### updateShippingProfile

Assign a product to a profile, if a profile id null is provided then detach the product from the profile

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "productIds",
    "type": "`string` \\| `string`[]",
    "description": "ID or IDs of the products to update",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  },
  {
    "name": "profileId",
    "type": "`null` \\| `string`",
    "description": "Shipping profile ID to update the shipping options with",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[Product](../../entities/classes/entities.Product.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "updated products",
    "expandable": false,
    "children": []
  }
]} />

___

### withTransaction

#### Parameters

<ParameterTypes parameters={[
  {
    "name": "transactionManager",
    "type": "`EntityManager`",
    "description": "",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />

#### Returns

<ParameterTypes parameters={[
  {
    "name": "ProductService",
    "type": "`object`",
    "description": "",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": []
  }
]} />
