---
displayed_sidebar: servicesSidebar
---
import TypeList from "@site/src/components/TypeList"
# ShippingProfileService
Provides layer to manipulate profiles.
## Implements
## constructor
### Parameters
___
## Properties
`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"__moduleDeclaration__","type":"`Record`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="ShippingProfileService"/>
___
## Accessors
### activeManager\_
#### Returns
___
## Methods
### withTransaction
#### Parameters
#### Returns
### shouldRetryTransaction\_
#### Parameters
` \\| `object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="shouldRetryTransaction_"/>
#### Returns
### 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
#### Parameters
Promise<TResult>","description":"the transactional work to be done","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"isolationOrErrorHandler","type":"`IsolationLevel` \\| (`error`: TError) => Promise<void \\| TResult>","description":"the isolation level to be used for the work.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"maybeErrorHandlerOrDontFail","type":"(`error`: TError) => Promise<void \\| TResult>","description":"Potential error handler","optional":true,"defaultValue":"","expandable":false,"children":[]}]} sectionTitle="atomicPhase_"/>
#### Returns
### list
#### Parameters
#### Returns
### getMapProfileIdsByProductIds
#### Parameters
#### Returns
### retrieve
Gets a profile by id.
Throws in case of DB Error and if profile was not found.
#### Parameters
#### Returns
### retrieveForProducts
#### Parameters
#### Returns
### retrieveDefault
#### Returns
### createDefault
Creates a default shipping profile, if this does not already exist.
#### Returns
### retrieveGiftCardDefault
Retrieves the default gift card profile
#### Returns
### createGiftCardDefault
Creates a default shipping profile, for gift cards if unless it already
exists.
#### Returns
### create
Creates a new shipping profile.
#### Parameters
#### Returns
### update
Updates a profile. Metadata updates and product updates should use
dedicated methods, e.g. `setMetadata`, `addProduct`, etc. The function
will throw errors if metadata or product updates are attempted.
#### Parameters
#### Returns
### delete
Deletes a profile with a given profile id.
#### Parameters
#### Returns
### addProduct
#### Parameters
#### Returns
#### Deprecated
use [addProducts](services.ShippingProfileService.mdx#addproducts) instead
### addProducts
Adds a product or an array of products to the profile.
#### Parameters
#### Returns
### removeProducts
Removes a product or an array of products from the profile.
#### Parameters
#### Returns
### addShippingOption
Adds a shipping option to the profile. The shipping option can be used to
fulfill the products in the products field.
#### Parameters
#### Returns
### fetchCartOptions
Finds all the shipping profiles that cover the products in a cart, and
validates all options that are available for the cart.
#### Parameters
#### Returns
### getProfilesInCart
Returns a list of all the productIds in the cart.
#### Parameters
#### Returns