---
displayed_sidebar: pricingReference
badge:
  variant: orange
  text: Beta
slug: /references/pricing/updatePriceLists
sidebar_label: updatePriceLists
---

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

# updatePriceLists - Pricing Module Reference

This documentation provides a reference to the `updatePriceLists` method. This belongs to the Pricing Module.

This method is used to update price lists.

## Example

```ts
import {
  initialize as initializePricingModule,
} from "@medusajs/pricing"

async function updatePriceLists (items: {
  id: string
  title: string
  description: string
  starts_at?: string
  ends_at?: string
}[]) {
  const pricingService = await initializePricingModule()

  const priceList = await pricingService.updatePriceLists(items)

  // do something with the price lists or return them
}
```

## Parameters

<ParameterTypes parameters={[
  {
    "name": "data",
    "type": "[UpdatePriceListDTO](../../pricing/interfaces/pricing.UpdatePriceListDTO.mdx)[]",
    "description": "The attributes to update in each price list.",
    "optional": false,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "ends_at",
        "type": "`null` \\| `string`",
        "description": "The price list expires after this date.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "id",
        "type": "`string`",
        "description": "The ID of the price list to update.",
        "optional": false,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "number_rules",
        "type": "`number`",
        "description": "The number of rules associated with the price list.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "rules",
        "type": "[CreatePriceListRules](../../pricing/interfaces/pricing.CreatePriceListRules.mdx)",
        "description": "The rules to be created and associated with the price list.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "starts_at",
        "type": "`null` \\| `string`",
        "description": "The price list is enabled starting from this date.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "status",
        "type": "[PriceListStatus](../../pricing/enums/pricing.PriceListStatus.mdx)",
        "description": "The price list's status.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": [
          {
            "name": "ACTIVE",
            "type": "`\"active\"`",
            "description": "The price list is enabled and its prices can be used.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          },
          {
            "name": "DRAFT",
            "type": "`\"draft\"`",
            "description": "The price list is disabled, meaning its prices can't be used yet.",
            "optional": true,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      },
      {
        "name": "title",
        "type": "`string`",
        "description": "The price list's title.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  },
  {
    "name": "sharedContext",
    "type": "[Context](../../pricing/interfaces/pricing.Context.mdx)",
    "description": "A context used to share resources, such as transaction manager, between the application and the module.",
    "optional": true,
    "defaultValue": "",
    "expandable": false,
    "children": [
      {
        "name": "enableNestedTransactions",
        "type": "`boolean`",
        "description": "A boolean value indicating whether nested transactions are enabled.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "isolationLevel",
        "type": "`string`",
        "description": "A string indicating the isolation level of the context. Possible values are `READ UNCOMMITTED`, `READ COMMITTED`, `REPEATABLE READ`, or `SERIALIZABLE`.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "manager",
        "type": "`TManager`",
        "description": "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`.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "transactionId",
        "type": "`string`",
        "description": "A string indicating the ID of the current transaction.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      },
      {
        "name": "transactionManager",
        "type": "`TManager`",
        "description": "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`.",
        "optional": true,
        "defaultValue": "",
        "expandable": false,
        "children": []
      }
    ]
  }
]} />

## Returns

<ParameterTypes parameters={[
  {
    "name": "Promise",
    "type": "Promise&#60;[PriceListDTO](../../pricing/interfaces/pricing.PriceListDTO.mdx)[]&#62;",
    "optional": false,
    "defaultValue": "",
    "description": "The updated price lists.",
    "expandable": false,
    "children": [
      {
        "name": "PriceListDTO[]",
        "type": "[PriceListDTO](../../pricing/interfaces/pricing.PriceListDTO.mdx)[]",
        "optional": false,
        "defaultValue": "",
        "description": "",
        "expandable": false,
        "children": [
          {
            "name": "PriceListDTO",
            "type": "`object`",
            "description": "A price list's details.",
            "optional": false,
            "defaultValue": "",
            "expandable": false,
            "children": []
          }
        ]
      }
    ]
  }
]} />
