# listShippingProfiles - Fulfillment Module Reference

This documentation provides a reference to the `listShippingProfiles` method. This belongs to the Fulfillment Module.

You should only use this methods when implementing complex customizations. For common cases, check out [available workflows instead](https://docs.medusajs.com/medusa-workflows-reference).

This method retrieves a paginated list of shipping profiles based on optional filters and configuration.

## Example

To retrieve a list of shipping profiles using their IDs:

```ts
const shippingProfiles =
  await fulfillmentModuleService.listShippingProfiles({
    id: ["sp_123", "sp_321"],
  })
```

To specify relations that should be retrieved within the shipping profile:

:::note

You can only retrieve data models defined in the same module. To retrieve linked data models
from other modules, use [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.

:::

```ts
const shippingProfiles =
  await fulfillmentModuleService.listShippingProfiles(
    {
      id: ["sp_123", "sp_321"],
    },
    {
      relations: ["shipping_options"],
    }
  )
```

By default, only the first `15` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:

```ts
const shippingProfiles =
  await fulfillmentModuleService.listShippingProfiles(
    {
      id: ["sp_123", "sp_321"],
    },
    {
      relations: ["shipping_options"],
      take: 20,
      skip: 2,
    }
  )
```

## Parameters

- filters: (\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)) The filters to apply on the retrieved shipping profiles.

  - $and: ((\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "and" condition.

    - $and: ((\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "and" condition.

    - $or: ((\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "or" condition.

    - id: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) The IDs to filter the shipping profiles by.

    - name: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping profiles by their name.

    - type: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping profiles by their type.

    - shipping\_options: (\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx)) The filters to apply on the retrieved shipping options.

  - $or: ((\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "or" condition.

    - $and: ((\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "and" condition.

    - $or: ((\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingProfileProps]\(../../../interfaces/fulfillment.FilterableShippingProfileProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "or" condition.

    - id: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) The IDs to filter the shipping profiles by.

    - name: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping profiles by their name.

    - type: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping profiles by their type.

    - shipping\_options: (\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx)) The filters to apply on the retrieved shipping options.

  - id: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) The IDs to filter the shipping profiles by.

    - $and: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;\[])

    - $or: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;\[])

    - $eq: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62; \\| \[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $ne: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $in: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $nin: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $not: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;) API wrapper around the remoteQuery

    - $gt: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $gte: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $lt: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $lte: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $like: (\`string\`)

    - $re: (\`string\`)

    - $ilike: (\`string\`)

    - $fulltext: (\`string\`)

    - $overlap: (\`string\`\[])

    - $contains: (\`string\`\[])

    - $contained: (\`string\`\[])

    - $exists: (\`boolean\`)

  - name: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping profiles by their name.

    - $and: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;\[])

    - $or: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;\[])

    - $eq: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62; \\| \[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $ne: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $in: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $nin: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $not: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;) API wrapper around the remoteQuery

    - $gt: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $gte: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $lt: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $lte: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $like: (\`string\`)

    - $re: (\`string\`)

    - $ilike: (\`string\`)

    - $fulltext: (\`string\`)

    - $overlap: (\`string\`\[])

    - $contains: (\`string\`\[])

    - $contained: (\`string\`\[])

    - $exists: (\`boolean\`)

  - type: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping profiles by their type.

    - $and: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;\[])

    - $or: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;\[])

    - $eq: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62; \\| \[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $ne: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $in: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $nin: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;\[])

    - $not: (\[Query]\(../../../types/fulfillment.Query/page.mdx)\&#60;T\&#62;) API wrapper around the remoteQuery

    - $gt: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $gte: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $lt: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $lte: (\[ExpandScalar]\(../../../types/fulfillment.ExpandScalar/page.mdx)\&#60;T\&#62;)

    - $like: (\`string\`)

    - $re: (\`string\`)

    - $ilike: (\`string\`)

    - $fulltext: (\`string\`)

    - $overlap: (\`string\`\[])

    - $contains: (\`string\`\[])

    - $contained: (\`string\`\[])

    - $exists: (\`boolean\`)

  - shipping\_options: (\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx)) The filters to apply on the retrieved shipping options.

    - $and: ((\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "and" condition.

    - $or: ((\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx) \\| \[BaseFilterable]\(../../../interfaces/fulfillment.BaseFilterable/page.mdx)\&#60;\[FilterableShippingOptionProps]\(../../../interfaces/fulfillment.FilterableShippingOptionProps/page.mdx)\&#62;)\[]) An array of filters to apply on the entity, where each item in the array is joined with an "or" condition.

    - id: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) The IDs to filter the shipping options by.

    - name: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping options by their name.

    - shipping\_profile\_id: (\`string\` \\| \`string\`\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;string \\| string\[]\&#62;) Filter the shipping options by the ID of their associated shipping profile.

    - price\_type: (\[ShippingOptionPriceType]\(../../../types/fulfillment.ShippingOptionPriceType/page.mdx) \\| \[ShippingOptionPriceType]\(../../../types/fulfillment.ShippingOptionPriceType/page.mdx)\[] \\| \[OperatorMap]\(../../../types/fulfillment.OperatorMap/page.mdx)\&#60;ShippingOptionPriceType | ShippingOptionPriceType\[]\&#62;) Filter the shipping options by their price type.

    - service\_zone: (\[FilterableServiceZoneProps]\(../../../interfaces/fulfillment.FilterableServiceZoneProps/page.mdx)) The filters to apply on the retrieved service zones.

    - shipping\_option\_type: (\[FilterableShippingOptionTypeProps]\(../../../interfaces/fulfillment.FilterableShippingOptionTypeProps/page.mdx)) The filters to apply on the retrieved shipping option types.

    - rules: (\[FilterableShippingOptionRuleProps]\(../../../interfaces/fulfillment.FilterableShippingOptionRuleProps/page.mdx)) The filters to apply on the retrieved shipping option rules.
- config: (\[FindConfig]\(../../../interfaces/fulfillment.FindConfig/page.mdx)\&#60;\[ShippingProfileDTO]\(../../../interfaces/fulfillment.ShippingProfileDTO/page.mdx)\&#62;) The configurations determining how the shipping profile is retrieved. Its properties, such as \`select\` or \`relations\`, accept the
  attributes or relations associated with a shipping profile.

  - select: ((\`string\` & \`object\` \\| keyof Entity)\[]) An array of strings, each being attribute names of the entity to retrieve in the result.

  - skip: (\`null\` \\| \`number\`) A number indicating the number of records to skip before retrieving the results.

  - take: (\`null\` \\| \`number\`) A number indicating the number of records to return in the result.

  - relations: (\`string\`\[]) An array of strings, each being relation names of the entity to retrieve in the result.

    You can only retrieve data models defined in the same module. To retrieve linked data models
    from other modules, use \[Query]\(https://docs.medusajs.com/learn/fundamentals/module-links/query) instead.

  - order: (\[FindConfigOrder]\(../../../types/fulfillment.FindConfigOrder/page.mdx)) An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be \`ASC\`
    to sort retrieved records in an ascending order, or \`DESC\` to sort retrieved records in a descending order.

  - withDeleted: (\`boolean\`) A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the
    \`SoftDeletableEntity\` class.

  - filters: (\`Record\<string, any>\`) Enable ORM specific defined filters

  - options: (\`Record\<string, any>\`) Enable ORM specific defined options
- sharedContext: (\[Context]\(../../../interfaces/fulfillment.Context/page.mdx)) A context used to share resources, such as transaction manager, between the application and the module.

  - transactionManager: (TManager) An instance of a transaction manager of type \`TManager\`, which is a typed parameter passed to the context to specify the type of the \`transactionManager\`.

  - manager: (TManager) An instance of a manager, typically an entity manager, of type \`TManager\`, which is a typed parameter passed to the context to specify the type of the \`manager\`.

  - isolationLevel: (\`string\`) A string indicating the isolation level of the context. Possible values are \`READ UNCOMMITTED\`, \`READ COMMITTED\`, \`REPEATABLE READ\`, or \`SERIALIZABLE\`.

  - enableNestedTransactions: (\`boolean\`) A boolean value indicating whether nested transactions are enabled.

  - eventGroupId: (\`string\`) A string indicating the ID of the group to aggregate the events to be emitted at a later point.

  - transactionId: (\`string\`) A string indicating the ID of the current transaction.

  - runId: (\`string\`) A string indicating the ID of the current run.

  - messageAggregator: (\[IMessageAggregator]\(../../../interfaces/fulfillment.IMessageAggregator/page.mdx)) An instance of a message aggregator, which is used to aggregate messages to be emitted at a later point.

  - requestId: (\`string\`) A string indicating the ID of the current request.

  - idempotencyKey: (\`string\`) A string indicating the idempotencyKey of the current workflow execution.

  - parentStepIdempotencyKey: (\`string\`) A string indicating the idempotencyKey of the parent workflow execution.

  - preventReleaseEvents: (\`boolean\`) preventReleaseEvents

  - isCancelling: (\`boolean\`) A boolean value indicating whether the current workflow execution is being cancelled.

  - cancelingFromParentStep: (\`boolean\`) Weither or not a sub workflow cancellation is being triggered from a parent step.
    If true, the parent step will not be triggered by the sub workflow.

## Returns

- Promise: (Promise\&#60;\[ShippingProfileDTO]\(../../../interfaces/fulfillment.ShippingProfileDTO/page.mdx)\[]\&#62;) The list of shipping profiles.

  - ShippingProfileDTO\[]: (\[ShippingProfileDTO]\(../../../interfaces/fulfillment.ShippingProfileDTO/page.mdx)\[])

    - id: (\`string\`) The ID of the shipping profile.

    - name: (\`string\`) The name of the shipping profile.

    - type: (\`string\`) The type of the shipping profile.

    - metadata: (\`null\` \\| \`Record\<string, unknown>\`) Holds custom data in key-value pairs.

    - shipping\_options: (\[ShippingOptionDTO]\(../../../interfaces/fulfillment.ShippingOptionDTO/page.mdx)\[]) The shipping options associated with the shipping profile.

      - id: (\`string\`) The ID of the shipping option.

      - name: (\`string\`) The name of the shipping option.

      - price\_type: (\[ShippingOptionPriceType]\(../../../types/fulfillment.ShippingOptionPriceType/page.mdx)) The type of the shipping option's price.

      - service\_zone\_id: (\`string\`) The associated service zone's ID.

      - shipping\_profile\_id: (\`string\`) The associated shipping profile's ID.

      - provider\_id: (\`string\`) The associated fulfillment provider's ID.

      - shipping\_option\_type\_id: (\`null\` \\| \`string\`) The associated shipping option type's ID.

      - data: (\`null\` \\| \`Record\<string, unknown>\`) The data necessary for the associated fulfillment provider to process the shipping option
        and, later, its associated fulfillments.

      - metadata: (\`null\` \\| \`Record\<string, unknown>\`) Holds custom data in key-value pairs.

      - service\_zone: (\[ServiceZoneDTO]\(../../../interfaces/fulfillment.ServiceZoneDTO/page.mdx)) The associated service zone.

      - shipping\_profile: (\[ShippingProfileDTO]\(../../../interfaces/fulfillment.ShippingProfileDTO/page.mdx)) The associated shipping profile.

      - fulfillment\_provider: (\[FulfillmentProviderDTO]\(../../../interfaces/fulfillment.FulfillmentProviderDTO/page.mdx)) The associated fulfillment provider.

      - type: (\[ShippingOptionTypeDTO]\(../../../interfaces/fulfillment.ShippingOptionTypeDTO/page.mdx)) The associated shipping option type.

      - rules: (\[ShippingOptionRuleDTO]\(../../../interfaces/fulfillment.ShippingOptionRuleDTO/page.mdx)\[]) The rules associated with the shipping option.

      - fulfillments: (\[FulfillmentDTO]\(../../../interfaces/fulfillment.FulfillmentDTO/page.mdx)\[]) The fulfillments associated with the shipping option.

      - created\_at: (\`Date\`) The creation date of the shipping option.

      - updated\_at: (\`Date\`) The update date of the shipping option.

      - deleted\_at: (\`null\` \\| \`Date\`) The deletion date of the shipping option.

    - created\_at: (\`Date\`) The creation date of the shipping profile.

    - updated\_at: (\`Date\`) The update date of the shipping profile.

    - deleted\_at: (\`null\` \\| \`Date\`) The deletion date of the shipping profile.


---

The best way to deploy Medusa is through Medusa Cloud where you get autoscaling production infrastructure fine tuned for Medusa. Create an account by signing up at cloud.medusajs.com/signup.
