chore(docs): Generated References (automated) (#12154)

Generated the following references:
- `api_key`
- `auth`
- `cart`
- `cart_models`
- `core_flows`
- `currency`
- `customer`
- `event`
- `file_service`
- `fulfillment`
- `fulfillment_provider`
- `inventory_next`
- `js_sdk`
- `locking`
- `medusa`
- `modules`
- `modules_sdk`
- `notification_service`
- `order`
- `payment`
- `payment_provider`
- `pricing`
- `product`
- `promotion`
- `region`
- `sales_channel`
- `stock_location_next`
- `store`
- `tax`
- `types`
- `user`
- `utils`
- `workflows`

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
authored and GitHub committed 2025-04-11 11:15:08 +00:00
1 parent df5d410be2
commit 94e98190ff
1790 files changed
+220057 -187216

No files matched your search

@@ -2,10 +2,26 @@ import { TypeList } from "docs-ui"
# create
This method creates a new region. It sends a request to the
[Create Region](https://docs.medusajs.com/api/admin#regions\_postregions)
API route.
## Example
```ts
sdk.admin.region.create({
name: "United States",
currency_code: "usd",
})
.then(({ region }) => {
console.log(region)
})
```
## Parameters
<TypeList types={[{"name":"body","type":"[AdminCreateRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateRegion/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
<TypeList types={[{"name":"body","type":"[AdminCreateRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateRegion/page.mdx)","description":"The details of the region to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"`string`[]","description":"The 2 ISO code of the countries in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are automatically calculated during checkout\nfor this region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`boolean`","description":"Whether prices in this region include taxes by default.\n\nLearn more in the [tax-inclusive pricing](https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing#content) documentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"`string`[]","description":"The IDs of the payment providers that are available in this region. The IDs are \nof the format `pp_{identifier}_{id}`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Custom key-value pairs that can be added to the region.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields and relations to retrieve in the region.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;object&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"region","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The region's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The region's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The region's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[AdminRegionCountry](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionCountry/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are calculated automatically in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[AdminPaymentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentProvider/page.mdx)[]","description":"The payment providers enabled in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminRegionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The created region's details.","expandable":false,"children":[{"name":"region","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)","description":"The region's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The region's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The region's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The region's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[AdminRegionCountry](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionCountry/page.mdx)[]","description":"The countries in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are calculated automatically in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[AdminPaymentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentProvider/page.mdx)[]","description":"The payment providers enabled in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
@@ -2,10 +2,23 @@ import { TypeList } from "docs-ui"
# delete
This method deletes a region by ID. It sends a request to the
[Delete Region](https://docs.medusajs.com/api/admin#regions\_deleteregionsid)
API route.
## Example
```ts
sdk.admin.region.delete("region_123")
.then(({ deleted }) => {
console.log(deleted)
})
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the region to delete.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminRegionDeleteResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminRegionDeleteResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"TObject","description":"The type of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted","type":"`boolean`","description":"Whether the item was deleted successfully.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminRegionDeleteResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminRegionDeleteResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"TObject","description":"The type of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted","type":"`boolean`","description":"Whether the item was deleted successfully.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
@@ -2,10 +2,53 @@ import { TypeList } from "docs-ui"
# list
This method retrieves a list of regions. It sends a request to the
[List Regions](https://docs.medusajs.com/api/admin#regions\_getregions)
API route.
## Example
To retrieve the list of regions:
```ts
sdk.admin.region.list()
.then(({ regions, count, limit, offset }) => {
console.log(regions)
})
```
To configure the pagination, pass the `limit` and `offset` query parameters.
For example, to retrieve only 10 items and skip 10 items:
```ts
sdk.admin.region.list({
limit: 10,
offset: 10
})
.then(({ regions, count, limit, offset }) => {
console.log(regions)
})
```
Using the `fields` query parameter, you can specify the fields and relations to retrieve
in each region:
```ts
sdk.admin.region.list({
fields: "id,*countries"
})
.then(({ regions, count, limit, offset }) => {
console.log(regions)
})
```
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/admin#select-fields-and-relations).
## Parameters
<TypeList types={[{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)&#60;string&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)&#60;string&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)&#60;string&#62;","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[Line truncated
<TypeList types={[{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"and\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"([AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)&#60;[AdminRegionFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionFilters/page.mdx)&#62;)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"limit","type":"`number`","description":"The maximum number of items to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order","type":"`string`","description":"The field to sort by and in which order.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Query or keywords to search the region's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by region ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string` \\| `string`[]","description":"Filter by currency code(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string` \\| `string`[]","description":"Filter by region name(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)&#60;string&#62;","description":"Apply filters on the region's creation date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)&#60;string&#62;","description":"Apply filters on the region's update date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)&#60;string&#62;","description":"Apply filters on the region's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([AdminRegionFiltLine truncated
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;[PaginatedResponse](../../../../../types/HttpTypes/types/types.HttpTypes.PaginatedResponse/page.mdx)&#60;object&#62;&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"regions","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminRegionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminRegionListResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The paginated list of regions.","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
@@ -2,10 +2,38 @@ import { TypeList } from "docs-ui"
# retrieve
This method retrieves a region by ID. It sends a request to the
[Get Region](https://docs.medusajs.com/api/admin#regions\_getregionsid)
API route.
## Example
To retrieve a region by its ID:
```ts
sdk.admin.region.retrieve("region_123")
.then(({ region }) => {
console.log(region)
})
```
To specify the fields and relations to retrieve:
```ts
sdk.admin.region.retrieve("region_123", {
fields: "id,*countries"
})
.then(({ region }) => {
console.log(region)
})
```
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/admin#select-fields-and-relations).
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the region to retrieve.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields and relations to retrieve in the region.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;object&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"region","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The region's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The region's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The region's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[AdminRegionCountry](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionCountry/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are calculated automatically in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[AdminPaymentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentProvider/page.mdx)[]","description":"The payment providers enabled in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminRegionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The region's details.","expandable":false,"children":[{"name":"region","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)","description":"The region's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The region's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The region's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The region's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[AdminRegionCountry](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionCountry/page.mdx)[]","description":"The countries in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are calculated automatically in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[AdminPaymentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentProvider/page.mdx)[]","description":"The payment providers enabled in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
@@ -2,10 +2,25 @@ import { TypeList } from "docs-ui"
# update
This method updates a region. It sends a request to the
[Update Region](https://docs.medusajs.com/api/admin#regions\_postregionsid)
API route.
## Example
```ts
sdk.admin.region.update("region_123", {
name: "United States",
})
.then(({ region }) => {
console.log(region)
})
```
## Parameters
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateRegion/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the region to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateRegion/page.mdx)","description":"The details of the region to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"`string`[]","description":"The 2 ISO code of the countries in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are automatically calculated during checkout\nfor this region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`boolean`","description":"Whether prices in this region include taxes by default.\n\nLearn more in the [tax-inclusive pricing](https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing#content) documentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"`string`[]","description":"The IDs of the payment providers that are available in this region. The IDs are \nof the format `pp_{identifier}_{id}`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Custom key-value pairs that can be added to the region.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields and relations to retrieve in the region.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"Headers to pass in the request.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
## Returns
<TypeList types={[{"name":"Promise","type":"Promise&#60;object&#62;","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"region","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The region's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The region's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The region's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[AdminRegionCountry](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionCountry/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are calculated automatically in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[AdminPaymentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentProvider/page.mdx)[]","description":"The payment providers enabled in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
<TypeList types={[{"name":"Promise","type":"Promise&#60;[AdminRegionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionResponse/page.mdx)&#62;","optional":false,"defaultValue":"","description":"The updated region's details.","expandable":false,"children":[{"name":"region","type":"[AdminRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegion/page.mdx)","description":"The region's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The region's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The region's name.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The region's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[AdminRegionCountry](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRegionCountry/page.mdx)[]","description":"The countries in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Whether taxes are calculated automatically in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[AdminPaymentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentProvider/page.mdx)[]","description":"The payment providers enabled in the region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, any>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>