docs: generate references for 2.10.1 (#13344)
This commit is contained in:
1 parent
cf4da02e39
commit
899ac2f052
1325 files changed
+470691
-426567
No files matched your search
+27
-1
@@ -421,6 +421,32 @@ sdk.admin.order.markAsDelivered(
|
||||
|
||||
___
|
||||
|
||||
## listShippingOptions
|
||||
|
||||
This method retrieves a list of shipping options for an order based on the order's shipping address.
|
||||
|
||||
This method sends a request to the [List Shipping Options](https://docs.medusajs.com/api/admin#orders\_getordersidshipping-options)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.order.listShippingOptions("order_123")
|
||||
.then(({ shipping_options }) => {
|
||||
console.log(shipping_options)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminGetOrderShippingOptionList](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderShippingOptionList/page.mdx)","description":"Configure the fields to retrieve in each shipping option.","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":"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="listShippingOptions"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object>","optional":false,"defaultValue":"","description":"The list of shipping options.","expandable":false,"children":[{"name":"shipping_options","type":"[AdminShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOption/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The shipping option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The shipping option's name. Customers can\nsee this name during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone_id","type":"`string`","description":"The ID of the service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone","type":"[AdminServiceZone](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminServiceZone/page.mdx)","description":"The service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[AdminFulfillmentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProvider/page.mdx)","description":"The fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_type_id","type":"`null` \\| `string`","description":"The ID of the shipping option's type.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option's type.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile","type":"[AdminShippingProfile](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingProfile/page.mdx)","description":"The shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionRule/page.mdx)[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminShippingOptionPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionPrice/page.mdx)[]","description":"The prices of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]}Line truncated
|
||||
|
||||
___
|
||||
|
||||
## listChanges
|
||||
|
||||
This method retrieves a list of changes made on an order, including returns, exchanges, etc...
|
||||
@@ -464,7 +490,7 @@ sdk.admin.order.listLineItems("order_123")
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminOrderItemsFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderItemsFilters/page.mdx)","description":"Configure the fields to retrieve in each line item.","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":"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":"id","type":"`string` \\| `string`[]","description":"Filter by order item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string` \\| `string`[]","description":"Filter by the associated line item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number` \\| `number`[]","description":"Filter by order version(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"","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="listLineItems"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminOrderItemsFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderItemsFilters/page.mdx)","description":"Configure the fields to retrieve in each line item.","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":"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":"id","type":"`string` \\| `string`[]","description":"Filter by order item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string` \\| `string`[]","description":"Filter by the associated line item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number` \\| `number`[]","description":"Filter by order version(s).","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="listLineItems"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+2
-2
@@ -54,7 +54,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.5`.
|
||||
This is available starting from Medusa `v2.8.5`.
|
||||
|
||||
:::
|
||||
|
||||
@@ -88,7 +88,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.5`.
|
||||
This is available starting from Medusa `v2.8.5`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
+21
-21
@@ -15,7 +15,7 @@ This documentation provides a reference to the `sdk.admin.promotion` set of meth
|
||||
|
||||
## retrieve
|
||||
|
||||
This method retrieves a promotion by its ID. It sends a request to the
|
||||
This method retrieves a promotion by its ID. It sends a request to the
|
||||
[Retrieve Promotion](https://docs.medusajs.com/api/admin#promotions\_getpromotionsid)
|
||||
API route.
|
||||
|
||||
@@ -55,7 +55,7 @@ ___
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a list of promotions. It sends a request to the
|
||||
This method retrieves a list of promotions. It sends a request to the
|
||||
[List Promotions](https://docs.medusajs.com/api/admin#promotions\_getpromotions)
|
||||
API route.
|
||||
|
||||
@@ -110,14 +110,14 @@ ___
|
||||
|
||||
## create
|
||||
|
||||
This method creates a new promotion. It sends a request to the
|
||||
This method creates a new promotion. It sends a request to the
|
||||
[Create Promotion](https://docs.medusajs.com/api/admin#promotions\_postpromotions)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.promotion.create({
|
||||
sdk.admin.promotion.create({
|
||||
name: "My Promotion",
|
||||
description: "This is a test promotion",
|
||||
code: "PROMO123",
|
||||
@@ -141,7 +141,7 @@ ___
|
||||
|
||||
## update
|
||||
|
||||
This method updates a promotion. It sends a request to the
|
||||
This method updates a promotion. It sends a request to the
|
||||
[Update Promotion](https://docs.medusajs.com/api/admin#promotions\_postpromotionsid)
|
||||
API route.
|
||||
|
||||
@@ -168,7 +168,7 @@ ___
|
||||
|
||||
## delete
|
||||
|
||||
This method deletes a promotion. It sends a request to the
|
||||
This method deletes a promotion. It sends a request to the
|
||||
[Delete Promotion](https://docs.medusajs.com/api/admin#promotions\_deletepromotionsid)
|
||||
API route.
|
||||
|
||||
@@ -197,11 +197,11 @@ This method creates and adds rules to a promotion. It can be the promotion's rul
|
||||
or its application method's buy or target rules. That depends on the rule type
|
||||
you specify as a parameter.
|
||||
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
[Manage Promotion's Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidrulesbatch).
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
[Manage Promotion's Buy Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidbuyrulesbatch).
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
[Manage Promotion's Target Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidtargetrulesbatch).
|
||||
|
||||
### Example
|
||||
@@ -237,11 +237,11 @@ This method updates the rules of a promotion. It can be the promotion's rules,
|
||||
or its application method's buy or target rules. That depends on the rule type
|
||||
you specify as a parameter.
|
||||
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
[Manage Promotion's Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidrulesbatch).
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
[Manage Promotion's Buy Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidbuyrulesbatch).
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
[Manage Promotion's Target Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidtargetrulesbatch).
|
||||
|
||||
### Example
|
||||
@@ -276,11 +276,11 @@ This method removes rules from a promotion. It can be the promotion's rules,
|
||||
or its application method's buy or target rules. That depends on the rule type
|
||||
you specify as a parameter.
|
||||
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
[Manage Promotion's Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidrulesbatch).
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
[Manage Promotion's Buy Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidbuyrulesbatch).
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
[Manage Promotion's Target Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidtargetrulesbatch).
|
||||
|
||||
### Example
|
||||
@@ -324,7 +324,7 @@ sdk.admin.promotion.listRules("promo_123", "rules")
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`null` \\| `string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionRuleParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionRuleParams/page.mdx)","description":"Configure the fields to retrieve in the rules.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"promotion_type","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_type","type":"`string`","description":"","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="listRules"/>
|
||||
<TypeList types={[{"name":"id","type":"`null` \\| `string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionRuleParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionRuleParams/page.mdx)","description":"Configure the fields to retrieve in the rules.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"promotion_type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of promotion to retrieve the attributes for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of application method to retrieve the attributes for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The type of application method to retrieve the attributes for.","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="listRules"/>
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -354,7 +354,7 @@ sdk.admin.promotion.listRuleAttributes("rules", "standard")
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the attributes for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promotionType","type":"`string`","description":"The type of promotion to retrieve the attributes for. It can be `standard` or `buyget`.","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="listRuleAttributes"/>
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the attributes for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promotionType","type":"`string`","description":"The type of promotion to retrieve the attributes for. It can be `standard` or `buyget`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"applicationMethodTargetType","type":"`string`","description":"The type of application method to retrieve the attributes for. It can be `order`, `items` (default) or `shipping_methods`.","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="listRuleAttributes"/>
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -364,10 +364,10 @@ ___
|
||||
|
||||
## listRuleValues
|
||||
|
||||
Retrieve all potential values for promotion rules and target and buy rules based on the specified rule attribute and type.
|
||||
For example, if you provide the ID of the `currency_code` rule attribute, and set `rule_type` to rules,
|
||||
Retrieve all potential values for promotion rules and target and buy rules based on the specified rule attribute and type.
|
||||
For example, if you provide the ID of the `currency_code` rule attribute, and set `rule_type` to rules,
|
||||
a list of currencies are retrieved in label-value pairs.
|
||||
|
||||
|
||||
This method sends a request to the
|
||||
[List Rule Values API Route](https://docs.medusajs.com/api/admin#promotions\_getpromotionsrulevalueoptionsrule\_typerule\_attribute\_id)
|
||||
|
||||
@@ -382,7 +382,7 @@ sdk.admin.promotion.listRuleValues("rules", "attr_123")
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the values for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleValue","type":"`string`","description":"The ID of the rule attribute to retrieve the values for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionsRuleValueParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionsRuleValueParams/page.mdx)","description":"Configure the fields to retrieve in the rule values.","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":"Search for a rule value by its searchable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by rule value.","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="listRuleValues"/>
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the values for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleValue","type":"`string`","description":"The ID of the rule attribute to retrieve the values for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionsRuleValueParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionsRuleValueParams/page.mdx)","description":"Configure the fields to retrieve in the rule values.","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":"Search for a rule value by its searchable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The application method's possible target types.","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="listRuleValues"/>
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+3
-3
@@ -100,7 +100,7 @@ Learn more about the `fields` property in the [API reference](https://docs.medus
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdxLine truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"Sort the reservations by the given field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description"Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -129,7 +129,7 @@ sdk.admin.reservation.create({
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateReservation/page.mdx)","description":"The details of the reservation to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item that the reservation is for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the line item to create the reservation for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../..Line truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateReservation/page.mdx)","description":"The details of the reservation to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item that the reservation is for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the line item to create the reservation for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"Sort the reservations by the given field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/tyLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -156,7 +156,7 @@ sdk.admin.reservation.update("res_123", {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The reservation's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateReservation/page.mdx)","description":"The details of the reservation to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<TLine truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The reservation's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateReservation/page.mdx)","description":"The details of the reservation to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"Sort the reservations by the given field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","descriptLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+2
-2
@@ -33,7 +33,7 @@ sdk.admin.shippingOption.create({
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOption/page.mdx)","description":"The details of the shipping option to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone_id","type":"`string`","description":"The ID of the service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"([AdminCreateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminCreateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx)[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"operator","type":"[RuleOperatorType](../../../../../types/CommonTypes/types/types.CommonTypes.RuleOperatorType/page.mdx)","description":"The operator of the shipping option rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"aLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOption/page.mdx)","description":"The details of the shipping option to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone_id","type":"`string`","description":"The ID of the service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([AdminCreateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminCreateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"type_id","type":"`string`","description":"The ID of the type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx)[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":tLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
@@ -100,7 +100,7 @@ sdk.admin.shippingOption.update("so_123", {
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOption/page.mdx)","description":"The details of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"([AdminUpdateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminUpdateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the shipping option price that is being updated.\nIf not provided, a new shipping option price will be created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"([AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx) \\| [AdminUpdateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionRule/page.mdx))[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"operator","type":"[RuleOperatorType](../../../../../types/CommonTypes/types/types.CommonTypes.RuleOperatorType/page.mdx)","description":"The operator of the shipping option rule.","optional":false,"defaultValue":"","expandable":false,"children":[Line truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOption/page.mdx)","description":"The details of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"type_id","type":"`string`","description":"The ID of the type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([AdminUpdateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminUpdateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the shipping option price that is being updated.\nIf not provided, a new shipping option price will be created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"([AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx) \\| [AdminUpdateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionRule/page.mdx))[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
---
|
||||
slug: /references/js-sdk/admin/shippingOptionType
|
||||
sidebar_label: shippingOptionType
|
||||
tags:
|
||||
- js sdk
|
||||
- admin
|
||||
- fulfillment
|
||||
---
|
||||
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# shippingOptionType - JS SDK Admin Reference
|
||||
|
||||
This documentation provides a reference to the `sdk.admin.shippingOptionType` set of methods used to send requests to Medusa's Admin API routes.
|
||||
|
||||
## create
|
||||
|
||||
This method creates a shipping option type. It sends a request to the
|
||||
[Create Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_postshippingoptiontypes)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.create({
|
||||
label: "Standard",
|
||||
code: "standard",
|
||||
description: "Ship in 2-3 days."
|
||||
})
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the shipping option type.","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<[AdminShippingOptionTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type's details.","expandable":false,"children":[{"name":"shipping_option_type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
___
|
||||
|
||||
## update
|
||||
|
||||
This method updates a shipping option type. It sends a request to the
|
||||
[Update Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_postshippingoptiontypesid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.update("sotype_123", {
|
||||
code: "express"
|
||||
})
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The shipping option type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionType/page.mdx)","description":"The data to update in the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the shipping option type.","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<[AdminShippingOptionTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type's details.","expandable":false,"children":[{"name":"shipping_option_type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
___
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a paginated list of shipping option types. It sends a request to the
|
||||
[List Shipping Option Types](https://docs.medusajs.com/api/admin#shipping-option-types\_getshippingoptiontypes) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of shipping option types:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.list()
|
||||
.then(({ shipping_option_types, count, limit, offset }) => {
|
||||
console.log(shipping_option_types)
|
||||
})
|
||||
```
|
||||
|
||||
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.shippingOptionType.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ shipping_option_types, count, limit, offset }) => {
|
||||
console.log(shipping_option_types)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each shipping option type:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.list({
|
||||
fields: "id,*shippingOptions"
|
||||
})
|
||||
.then(({ shipping_option_types, count, limit, offset }) => {
|
||||
console.log(shipping_option_types)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"query","type":"[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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 apply filters on the type's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by shipping option type ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string` \\| `string`[]","description":"Filter by label(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[]","description":"Filter by code(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the creation date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the update date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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":"$and","type":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListPLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminShippingOptionTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of shipping option types.","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":[]},{"name":"shipping_option_types","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)[]","description":"The list of shipping option types.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"estimate_count","type":"`number`","description":"The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.","optional":true,"defaultValue":"","expandable":false,"featureFlag":"index_engine","children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
|
||||
___
|
||||
|
||||
## retrieve
|
||||
|
||||
This method retrieves a shipping option type by its ID. It sends a request to the
|
||||
[Get Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_getshippingoptiontypesid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve a shipping option type by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.retrieve("sotype_123")
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.retrieve("sotype_123", {
|
||||
fields: "id,*shippingOptions"
|
||||
})
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The shipping option type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the shipping option type.","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<[AdminShippingOptionTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type's details.","expandable":false,"children":[{"name":"shipping_option_type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
___
|
||||
|
||||
## delete
|
||||
|
||||
This method deletes a shipping option type. It sends a request to the
|
||||
[Delete Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_deleteshippingoptiontypesid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.delete("sotype_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The shipping option type's ID.","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<[AdminShippingOptionTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type'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":"`\"shipping_option_type\"`","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"/>
|
||||
+1
-1
@@ -21,7 +21,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.0`.
|
||||
This is available starting from Medusa `v2.8.0`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.0`.
|
||||
This is available starting from Medusa `v2.8.0`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ sdk.admin.order.listLineItems("order_123")
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminOrderItemsFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderItemsFilters/page.mdx)","description":"Configure the fields to retrieve in each line item.","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":"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":"id","type":"`string` \\| `string`[]","description":"Filter by order item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string` \\| `string`[]","description":"Filter by the associated line item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number` \\| `number`[]","description":"Filter by order version(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"","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="listLineItems"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminOrderItemsFilters](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderItemsFilters/page.mdx)","description":"Configure the fields to retrieve in each line item.","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":"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":"id","type":"`string` \\| `string`[]","description":"Filter by order item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string` \\| `string`[]","description":"Filter by the associated line item ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number` \\| `number`[]","description":"Filter by order version(s).","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="listLineItems"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# listShippingOptions
|
||||
|
||||
This method retrieves a list of shipping options for an order based on the order's shipping address.
|
||||
|
||||
This method sends a request to the [List Shipping Options](https://docs.medusajs.com/api/admin#orders\_getordersidshipping-options)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.order.listShippingOptions("order_123")
|
||||
.then(({ shipping_options }) => {
|
||||
console.log(shipping_options)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[FindParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.FindParams/page.mdx) & [AdminGetOrderShippingOptionList](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderShippingOptionList/page.mdx)","description":"Configure the fields to retrieve in each shipping option.","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":"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="listShippingOptions"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object>","optional":false,"defaultValue":"","description":"The list of shipping options.","expandable":false,"children":[{"name":"shipping_options","type":"[AdminShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOption/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The shipping option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The shipping option's name. Customers can\nsee this name during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone_id","type":"`string`","description":"The ID of the service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone","type":"[AdminServiceZone](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminServiceZone/page.mdx)","description":"The service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"[AdminFulfillmentProvider](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProvider/page.mdx)","description":"The fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_type_id","type":"`null` \\| `string`","description":"The ID of the shipping option's type.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option's type.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile","type":"[AdminShippingProfile](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingProfile/page.mdx)","description":"The shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionRule/page.mdx)[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminShippingOptionPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionPrice/page.mdx)[]","description":"The prices of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`null` \\| `Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]}Line truncated
|
||||
+1
-1
@@ -9,7 +9,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.5`.
|
||||
This is available starting from Medusa `v2.8.5`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.5`.
|
||||
This is available starting from Medusa `v2.8.5`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
+3
-3
@@ -6,11 +6,11 @@ This method creates and adds rules to a promotion. It can be the promotion's rul
|
||||
or its application method's buy or target rules. That depends on the rule type
|
||||
you specify as a parameter.
|
||||
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
[Manage Promotion's Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidrulesbatch).
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
[Manage Promotion's Buy Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidbuyrulesbatch).
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
[Manage Promotion's Target Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidtargetrulesbatch).
|
||||
|
||||
## Example
|
||||
|
||||
+2
-2
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# create
|
||||
|
||||
This method creates a new promotion. It sends a request to the
|
||||
This method creates a new promotion. It sends a request to the
|
||||
[Create Promotion](https://docs.medusajs.com/api/admin#promotions\_postpromotions)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.promotion.create({
|
||||
sdk.admin.promotion.create({
|
||||
name: "My Promotion",
|
||||
description: "This is a test promotion",
|
||||
code: "PROMO123",
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# delete
|
||||
|
||||
This method deletes a promotion. It sends a request to the
|
||||
This method deletes a promotion. It sends a request to the
|
||||
[Delete Promotion](https://docs.medusajs.com/api/admin#promotions\_deletepromotionsid)
|
||||
API route.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a list of promotions. It sends a request to the
|
||||
This method retrieves a list of promotions. It sends a request to the
|
||||
[List Promotions](https://docs.medusajs.com/api/admin#promotions\_getpromotions)
|
||||
API route.
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ sdk.admin.promotion.listRuleAttributes("rules", "standard")
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the attributes for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promotionType","type":"`string`","description":"The type of promotion to retrieve the attributes for. It can be `standard` or `buyget`.","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="listRuleAttributes"/>
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the attributes for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promotionType","type":"`string`","description":"The type of promotion to retrieve the attributes for. It can be `standard` or `buyget`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"applicationMethodTargetType","type":"`string`","description":"The type of application method to retrieve the attributes for. It can be `order`, `items` (default) or `shipping_methods`.","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="listRuleAttributes"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+4
-4
@@ -2,10 +2,10 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# listRuleValues
|
||||
|
||||
Retrieve all potential values for promotion rules and target and buy rules based on the specified rule attribute and type.
|
||||
For example, if you provide the ID of the `currency_code` rule attribute, and set `rule_type` to rules,
|
||||
Retrieve all potential values for promotion rules and target and buy rules based on the specified rule attribute and type.
|
||||
For example, if you provide the ID of the `currency_code` rule attribute, and set `rule_type` to rules,
|
||||
a list of currencies are retrieved in label-value pairs.
|
||||
|
||||
|
||||
This method sends a request to the
|
||||
[List Rule Values API Route](https://docs.medusajs.com/api/admin#promotions\_getpromotionsrulevalueoptionsrule\_typerule\_attribute\_id)
|
||||
|
||||
@@ -20,7 +20,7 @@ sdk.admin.promotion.listRuleValues("rules", "attr_123")
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the values for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleValue","type":"`string`","description":"The ID of the rule attribute to retrieve the values for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionsRuleValueParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionsRuleValueParams/page.mdx)","description":"Configure the fields to retrieve in the rule values.","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":"Search for a rule value by its searchable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by rule value.","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="listRuleValues"/>
|
||||
<TypeList types={[{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve the values for. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleValue","type":"`string`","description":"The ID of the rule attribute to retrieve the values for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionsRuleValueParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionsRuleValueParams/page.mdx)","description":"Configure the fields to retrieve in the rule values.","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":"Search for a rule value by its searchable","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by rule value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The application method's possible target types.","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="listRuleValues"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ sdk.admin.promotion.listRules("promo_123", "rules")
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`null` \\| `string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionRuleParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionRuleParams/page.mdx)","description":"Configure the fields to retrieve in the rules.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"promotion_type","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_type","type":"`string`","description":"","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="listRules"/>
|
||||
<TypeList types={[{"name":"id","type":"`null` \\| `string`","description":"The promotion's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ruleType","type":"`string`","description":"The type of rules to retrieve. Can be `rules`, `buy-rules`, or `target-rules`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminGetPromotionRuleParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetPromotionRuleParams/page.mdx)","description":"Configure the fields to retrieve in the rules.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"promotion_type","type":"[PromotionTypeValues](../../../../../promotion/types/promotion.PromotionTypeValues/page.mdx)","description":"The type of promotion to retrieve the attributes for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_type","type":"[ApplicationMethodTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTypeValues/page.mdx)","description":"The type of application method to retrieve the attributes for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"application_method_target_type","type":"[ApplicationMethodTargetTypeValues](../../../../../promotion/types/promotion.ApplicationMethodTargetTypeValues/page.mdx)","description":"The type of application method to retrieve the attributes for.","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="listRules"/>
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+3
-3
@@ -6,11 +6,11 @@ This method removes rules from a promotion. It can be the promotion's rules,
|
||||
or its application method's buy or target rules. That depends on the rule type
|
||||
you specify as a parameter.
|
||||
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
[Manage Promotion's Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidrulesbatch).
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
[Manage Promotion's Buy Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidbuyrulesbatch).
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
[Manage Promotion's Target Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidtargetrulesbatch).
|
||||
|
||||
## Example
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves a promotion by its ID. It sends a request to the
|
||||
This method retrieves a promotion by its ID. It sends a request to the
|
||||
[Retrieve Promotion](https://docs.medusajs.com/api/admin#promotions\_getpromotionsid)
|
||||
API route.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# update
|
||||
|
||||
This method updates a promotion. It sends a request to the
|
||||
This method updates a promotion. It sends a request to the
|
||||
[Update Promotion](https://docs.medusajs.com/api/admin#promotions\_postpromotionsid)
|
||||
API route.
|
||||
|
||||
|
||||
+3
-3
@@ -6,11 +6,11 @@ This method updates the rules of a promotion. It can be the promotion's rules,
|
||||
or its application method's buy or target rules. That depends on the rule type
|
||||
you specify as a parameter.
|
||||
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `rules`, the method sends a request to the
|
||||
[Manage Promotion's Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidrulesbatch).
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `buy-rules`, the method sends a request to the
|
||||
[Manage Promotion's Buy Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidbuyrulesbatch).
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
- If you set the `ruleType` to `target-rules`, the method sends a request to the
|
||||
[Manage Promotion's Target Rules API Route](https://docs.medusajs.com/api/admin#promotions\_postpromotionsidtargetrulesbatch).
|
||||
|
||||
## Example
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ sdk.admin.reservation.create({
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateReservation/page.mdx)","description":"The details of the reservation to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item that the reservation is for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the line item to create the reservation for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../..Line truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateReservation/page.mdx)","description":"The details of the reservation to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item that the reservation is for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`null` \\| `string`","description":"The ID of the line item to create the reservation for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"Sort the reservations by the given field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/tyLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -47,7 +47,7 @@ Learn more about the `fields` property in the [API reference](https://docs.medus
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdxLine truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"Sort the reservations by the given field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$like","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$re","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ilike","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$fulltext","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$overlap","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contains","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$contained","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$exists","type":"`boolean`","description"Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ sdk.admin.reservation.update("res_123", {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The reservation's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateReservation/page.mdx)","description":"The details of the reservation to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<TLine truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The reservation's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateReservation](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateReservation/page.mdx)","description":"The details of the reservation to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"location_id","type":"`string`","description":"The ID of the location that the quantity\nis reserved from.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`number`","description":"The quantity of the inventory item that is reserved.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs that can be added to the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminGetReservationsParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminGetReservationsParams/page.mdx)","description":"Configure the fields and relations to retrieve in the reservation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of reservations to retrieve.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of reservations to skip.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the location(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the inventory item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"line_item_id","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the line item(s) to retrieve the\nreservations for.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string` \\| `string`[]","description":"Sort the reservations by the given field.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`string` \\| `string`[]","description":"Filter by the ID(s) of the user(s) to retrieve the\nreservations they created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string` \\| [OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Filter by reservation description(s).","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$or","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$eq","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T> \\| [ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$ne","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$in","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$nin","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$not","type":"[Query](../../../../../types/types/types.Query/page.mdx)<T>","description":"API wrapper around the remoteQuery","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$gte","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$lt","type":"[ExpandScalar](../../../../../types/types/types.ExpandScalar/page.mdx)<T>","descriptLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ sdk.admin.shippingOption.create({
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOption/page.mdx)","description":"The details of the shipping option to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone_id","type":"`string`","description":"The ID of the service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"([AdminCreateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminCreateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx)[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"operator","type":"[RuleOperatorType](../../../../../types/CommonTypes/types/types.CommonTypes.RuleOperatorType/page.mdx)","description":"The operator of the shipping option rule.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"aLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOption/page.mdx)","description":"The details of the shipping option to create.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"service_zone_id","type":"`string`","description":"The ID of the service zone that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#service-zone-restrictions)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([AdminCreateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminCreateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"type_id","type":"`string`","description":"The ID of the type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"[AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx)[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":tLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ sdk.admin.shippingOption.update("so_123", {
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOption/page.mdx)","description":"The details of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"prices","type":"([AdminUpdateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminUpdateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the shipping option price that is being updated.\nIf not provided, a new shipping option price will be created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"([AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx) \\| [AdminUpdateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionRule/page.mdx))[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"operator","type":"[RuleOperatorType](../../../../../types/CommonTypes/types/types.CommonTypes.RuleOperatorType/page.mdx)","description":"The operator of the shipping option rule.","optional":false,"defaultValue":"","expandable":false,"children":[Line truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The ID of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateShippingOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOption/page.mdx)","description":"The details of the shipping option to update.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"name","type":"`string`","description":"The name of the shipping option. Customers can\nview this name during checkout.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Additional data that is useful for third-party fulfillment providers\nthat process fulfillments for the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"price_type","type":"[ShippingOptionPriceType](../../../../../fulfillment/types/fulfillment.ShippingOptionPriceType/page.mdx)","description":"The type of shipping option's price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The ID of the fulfillment provider that the shipping option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_profile_id","type":"`string`","description":"The ID of the shipping profile that the shipping option belongs to.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The type of shipping option.\n\nLearn more in the [Shipping Options](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"type_id","type":"`string`","description":"The ID of the type of shipping option.\n\nLearn more in the [Shipping Option](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-profile-and-types)\ndocumentation.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"([AdminUpdateShippingOptionPriceWithCurrency](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithCurrency/page.mdx) \\| [AdminUpdateShippingOptionPriceWithRegion](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionPriceWithRegion/page.mdx))[]","description":"The prices of the shipping option.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"rules","type":"[AdminShippingOptionPriceRulePayload](../../../../../types/interfaces/types.AdminShippingOptionPriceRulePayload/page.mdx)[]","description":"The rules of the shipping option price that\nindicate when the price should be applied.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the shipping option price that is being updated.\nIf not provided, a new shipping option price will be created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The amount of the shipping option price.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The ID of the region that the shipping option price belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"rules","type":"([AdminCreateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionRule/page.mdx) \\| [AdminUpdateShippingOptionRule](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionRule/page.mdx))[]","description":"The rules of the shipping option.\n\nLearn more in the [Shipping Option Rules](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#shipping-option-rules)\ndocumentation.Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# create
|
||||
|
||||
This method creates a shipping option type. It sends a request to the
|
||||
[Create Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_postshippingoptiontypes)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.create({
|
||||
label: "Standard",
|
||||
code: "standard",
|
||||
description: "Ship in 2-3 days."
|
||||
})
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the shipping option type.","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<[AdminShippingOptionTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type's details.","expandable":false,"children":[{"name":"shipping_option_type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# delete
|
||||
|
||||
This method deletes a shipping option type. It sends a request to the
|
||||
[Delete Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_deleteshippingoptiontypesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.delete("sotype_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The shipping option type's ID.","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<[AdminShippingOptionTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type'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":"`\"shipping_option_type\"`","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"/>
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of shipping option types. It sends a request to the
|
||||
[List Shipping Option Types](https://docs.medusajs.com/api/admin#shipping-option-types\_getshippingoptiontypes) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of shipping option types:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.list()
|
||||
.then(({ shipping_option_types, count, limit, offset }) => {
|
||||
console.log(shipping_option_types)
|
||||
})
|
||||
```
|
||||
|
||||
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.shippingOptionType.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ shipping_option_types, count, limit, offset }) => {
|
||||
console.log(shipping_option_types)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each shipping option type:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.list({
|
||||
fields: "id,*shippingOptions"
|
||||
})
|
||||
.then(({ shipping_option_types, count, limit, offset }) => {
|
||||
console.log(shipping_option_types)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"query","type":"[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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 apply filters on the type's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by shipping option type ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string` \\| `string`[]","description":"Filter by label(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string` \\| `string`[]","description":"Filter by code(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the creation date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the update date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"$or","type":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListParams/page.mdx)>)[]","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":"$and","type":"([AdminShippingOptionTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListPLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminShippingOptionTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of shipping option types.","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":[]},{"name":"shipping_option_types","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)[]","description":"The list of shipping option types.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"estimate_count","type":"`number`","description":"The estimated count retrieved from the PostgreSQL query planner, which may be inaccurate.","optional":true,"defaultValue":"","expandable":false,"featureFlag":"index_engine","children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves a shipping option type by its ID. It sends a request to the
|
||||
[Get Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_getshippingoptiontypesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a shipping option type by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.retrieve("sotype_123")
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.retrieve("sotype_123", {
|
||||
fields: "id,*shippingOptions"
|
||||
})
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The shipping option type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the shipping option type.","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<[AdminShippingOptionTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type's details.","expandable":false,"children":[{"name":"shipping_option_type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# update
|
||||
|
||||
This method updates a shipping option type. It sends a request to the
|
||||
[Update Shipping Option Type](https://docs.medusajs.com/api/admin#shipping-option-types\_postshippingoptiontypesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.shippingOptionType.update("sotype_123", {
|
||||
code: "express"
|
||||
})
|
||||
.then(({ shipping_option_type }) => {
|
||||
console.log(shipping_option_type)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The shipping option type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateShippingOptionType/page.mdx)","description":"The data to update in the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Configure the fields to retrieve in the shipping option type.","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<[AdminShippingOptionTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The shipping option type's details.","expandable":false,"children":[{"name":"shipping_option_type","type":"[AdminShippingOptionType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminShippingOptionType/page.mdx)","description":"The shipping option type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"label","type":"`string`","description":"The label of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The description of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`string`","description":"The code of the shipping option type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_option_id","type":"`string`","description":"The ID of the shipping option that this type is created for.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date when the shipping option type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date when the shipping option type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date when the shipping option type was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
+327
@@ -0,0 +1,327 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# client
|
||||
|
||||
## baseUrl
|
||||
|
||||
___
|
||||
|
||||
## globalHeaders
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### tags
|
||||
|
||||
Tags to cache data under for Next.js applications.
|
||||
|
||||
Learn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).
|
||||
|
||||
___
|
||||
|
||||
## publishableKey
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
___
|
||||
|
||||
## apiKey
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
___
|
||||
|
||||
## auth
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### type
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### jwtTokenStorageKey
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### jwtTokenStorageMethod
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### fetchCredentials
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### storage
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
#### Properties
|
||||
|
||||
<TypeList types={[{"name":"getItem","type":"(`key`: `string`) => [Awaitable](../../../types/js_sdk.admin.Awaitable/page.mdx)<null \\| string>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"setItem","type":"(`key`: `string`, `value`: `string`) => [Awaitable](../../../types/js_sdk.admin.Awaitable/page.mdx)<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"removeItem","type":"(`key`: `string`) => [Awaitable](../../../types/js_sdk.admin.Awaitable/page.mdx)<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="storage"/>
|
||||
|
||||
### type
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### jwtTokenStorageKey
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### jwtTokenStorageMethod
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### fetchCredentials
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### storage
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
#### Properties
|
||||
|
||||
<TypeList types={[{"name":"getItem","type":"(`key`: `string`) => [Awaitable](../../../types/js_sdk.admin.Awaitable/page.mdx)<null \\| string>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"setItem","type":"(`key`: `string`, `value`: `string`) => [Awaitable](../../../types/js_sdk.admin.Awaitable/page.mdx)<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"removeItem","type":"(`key`: `string`) => [Awaitable](../../../types/js_sdk.admin.Awaitable/page.mdx)<void>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="storage"/>
|
||||
|
||||
___
|
||||
|
||||
## logger
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
### error
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### warn
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### info
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
### debug
|
||||
|
||||
#### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## debug
|
||||
|
||||
<BadgesList badges={[
|
||||
{
|
||||
"variant": "neutral",
|
||||
"children": "optional"
|
||||
}
|
||||
]} className="mb-1" />
|
||||
|
||||
## error
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## warn
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## info
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
___
|
||||
|
||||
## debug
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"messages","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="__type"/>
|
||||
|
||||
## constructor
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"config","type":"[Config](../../../types/js_sdk.admin.Config/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"baseUrl","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"globalHeaders","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":[]}]},{"name":"publishableKey","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"apiKey","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"auth","type":"`object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"type","type":"`\"jwt\"` \\| `\"session\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtTokenStorageKey","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"jwtTokenStorageMethod","type":"`\"local\"` \\| `\"session\"` \\| `\"memory\"` \\| `\"custom\"` \\| `\"nostore\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"fetchCredentials","type":"`\"include\"` \\| `\"omit\"` \\| `\"same-origin\"`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"storage","type":"[CustomStorage](../../../interfaces/js_sdk.admin.CustomStorage/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"logger","type":"[Logger](../../../types/js_sdk.admin.Logger/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"error","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"warn","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"info","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"debug","type":"(...`messages`: `string`[]) => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"debug","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="Client"/>
|
||||
|
||||
___
|
||||
|
||||
`fetch` closely follows (and uses under the hood) the native `fetch` API. There are, however, few key differences:
|
||||
- Non 2xx statuses throw a `FetchError` with the status code as the `status` property, rather than resolving the promise
|
||||
- You can pass `body` and `query` as objects, and they will be encoded and stringified.
|
||||
- The response gets parsed as JSON if the `accept` header is set to `application/json`, otherwise the raw Response object is returned
|
||||
|
||||
Since the response is dynamically determined, we cannot know if it is JSON or not. Therefore, it is important to pass `Response` as the return type
|
||||
|
||||
## Type Parameters
|
||||
|
||||
<TypeList types={[{"name":"T","type":"`unknown`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetch"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"`string` \\| `URL` \\| `Request`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"init","type":"[FetchArgs](../../../types/js_sdk.admin.FetchArgs/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"query","type":"`Record<string, any>`","description":"","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":[]}]},{"name":"body","type":"`RequestInit`[`\"body\"`] \\| `Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetch"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<T>","optional":false,"defaultValue":"","description":"Promise<T>","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetch"/>
|
||||
|
||||
`fetchStream` is a helper method to deal with server-sent events. It returns an object with a stream and an abort function.
|
||||
It follows a very similar interface to `fetch`, with the return value being an async generator.
|
||||
The stream is an async generator that yields `ServerSentEventMessage` objects, which contains the event name, stringified data, and few other properties.
|
||||
The caller is responsible for handling `disconnect` events and aborting the stream. The caller is also responsible for parsing the data field.
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"input","type":"`string` \\| `URL` \\| `Request`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"init","type":"[FetchArgs](../../../types/js_sdk.admin.FetchArgs/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"query","type":"`Record<string, any>`","description":"","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":[]}]},{"name":"body","type":"`RequestInit`[`\"body\"`] \\| `Record<string, any>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetchStream"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[FetchStreamResponse](../../../interfaces/js_sdk.admin.FetchStreamResponse/page.mdx)>","optional":false,"defaultValue":"","description":"FetchStreamResponse","expandable":false,"children":[{"name":"stream","type":"`null` \\| AsyncGenerator<[ServerSentEventMessage](../../../interfaces/js_sdk.admin.ServerSentEventMessage/page.mdx), void, unknown>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"comment","type":"`string`","description":"Ignored by the client.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"event","type":"`string`","description":"A string identifying the type of event described.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`string`","description":"The data field for the message. Split by new lines.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `number`","description":"The event ID to set the EventSource object's last event ID value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"retry","type":"`number`","description":"The reconnection time.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"abort","type":"() => `void`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="fetchStream"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"token","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<undefined \\| null \\| string>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"undefined \\| null \\| string","type":"`undefined` \\| `null` \\| `string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="clearToken"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="clearToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"ClientFetch","type":"(`input`: [FetchInput](../../../types/js_sdk.admin.FetchInput/page.mdx), `init?`: [FetchArgs](../../../types/js_sdk.admin.FetchArgs/page.mdx)) => Promise<Response>","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="initClient"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"object \\| object","type":"`object` \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getApiKeyHeader_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"object \\| object","type":"`object` \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getPublishableKeyHeader_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object \\| object>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"object \\| object","type":"`object` \\| `object`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getJwtHeader_"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"token","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<void>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="setToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<undefined \\| null \\| string>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"undefined \\| null \\| string","type":"`undefined` \\| `null` \\| `string`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getToken_"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"storageMethod","type":"`\"session\"` \\| `\"local\"` \\| `\"memory\"` \\| `\"custom\"` \\| `\"nostore\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"storageKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getTokenStorageInfo_"/>
|
||||
|
||||
<TypeList types={[{"name":"storageMethod","type":"`\"session\"` \\| `\"local\"` \\| `\"memory\"` \\| `\"custom\"` \\| `\"nostore\"`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"storageKey","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="getTokenStorageInfo_"/>
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"message","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="throwError_"/>
|
||||
+1
-1
@@ -8,7 +8,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.0`.
|
||||
This is available starting from Medusa `v2.8.0`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ API route.
|
||||
|
||||
:::note
|
||||
|
||||
This is only available after Medusa `v2.8.0`.
|
||||
This is available starting from Medusa `v2.8.0`.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
@@ -45,6 +45,7 @@ The `sdk.admin` class provides methods to send requests to Medusa's Admin API ro
|
||||
- [returnReason](../../Admin/properties/js_sdk.admin.Admin.returnReason/page.mdx)
|
||||
- [salesChannel](../../Admin/properties/js_sdk.admin.Admin.salesChannel/page.mdx)
|
||||
- [shippingOption](../../Admin/properties/js_sdk.admin.Admin.shippingOption/page.mdx)
|
||||
- [shippingOptionType](../../Admin/properties/js_sdk.admin.Admin.shippingOptionType/page.mdx)
|
||||
- [shippingProfile](../../Admin/properties/js_sdk.admin.Admin.shippingProfile/page.mdx)
|
||||
- [stockLocation](../../Admin/properties/js_sdk.admin.Admin.stockLocation/page.mdx)
|
||||
- [store](../../Admin/properties/js_sdk.admin.Admin.store/page.mdx)
|
||||
|
||||
@@ -15,6 +15,7 @@ import { TypeList } from "docs-ui"
|
||||
- [list](../../Order/methods/js_sdk.admin.Order.list/page.mdx)
|
||||
- [listChanges](../../Order/methods/js_sdk.admin.Order.listChanges/page.mdx)
|
||||
- [listLineItems](../../Order/methods/js_sdk.admin.Order.listLineItems/page.mdx)
|
||||
- [listShippingOptions](../../Order/methods/js_sdk.admin.Order.listShippingOptions/page.mdx)
|
||||
- [markAsDelivered](../../Order/methods/js_sdk.admin.Order.markAsDelivered/page.mdx)
|
||||
- [requestTransfer](../../Order/methods/js_sdk.admin.Order.requestTransfer/page.mdx)
|
||||
- [retrieve](../../Order/methods/js_sdk.admin.Order.retrieve/page.mdx)
|
||||
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# ShippingOptionType
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ShippingOptionType/methods/js_sdk.admin.ShippingOptionType.create/page.mdx)
|
||||
- [delete](../../ShippingOptionType/methods/js_sdk.admin.ShippingOptionType.delete/page.mdx)
|
||||
- [list](../../ShippingOptionType/methods/js_sdk.admin.ShippingOptionType.list/page.mdx)
|
||||
- [retrieve](../../ShippingOptionType/methods/js_sdk.admin.ShippingOptionType.retrieve/page.mdx)
|
||||
- [update](../../ShippingOptionType/methods/js_sdk.admin.ShippingOptionType.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ShippingOptionType/properties/js_sdk.admin.ShippingOptionType.client/page.mdx)
|
||||
Reference in new issue
Block a user