chore(docs): Generated References (automated) (#10276)
Generated the following references: - `api_key` - `auth` - `cart` - `core_flows` - `currency` - `customer` - `dml` - `fulfillment` - `helper_steps` - `inventory_next` - `js_sdk` - `medusa` - `medusa_config` - `modules` - `modules_sdk` - `order` - `payment` - `payment_provider` - `pricing` - `product` - `product_models` - `promotion` - `region` - `sales_channel` - `search` - `stock_location_next` - `store` - `tax` - `tax_provider` - `types` - `user` - `utils` - `workflows` Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
1 parent
67e2e718e9
commit
d5ee0070b4
928 files changed
+182409
-172163
No files matched your search
+31
-3
@@ -11,7 +11,7 @@ This documentation provides a reference to the `sdk.admin.order` set of methods
|
||||
|
||||
## retrieve
|
||||
|
||||
This method retrieves an order by its ID. It sends a request to the
|
||||
This method retrieves an order by its ID. It sends a request to the
|
||||
[Get Order](https://docs.medusajs.com/api/admin#orders\_getordersid)
|
||||
API route.
|
||||
|
||||
@@ -51,7 +51,7 @@ ___
|
||||
|
||||
## retrievePreview
|
||||
|
||||
This method retrieves the preview of an order based on its last associated change. It sends a request to the
|
||||
This method retrieves the preview of an order based on its last associated change. It sends a request to the
|
||||
[Get Order Preview](https://docs.medusajs.com/api/admin#orders\_getordersidpreview) API route.
|
||||
|
||||
### Example
|
||||
@@ -75,7 +75,7 @@ ___
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a paginated list of orders. It sends a request to the
|
||||
This method retrieves a paginated list of orders. It sends a request to the
|
||||
[List Orders](https://docs.medusajs.com/api/admin#orders\_getorders) API route.
|
||||
|
||||
### Example
|
||||
@@ -152,6 +152,34 @@ sdk.admin.order.cancel("order_123")
|
||||
|
||||
___
|
||||
|
||||
## requestTransfer
|
||||
|
||||
This method requests an order transfer. It sends a request to the
|
||||
[Request Order Transfer](https://docs.medusajs.com/api/admin#orders\_postordersidrequesttransfer)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.order.requestTransfer("order_123", {
|
||||
customer_id: "cus_123",
|
||||
internal_note: "Internal note",
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminRequestOrderTransfer](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRequestOrderTransfer/page.mdx)","description":"The transfer's details - the id of the next owner.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="requestTransfer"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order's details.","expandable":false,"children":[{"name":"AdminOrderResponse","type":"[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx)[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx)[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"`number`","description":"The tax total applied on the order's items, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"`number`","description":"The total of the order including taxes, excluding promotions.","optional":false,"defaLine truncated
|
||||
|
||||
___
|
||||
|
||||
## createFulfillment
|
||||
|
||||
This method creates a fulfillment for an order. It sends a request to the
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ sdk.admin.orderEdit.initiateRequest({
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order edit's details.","expandable":false,"children":[{"name":"AdminOrderEditResponse","type":"[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The order edit's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"The claim's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_order","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"The return's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"The exchange's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actions","type":"[AdminOrderChangeAction](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeAction/page.mdx)[]","description":"The order change action's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"The ID of the associated return order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"The ID of the associated exchange order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"The ID of the associated claim order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderChangeStatus](../../../../../fulfillment/types/fulfillment.OrderChangeStatus/page.mdx)","description":"The status of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_by","type":"`null` \\| `string`","description":"The requested by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_at","type":"`null` \\| `Date`","description":"When the order change was requested","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_by","type":"`null` \\| `string`","description":"The confirmed by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_at","type":"`null` \\| `Date`","description":"When the order change was confirmed","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_by","type":"`null` \\| `string`","description":"The declined by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_reason","type":"`null` \\| `string`","description":"The declined reason of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_at","type":"`null` \\| `Date`","description":"When the order change was declined","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_by","type":"`null` \\| `string`","description":"The canceled by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`null` \\| `Date`","description":"When the order change was canceled","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order change was created","optional":false,"defaultValue":"","expandablLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order edit's details.","expandable":false,"children":[{"name":"AdminOrderEditResponse","type":"[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The order edit's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"The claim's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_order","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"The return's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"The exchange's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actions","type":"[AdminOrderChangeAction](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeAction/page.mdx)[]","description":"The order change action's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"The ID of the associated return order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"The ID of the associated exchange order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"The ID of the associated claim order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderChangeStatus](../../../../../fulfillment/types/fulfillment.OrderChangeStatus/page.mdx)","description":"The status of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_by","type":"`null` \\| `string`","description":"The requested by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_at","type":"`null` \\| `Date`","description":"When the order change was requested","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_by","type":"`null` \\| `string`","description":"The confirmed by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_at","type":"`null` \\| `Date`","description":"When the order change was confirmed","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_by","type":"`null` \\| `string`","description":"The declined by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_reason","type":"`null` \\| `string`","description":"The declined reason of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_at","type":"`null` \\| `Date`","description":"When the order change was declined","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_by","type":"`null` \\| `string`","description":"The canceled by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`null` \\| `Date`","description":"When the order change was canceled","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order change was created","optional":false,"defaultValue":"","expandablLine truncated
|
||||
|
||||
___
|
||||
|
||||
|
||||
+590
-42
@@ -11,250 +11,798 @@ This documentation provides a reference to the `sdk.admin.product` set of method
|
||||
|
||||
## import
|
||||
|
||||
This method creates a product import. The products are only imported after
|
||||
the import is confirmed using the [confirmImport](../../../Product/methods/js_sdk.admin.Product.confirmImport/page.mdx) method.
|
||||
|
||||
This method sends a request to the
|
||||
[Create Product Import](https://docs.medusajs.com/api/admin#products\_postproductsimport)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.import({
|
||||
file // uploaded File instance
|
||||
})
|
||||
.then(({ transaction_id }) => {
|
||||
console.log(transaction_id)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminImportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"file","type":"[File](../../../../../core_flows/core_flows.File/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"`object`","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":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
<TypeList types={[{"name":"body","type":"[AdminImportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductRequest/page.mdx)","description":"The import's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"file","type":"[File](../../../../../core_flows/core_flows.File/page.mdx)","description":"The CSV file to import the products from.\n\nIt's an uploaded file of type [File](https://developer.mozilla.org/en-US/docs/Web/API/File).","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"`object`","description":"Query parameters to pass to the request.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminImportProductResponse","type":"[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"toCreate","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"toUpdate","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The import's details.","expandable":false,"children":[{"name":"AdminImportProductResponse","type":"[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"The ID of the import product workflow execution's transaction. \nThis is useful to confirm the import using the `/admin/products/:transaction-id/import` API route.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"`object`","description":"Details of the products to create or update when the import is confirmed.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"toCreate","type":"`number`","description":"The number of products that will be created by the import.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"toUpdate","type":"`number`","description":"The number of products that will be updated by the import.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
|
||||
___
|
||||
|
||||
## confirmImport
|
||||
|
||||
This method confirms a product import created using the method [import](../../../Product/methods/js_sdk.admin.Product.import/page.mdx).
|
||||
It sends a request to the
|
||||
[Confirm Product Import](https://docs.medusajs.com/api/admin#products\_postproductsimporttransaction\_idconfirm)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.confirmImport("transaction_123")
|
||||
.then(() => {
|
||||
console.log("Import confirmed")
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"transactionId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`object`","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":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
<TypeList types={[{"name":"transactionId","type":"`string`","description":"The ID of the transaction of the created product import. This is returned\nby the API route used to create the product import.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`object`","description":"Query parameters to pass in the request.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object>","optional":false,"defaultValue":"","description":"This method confirms a product import created using the method [import](../../../Product/methods/js_sdk.admin.Product.import/page.mdx).\nIt sends a request to the \n[Confirm Product Import](https://docs.medusajs.com/api/admin#products\\_postproductsimporttransaction\\_idconfirm)\nAPI route.","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
|
||||
___
|
||||
|
||||
## export
|
||||
|
||||
This method starts a product export process to retrieve a CSV of exported products.
|
||||
|
||||
You'll receive in the response the transaction ID of the workflow generating the CSV file.
|
||||
To check the status of the execution, send a `GET` request to
|
||||
`/admin/workflows-executions/export-products/:transaction-id`.
|
||||
|
||||
Once the execution finishes successfully, a notification is created for the export.
|
||||
You can retrieve the notifications using the `/admin/notification` API route to
|
||||
retrieve the file's download URL.
|
||||
|
||||
This method sends a request to the [Export Product](https://docs.medusajs.com/api/admin#products\_postproductsexport)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.export({})
|
||||
.then(({ transaction_id }) => {
|
||||
console.log(transaction_id)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminExportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"createdLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminExportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductRequest/page.mdx)","description":"The export's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"Filters to specify which products to export.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"deLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminExportProductResponse","type":"[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="export"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The export's details.","expandable":false,"children":[{"name":"AdminExportProductResponse","type":"[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"The ID of the export product workflow's transaction.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="export"/>
|
||||
|
||||
___
|
||||
|
||||
## batch
|
||||
|
||||
This method manages products to create, update, or delete them. It sends a request to the
|
||||
[Manage Products](https://docs.medusajs.com/api/admin#products\_postproductsbatch)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.batch({
|
||||
create: [
|
||||
{
|
||||
title: "Shirt",
|
||||
options: [{
|
||||
title: "Default",
|
||||
values: ["Default Option"]
|
||||
}],
|
||||
variants: [
|
||||
{
|
||||
title: "Default",
|
||||
options: {
|
||||
Default: "Default Option"
|
||||
},
|
||||
prices: []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
update: [{
|
||||
id: "prod_123",
|
||||
title: "Pants"
|
||||
}],
|
||||
delete: ["prod_321"]
|
||||
})
|
||||
.then(({ created, updated, deleted }) => {
|
||||
console.log(created, updated, deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminBatchProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channels","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminUpdateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","deLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminBatchProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductRequest/page.mdx)","description":"The products to create, update, or delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`string`","description":"The product's subtitle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The product's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether discounts can be applied on the product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"The product's images.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`string`","description":"The product's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"The ID of the product's type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"The ID of the product in an external or third-party system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"The ID of the product's collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"The product's categories.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`object`[]","description":"The product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"The product's variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channels","type":"`object`[]","description":"The sales channels that the product is available in.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The product's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The product's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The product's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The product's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The product's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The product's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The product's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The product's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminBatchUpdateProduct](../../../../../types/interfaces/types.AdminBatchUpdateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the produLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminBatchProductResponse","type":"[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date theLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The batch operations details.","expandable":false,"children":[{"name":"AdminBatchProductResponse","type":"[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","typLine truncated
|
||||
|
||||
___
|
||||
|
||||
## create
|
||||
|
||||
This method creates a product. It sends a request to the
|
||||
[Create Product](https://docs.medusajs.com/api/admin#products\_postproducts)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.create({
|
||||
title: "Shirt",
|
||||
options: [{
|
||||
title: "Default",
|
||||
values: ["Default Option"]
|
||||
}],
|
||||
variants: [
|
||||
{
|
||||
title: "Default",
|
||||
options: {
|
||||
Default: "Default Option"
|
||||
},
|
||||
prices: []
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"subtitle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expaLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"subtitle","type":"`string`","description":"The product's subtitle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The product's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether discounts can be applied on the product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"The product's images.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"The image's URL.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`string`","description":"The product's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"The ID of the product's type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"The ID of the product in an external or third-party system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"The ID of the product's collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"The product's categories.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of a product category that the product belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"The product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the associated product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"The product's variants.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","desLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## update
|
||||
|
||||
This method updates a product. It sends a request to the
|
||||
[Update Product](https://docs.medusajs.com/api/admin#products\_postproductsid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.update("prod_123", {
|
||||
title: "Shirt",
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"([AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx) \\| [AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx))[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type"Line truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProduct/page.mdx)","description":"The data to update in the product.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether discounts can be applied on the product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"The product's images.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"The image's URL.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in an external or third-party system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"The product's categories.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the category that the product belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"The product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of a tag that the product is associated with.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)[]","description":"The product's options.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"([AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx) \\| [AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx))[]","description":"The product's variants.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandaLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a paginated list of products. It sends a request to the
|
||||
[List Products](https://docs.medusajs.com/api/admin#products\_getproducts) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of products:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.list()
|
||||
.then(({ products, count, limit, offset }) => {
|
||||
console.log(products)
|
||||
})
|
||||
```
|
||||
|
||||
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.product.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ products, count, limit, offset }) => {
|
||||
console.log(products)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each products:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.list({
|
||||
fields: "id,*variants"
|
||||
})
|
||||
.then(({ products, count, limit, offset }) => {
|
||||
console.log(products)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"queryParams","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filers on the product's creation date.","optional":true,"defaultValue":"","expandable":false,"chilLine truncated
|
||||
<TypeList types={[{"name":"queryParams","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filers on the product's creation date.","optional":true,"defaultValue":"","expandable":false,"chilLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductListResponse","type":"[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of products.","expandable":false,"children":[{"name":"AdminProductListResponse","type":"[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
|
||||
___
|
||||
|
||||
## retrieve
|
||||
|
||||
This method retrieves a product by its ID. It sends a request to the
|
||||
[Get Product](https://docs.medusajs.com/api/admin#products\_getproductsid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve a product by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieve("prod_123")
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieve("prod_123", {
|
||||
fields: "id,*variants"
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
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":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product'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 product.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## delete
|
||||
|
||||
This method deletes a product. It sends a request to the
|
||||
[Delete Product](https://docs.medusajs.com/api/admin#products\_deleteproductsid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.delete("prod_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product'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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductDeleteResponse","type":"[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductDeleteResponse","type":"[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
___
|
||||
|
||||
## batchVariants
|
||||
|
||||
This method manages the variants of a product. It sends a request to the
|
||||
[Manage Variants](https://docs.medusajs.com/api/admin#products\_postproductsidvariantsbatch)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.batchVariants("prod_123", {
|
||||
create: [
|
||||
{
|
||||
title: "Blue Shirt",
|
||||
options: {
|
||||
Color: "Blue"
|
||||
},
|
||||
prices: []
|
||||
}
|
||||
],
|
||||
update: [
|
||||
{
|
||||
id: "variant_123",
|
||||
title: "Pants"
|
||||
}
|
||||
],
|
||||
delete: ["variant_123"]
|
||||
})
|
||||
.then(({ created, updated, deleted }) => {
|
||||
console.log(created, updated, deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminBatchUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchUpdateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children"Line truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantRequest/page.mdx)","description":"The variants to create, update, or delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether Medusa manages the variant's inventory. If disabled,\nthe variant is always considered in stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"The variant's ranking among its sibling variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The variant's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The variant's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The variant's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The variant's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The variant's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The variant's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"The variant's inventory items. It's only\navailable if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The variant's values for the associated product's options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminBatchUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchUpdateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the variant to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The variant's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPCLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminBatchProductVariantResponse","type":"[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The variant's product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`stringLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product variants' details.","expandable":false,"children":[{"name":"AdminBatchProductVariantResponse","type":"[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"The product variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the associated product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product that this variant belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":trueLine truncated
|
||||
|
||||
___
|
||||
|
||||
## createVariant
|
||||
|
||||
This method creates a variant for a product. It sends a request to the
|
||||
[Create Variant](https://docs.medusajs.com/api/admin#products\_postproductsidvariants)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.createVariant("prod_123", {
|
||||
title: "Blue Shirt",
|
||||
options: {
|
||||
Color: "Blue"
|
||||
},
|
||||
prices: [
|
||||
{
|
||||
amount: 10,
|
||||
currency_code: "usd"
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"required_quantity","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"childLine truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)","description":"The variant's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The price's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"The price's rules.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether Medusa manages the variant's inventory. If disabled,\nthe variant is always considered in stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"The variant's ranking among its sibling variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The variant's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The variant's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The variant's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The variant's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The variant's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The variant's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"The variant's inventory items. It's only\navailable if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"required_quantity","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"The variant's values for the associated product's options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## updateVariant
|
||||
|
||||
This method updates a variant of a product. It sends a request to the
|
||||
[Update Variant](https://docs.medusajs.com/api/admin#products\_postproductsidvariantsvariant\_id)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.updateVariant(
|
||||
"prod_123",
|
||||
"variant_123",
|
||||
{
|
||||
title: "Blue Shirt",
|
||||
}
|
||||
)
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateVariant"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx)","description":"The data to update in the variant.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether Medusa should manage the variant's inventory. If disabled,\nthe variant is always considered in stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"The variant's ranking among its sibling variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The price's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"The price's rules.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"The variant's values for the associated product's options.","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 product.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## listVariants
|
||||
|
||||
This method retrieves a paginated list of products. It sends a request to the
|
||||
[List Products](https://docs.medusajs.com/api/admin#products\_getproductsidvariants) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of product variants:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listVariants("prod_123")
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
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.product.listVariants("prod_123", {
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product variant:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listVariants("prod_123", {
|
||||
fields: "id,*product"
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.Line truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The ID of the product to retrieve its variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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 filter the variant's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by variant ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Filter by whether Medusa manages the inventory of the variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Filter by whether the variant can be ordered even if it's\nout of stock.","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 variant's 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 variant's 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 variant's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listVariants"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product variants.","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listVariants"/>
|
||||
|
||||
___
|
||||
|
||||
## retrieveVariant
|
||||
|
||||
This method retrieves a product's variant. It sends a request to the
|
||||
[Retrieve Variant](https://docs.medusajs.com/api/admin#products\_getproductsidvariantsvariant\_id)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve a product variant by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveVariant(
|
||||
"prod_123",
|
||||
"variant_123"
|
||||
)
|
||||
.then(({ variant }) => {
|
||||
console.log(variant)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveVariant(
|
||||
"prod_123",
|
||||
"variant_123",
|
||||
{
|
||||
fields: "id, *product"
|
||||
}
|
||||
)
|
||||
.then(({ variant }) => {
|
||||
console.log(variant)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveVariant"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant'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 product variant.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveVariant"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantResponse","type":"[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variant","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The variant's product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID ofLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product variant's details.","expandable":false,"children":[{"name":"AdminProductVariantResponse","type":"[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variant","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"The product variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the associated product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product that this variant belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":true,"defaultValue":"","expandaLine truncated
|
||||
|
||||
___
|
||||
|
||||
## deleteVariant
|
||||
|
||||
This method deletes a product's variant. It sends a request to the
|
||||
[Delete Variant](https://docs.medusajs.com/api/admin#products\_deleteproductsidvariantsvariant\_id)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.deleteVariant("prod_123", "variant_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteVariant"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the variant.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteVariant"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantDeleteResponse","type":"[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"variant\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"Line truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductVariantDeleteResponse","type":"[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"variant\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":Line truncated
|
||||
|
||||
___
|
||||
|
||||
## batchVariantInventoryItems
|
||||
|
||||
This method manages a product's variant's inventories to associate them with inventory items,
|
||||
update their inventory items, or delete their association with inventory items.
|
||||
|
||||
It sends a request to the
|
||||
[Manage Variant Inventory](https://docs.medusajs.com/api/admin#products\_postproductsidvariantsinventoryitemsbatch)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.batchVariantInventoryItems(
|
||||
"prod_123",
|
||||
{
|
||||
create: [
|
||||
{
|
||||
inventory_item_id: "iitem_123",
|
||||
variant_id: "variant_123",
|
||||
required_quantity: 10
|
||||
}
|
||||
],
|
||||
update: [
|
||||
{
|
||||
inventory_item_id: "iitem_1234",
|
||||
variant_id: "variant_1234",
|
||||
required_quantity: 20
|
||||
}
|
||||
],
|
||||
delete: [
|
||||
{
|
||||
inventory_item_id: "iitem_321",
|
||||
variant_id: "variant_321"
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
.then(({ created, updated, deleted }) => {
|
||||
console.log(created, updated, deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantInventoryItemRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminCreateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminUpdateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminUpdateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"delete","type":"[AdminDeleteProductVariantInventoryItem](../../../../../types/interfaces/types.AdminDeleteProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchVariantInventoryItems"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The ID of the product that the variant belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantInventoryItemRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemRequest/page.mdx)","description":"The inventory items to create, update, or delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminCreateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"The number of units a single quantity is equivalent to. For example, if a customer orders one quantity of the variant, Medusa checks the availability of the quantity multiplied by the\nvalue set for `required_quantity`. When the customer orders the quantity, Medusa reserves the ordered quantity multiplied by the value set for `required_quantity`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminUpdateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminUpdateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"The number of units a single quantity is equivalent to. For example, if a customer orders one quantity of the variant, Medusa checks the availability of the quantity multiplied by the\nvalue set for `required_quantity`. When the customer orders the quantity, Medusa reserves the ordered quantity multiplied by the value set for `required_quantity`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"delete","type":"[AdminDeleteProductVariantInventoryItem](../../../../../types/interfaces/types.AdminDeleteProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Pass query parameters in the request.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchVariantInventoryItems"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminBatchProductVariantInventoryItemResponse","type":"[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The inventory item's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The inventory item's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The inventory item's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The inventory item's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The inventory item's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The inventory item's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The inventory item's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_levels","type":"[AdminInventoryLevel](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel/page.mdx)[]","description":"The item's associated inventory levels.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The inventory item's weight.","optional":true,"defLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the created, updated, or deleted inventory items.","expandable":false,"children":[{"name":"AdminBatchProductVariantInventoryItemResponse","type":"[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The inventory item's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The inventory item's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The inventory item's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The inventory item's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The inventory item's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The inventory item's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The inventory item's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_levels","type":"[AdminInventoryLevel](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel/page.mdx)[]","description":"The item's associated inventory levels.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","Line truncated
|
||||
|
||||
___
|
||||
|
||||
## createOption
|
||||
|
||||
This method creates an option in a product. It sends a request to the
|
||||
[Create Option](https://docs.medusajs.com/api/admin#products\_postproductsidoptions)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.createOption(
|
||||
"prod_123",
|
||||
{
|
||||
title: "Color",
|
||||
values: ["Green", "Blue"]
|
||||
}
|
||||
)
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)","description":"The option's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","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 product.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createOption"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## updateOption
|
||||
|
||||
This method updates a product's option. It sends a request to the
|
||||
[Update Option](https://docs.medusajs.com/api/admin#products\_postproductsidoptionsoption\_id)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.updateOption(
|
||||
"prod_123",
|
||||
"prodopt_123",
|
||||
{
|
||||
title: "Color"
|
||||
}
|
||||
)
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the option to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)","description":"The data to update in the option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","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 product.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOption"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
|
||||
___
|
||||
|
||||
## listOptions
|
||||
|
||||
This method retrieves a paginated list of product options. It sends a request to the
|
||||
[List Options](https://docs.medusajs.com/api/admin#products\_getproductsidoptions) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of product options:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listOptions("prod_123")
|
||||
.then(({ product_options, count, limit, offset }) => {
|
||||
console.log(product_options)
|
||||
})
|
||||
```
|
||||
|
||||
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.product.listOptions("prod_123", {
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ product_options, count, limit, offset }) => {
|
||||
console.log(product_options)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product options:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listOptions("prod_123", {
|
||||
fields: "id,title"
|
||||
})
|
||||
.then(({ product_options, count, limit, offset }) => {
|
||||
console.log(product_options)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[AdminProductOptionParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/tyLine truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The ID of the product to retrieve its options","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductOptionParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":[]},{"nameLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductOptionListResponse","type":"[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listOptions"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product options.","expandable":false,"children":[{"name":"AdminProductOptionListResponse","type":"[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listOptions"/>
|
||||
|
||||
___
|
||||
|
||||
## retrieveOption
|
||||
|
||||
This method retrieves a product's option. It sends a request to the
|
||||
[Get Option](https://docs.medusajs.com/api/admin#products\_getproductsidoptionsoption\_id)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve a product option by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveOption(
|
||||
"prod_123",
|
||||
"prodopt_123"
|
||||
)
|
||||
.then(({ product_option }) => {
|
||||
console.log(product_option)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveOption(
|
||||
"prod_123",
|
||||
"prodopt_123",
|
||||
{
|
||||
fields: "id,title"
|
||||
}
|
||||
)
|
||||
.then(({ product_option }) => {
|
||||
console.log(product_option)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product option'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 product 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":"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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductOptionResponse","type":"[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_option","type":"[AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product that the option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The option's values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The ID of the product that the option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the option was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the option was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product option's details.","expandable":false,"children":[{"name":"AdminProductOptionResponse","type":"[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_option","type":"[AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)","description":"The product option's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The associated product's details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The option's values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The ID of the product that the option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the option was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the option was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
|
||||
___
|
||||
|
||||
## deleteOption
|
||||
|
||||
This method deletes a product's option. It sends a request to the
|
||||
[Delete Option](https://docs.medusajs.com/api/admin#products\_deleteproductsidoptionsoption\_id)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.deleteOption("prod_123", "prodopt_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The option'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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteOption"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductOptionDeleteResponse","type":"[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_option\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name"Line truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductOptionDeleteResponse","type":"[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_option\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValueLine truncated
|
||||
+122
-10
@@ -11,58 +11,170 @@ This documentation provides a reference to the `sdk.admin.productTag` set of met
|
||||
|
||||
## create
|
||||
|
||||
This method creates a product tag. It sends a request to the
|
||||
[Create Product Tag](https://docs.medusajs.com/api/admin#product-tags\_postproducttags)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.create({
|
||||
value: "shirt"
|
||||
})
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductTag/page.mdx)","description":"The details of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"Configure the fields to retrieve in the product tag.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product tag's details.","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"The tag's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
___
|
||||
|
||||
## update
|
||||
|
||||
This method updates a tag's details. It sends a request to the
|
||||
[Update Product Tag](https://docs.medusajs.com/api/admin#product-tags\_postproducttagsid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.update("ptag_123", {
|
||||
value: "shirt"
|
||||
})
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductTag/page.mdx)","description":"The data to update in the tag.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The tag's value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"Configure the fields to retrieve in the product tag.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product tag's details.","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"The tag's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
___
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a paginated list of product tags. It sends a request to the
|
||||
[List Product Tags](https://docs.medusajs.com/api/admin#product-tags\_getproducttags) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of product tags:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.list()
|
||||
.then(({ product_tags, count, limit, offset }) => {
|
||||
console.log(product_tags)
|
||||
})
|
||||
```
|
||||
|
||||
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.productTag.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ product_tags, count, limit, offset }) => {
|
||||
console.log(product_tags)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product tag:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.list({
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_tags, count, limit, offset }) => {
|
||||
console.log(product_tags)
|
||||
})
|
||||
```
|
||||
|
||||
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":"[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](.Line truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the tag's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Query or keyword to apply on the tag's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by tag ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by value(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":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx)>)[]",Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagListResponse","type":"[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_tags","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product tags.","expandable":false,"children":[{"name":"AdminProductTagListResponse","type":"[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_tags","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)[]","description":"The list of product tags.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
|
||||
___
|
||||
|
||||
## retrieve
|
||||
|
||||
This method retrieves a product tag by its ID. It sends a request to the
|
||||
[Get Product Tag](https://docs.medusajs.com/api/admin#product-tags\_getproducttagsid) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve a product tag by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.retrieve("ptag_123")
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.retrieve("ptag_123", {
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
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":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"Configure the fields to retrieve in the product tag.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product tag's details.","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"The tag's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
___
|
||||
|
||||
## delete
|
||||
|
||||
This method deletes a product tag. It sends a request to the
|
||||
[Delete Product Tag](https://docs.medusajs.com/api/admin#product-tags\_deleteproducttagsid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.delete("ptag_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The tag'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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagDeleteResponse","type":"[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_tag\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductTagDeleteResponse","type":"[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_tag\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
+123
-10
@@ -11,58 +11,171 @@ This documentation provides a reference to the `sdk.admin.productType` set of me
|
||||
|
||||
## create
|
||||
|
||||
This method creates a product type. It sends a request to the
|
||||
[Create Product Type](https://docs.medusajs.com/api/admin#product-types\_postproducttypes)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.create({
|
||||
value: "Clothes"
|
||||
})
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_type)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","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 product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
___
|
||||
|
||||
## update
|
||||
|
||||
This method updates a product type. It sends a request to the
|
||||
[Update Product Type](https://docs.medusajs.com/api/admin#product-types\_postproducttypesid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.update("ptyp_123", {
|
||||
value: "Clothes"
|
||||
})
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_type)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductType/page.mdx)","description":"The data to update in the product type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The type's value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","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 product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
___
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a paginated list of product types. It sends a request to the
|
||||
[List Product Types](https://docs.medusajs.com/api/admin#product-types\_getproducttypes) API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of product types:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.list()
|
||||
.then(({ product_types, count, limit, offset }) => {
|
||||
console.log(product_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.productType.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ product_types, count, limit, offset }) => {
|
||||
console.log(product_types)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product type:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.list({
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_types, count, limit, offset }) => {
|
||||
console.log(product_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":"[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProduLine truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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 product type ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by value(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":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypLine truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeListResponse","type":"[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_types","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product types.","expandable":false,"children":[{"name":"AdminProductTypeListResponse","type":"[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_types","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)[]","description":"The list of product types.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
|
||||
___
|
||||
|
||||
## retrieve
|
||||
|
||||
This method retrieves a product type by its ID. It sends a request to the
|
||||
[Get Product Type](https://docs.medusajs.com/api/admin#product-types\_getproducttypesid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve a product type by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.retrieve("ptyp_123")
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_type)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.retrieve("ptyp_123", {
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_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":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTypeParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTypeParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeParams/page.mdx)","description":"Configure the fields to retrieve in the product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
___
|
||||
|
||||
## delete
|
||||
|
||||
This method deletes a product type. It sends a request to the
|
||||
[Delete Product Type](https://docs.medusajs.com/api/admin#product-types\_deleteproducttypesid)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.delete("ptyp_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeDeleteResponse","type":"[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeDeleteResponse","type":"[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
+45
-2
@@ -11,10 +11,53 @@ This documentation provides a reference to the `sdk.admin.productVariant` set of
|
||||
|
||||
## list
|
||||
|
||||
This method retrieves a paginated list of product variants. It sends a request to the
|
||||
[List Product Variants](https://docs.medusajs.com/api/admin#product-variants\_getproductvariants)
|
||||
API route.
|
||||
|
||||
### Example
|
||||
|
||||
To retrieve the list of product variants:
|
||||
|
||||
```ts
|
||||
sdk.admin.productVariant.list()
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
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.productVariant.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each campaign:
|
||||
|
||||
```ts
|
||||
sdk.admin.productVariant.list({
|
||||
fields: "id,products"
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
### Parameters
|
||||
|
||||
<TypeList types={[{"name":"queryParams","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"orLine truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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 filter the variant's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by variant ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Filter by whether Medusa manages the inventory of the variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Filter by whether the variant can be ordered even if it's\nout of stock.","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 variant's 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 variant's 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 variant's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.Line truncated
|
||||
|
||||
### Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product variants.","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of orders. It sends a request to the
|
||||
This method retrieves a paginated list of orders. It sends a request to the
|
||||
[List Orders](https://docs.medusajs.com/api/admin#orders\_getorders) API route.
|
||||
|
||||
## Example
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import { TypeList } from "docs-ui"
|
||||
|
||||
# requestTransfer
|
||||
|
||||
This method requests an order transfer. It sends a request to the
|
||||
[Request Order Transfer](https://docs.medusajs.com/api/admin#orders\_postordersidrequesttransfer)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.order.requestTransfer("order_123", {
|
||||
customer_id: "cus_123",
|
||||
internal_note: "Internal note",
|
||||
})
|
||||
.then(({ order }) => {
|
||||
console.log(order)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminRequestOrderTransfer](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminRequestOrderTransfer/page.mdx)","description":"The transfer's details - the id of the next owner.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"internal_note","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="requestTransfer"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order's details.","expandable":false,"children":[{"name":"AdminOrderResponse","type":"[AdminOrderResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"payment_collections","type":"[AdminPaymentCollection](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPaymentCollection/page.mdx)[]","description":"The order's payment collections.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[AdminOrderLineItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderLineItem/page.mdx)[]","description":"The order's items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"[AdminOrderShippingMethod](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderShippingMethod/page.mdx)[]","description":"The order's shipping methods.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The order's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The order's version.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`null` \\| `string`","description":"The ID of the associated region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the sales channel the order was placed in.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer that placed the order.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The order's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_status","type":"[PaymentStatus](../../../../../types/types/types.PaymentStatus/page.mdx)","description":"The order's payment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_status","type":"[FulfillmentStatus](../../../../../types/types/types.FulfillmentStatus/page.mdx)","description":"The order's fulfillment status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"[BaseOrderSummary](../../../../../types/interfaces/types.BaseOrderSummary/page.mdx)","description":"The order's summary.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The date the order was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The date the order was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"`number`","description":"The total of the order's items including taxes, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_tax_total","type":"`number`","description":"The tax total applied on the order's items, excluding promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"`number`","description":"The total of the order's items including taxes and promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"`number`","description":"The total of the order's items excluding taxes, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"`number`","description":"The tax total applied on the order's items, including promotions.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_total","type":"`number`","description":"The total of the order including taxes, excluding promotions.","optional":false,"defaLine truncated
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves an order by its ID. It sends a request to the
|
||||
This method retrieves an order by its ID. It sends a request to the
|
||||
[Get Order](https://docs.medusajs.com/api/admin#orders\_getordersid)
|
||||
API route.
|
||||
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrievePreview
|
||||
|
||||
This method retrieves the preview of an order based on its last associated change. It sends a request to the
|
||||
This method retrieves the preview of an order based on its last associated change. It sends a request to the
|
||||
[Get Order Preview](https://docs.medusajs.com/api/admin#orders\_getordersidpreview) API route.
|
||||
|
||||
## Example
|
||||
|
||||
+1
-1
@@ -23,4 +23,4 @@ sdk.admin.orderEdit.initiateRequest({
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order edit's details.","expandable":false,"children":[{"name":"AdminOrderEditResponse","type":"[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The order edit's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"The claim's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_order","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"The return's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"The exchange's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actions","type":"[AdminOrderChangeAction](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeAction/page.mdx)[]","description":"The order change action's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"The ID of the associated return order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"The ID of the associated exchange order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"The ID of the associated claim order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderChangeStatus](../../../../../fulfillment/types/fulfillment.OrderChangeStatus/page.mdx)","description":"The status of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_by","type":"`null` \\| `string`","description":"The requested by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_at","type":"`null` \\| `Date`","description":"When the order change was requested","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_by","type":"`null` \\| `string`","description":"The confirmed by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_at","type":"`null` \\| `Date`","description":"When the order change was confirmed","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_by","type":"`null` \\| `string`","description":"The declined by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_reason","type":"`null` \\| `string`","description":"The declined reason of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_at","type":"`null` \\| `Date`","description":"When the order change was declined","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_by","type":"`null` \\| `string`","description":"The canceled by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`null` \\| `Date`","description":"When the order change was canceled","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order change was created","optional":false,"defaultValue":"","expandablLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The order edit's details.","expandable":false,"children":[{"name":"AdminOrderEditResponse","type":"[AdminOrderEditResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"order_change","type":"[AdminOrderChange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChange/page.mdx)","description":"The order edit's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"order","type":"[AdminOrder](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrder/page.mdx)","description":"The order's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim","type":"[AdminClaim](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx)","description":"The claim's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_order","type":"[AdminReturn](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminReturn/page.mdx)","description":"The return's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange","type":"[AdminExchange](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExchange/page.mdx)","description":"The exchange's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"actions","type":"[AdminOrderChangeAction](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminOrderChangeAction/page.mdx)[]","description":"The order change action's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"version","type":"`number`","description":"The version of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"order_id","type":"`string`","description":"The ID of the associated order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"return_id","type":"`string`","description":"The ID of the associated return order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"exchange_id","type":"`string`","description":"The ID of the associated exchange order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"claim_id","type":"`string`","description":"The ID of the associated claim order","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[OrderChangeStatus](../../../../../fulfillment/types/fulfillment.OrderChangeStatus/page.mdx)","description":"The status of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_by","type":"`null` \\| `string`","description":"The requested by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requested_at","type":"`null` \\| `Date`","description":"When the order change was requested","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_by","type":"`null` \\| `string`","description":"The confirmed by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"confirmed_at","type":"`null` \\| `Date`","description":"When the order change was confirmed","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_by","type":"`null` \\| `string`","description":"The declined by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_reason","type":"`null` \\| `string`","description":"The declined reason of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"The metadata of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"declined_at","type":"`null` \\| `Date`","description":"When the order change was declined","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_by","type":"`null` \\| `string`","description":"The canceled by of the order change","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"canceled_at","type":"`null` \\| `Date`","description":"When the order change was canceled","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the order change was created","optional":false,"defaultValue":"","expandablLine truncated
|
||||
+39
-2
@@ -2,10 +2,47 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# batch
|
||||
|
||||
This method manages products to create, update, or delete them. It sends a request to the
|
||||
[Manage Products](https://docs.medusajs.com/api/admin#products\_postproductsbatch)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.batch({
|
||||
create: [
|
||||
{
|
||||
title: "Shirt",
|
||||
options: [{
|
||||
title: "Default",
|
||||
values: ["Default Option"]
|
||||
}],
|
||||
variants: [
|
||||
{
|
||||
title: "Default",
|
||||
options: {
|
||||
Default: "Default Option"
|
||||
},
|
||||
prices: []
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
update: [{
|
||||
id: "prod_123",
|
||||
title: "Pants"
|
||||
}],
|
||||
delete: ["prod_321"]
|
||||
})
|
||||
.then(({ created, updated, deleted }) => {
|
||||
console.log(created, updated, deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminBatchProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channels","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminUpdateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","deLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminBatchProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductRequest/page.mdx)","description":"The products to create, update, or delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`string`","description":"The product's subtitle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The product's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether discounts can be applied on the product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"The product's images.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`string`","description":"The product's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"The ID of the product's type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"The ID of the product in an external or third-party system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"The ID of the product's collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"The product's categories.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`object`[]","description":"The product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"The product's variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channels","type":"`object`[]","description":"The sales channels that the product is available in.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The product's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The product's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The product's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The product's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The product's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The product's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The product's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The product's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminBatchUpdateProduct](../../../../../types/interfaces/types.AdminBatchUpdateProduct/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the produLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminBatchProductResponse","type":"[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date theLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The batch operations details.","expandable":false,"children":[{"name":"AdminBatchProductResponse","type":"[AdminBatchProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","typLine truncated
|
||||
+42
-2
@@ -2,10 +2,50 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# batchVariantInventoryItems
|
||||
|
||||
This method manages a product's variant's inventories to associate them with inventory items,
|
||||
update their inventory items, or delete their association with inventory items.
|
||||
|
||||
It sends a request to the
|
||||
[Manage Variant Inventory](https://docs.medusajs.com/api/admin#products\_postproductsidvariantsinventoryitemsbatch)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.batchVariantInventoryItems(
|
||||
"prod_123",
|
||||
{
|
||||
create: [
|
||||
{
|
||||
inventory_item_id: "iitem_123",
|
||||
variant_id: "variant_123",
|
||||
required_quantity: 10
|
||||
}
|
||||
],
|
||||
update: [
|
||||
{
|
||||
inventory_item_id: "iitem_1234",
|
||||
variant_id: "variant_1234",
|
||||
required_quantity: 20
|
||||
}
|
||||
],
|
||||
delete: [
|
||||
{
|
||||
inventory_item_id: "iitem_321",
|
||||
variant_id: "variant_321"
|
||||
}
|
||||
]
|
||||
}
|
||||
)
|
||||
.then(({ created, updated, deleted }) => {
|
||||
console.log(created, updated, deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantInventoryItemRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminCreateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminUpdateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminUpdateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"delete","type":"[AdminDeleteProductVariantInventoryItem](../../../../../types/interfaces/types.AdminDeleteProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchVariantInventoryItems"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The ID of the product that the variant belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantInventoryItemRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemRequest/page.mdx)","description":"The inventory items to create, update, or delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminCreateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"The number of units a single quantity is equivalent to. For example, if a customer orders one quantity of the variant, Medusa checks the availability of the quantity multiplied by the\nvalue set for `required_quantity`. When the customer orders the quantity, Medusa reserves the ordered quantity multiplied by the value set for `required_quantity`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminUpdateProductVariantInventoryItem](../../../../../types/interfaces/types.AdminUpdateProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"required_quantity","type":"`number`","description":"The number of units a single quantity is equivalent to. For example, if a customer orders one quantity of the variant, Medusa checks the availability of the quantity multiplied by the\nvalue set for `required_quantity`. When the customer orders the quantity, Medusa reserves the ordered quantity multiplied by the value set for `required_quantity`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"delete","type":"[AdminDeleteProductVariantInventoryItem](../../../../../types/interfaces/types.AdminDeleteProductVariantInventoryItem/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"The ID of the inventory.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"Pass query parameters in the request.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="batchVariantInventoryItems"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminBatchProductVariantInventoryItemResponse","type":"[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The inventory item's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The inventory item's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The inventory item's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The inventory item's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The inventory item's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The inventory item's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The inventory item's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_levels","type":"[AdminInventoryLevel](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel/page.mdx)[]","description":"The item's associated inventory levels.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The inventory item's weight.","optional":true,"defLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The details of the created, updated, or deleted inventory items.","expandable":false,"children":[{"name":"AdminBatchProductVariantInventoryItemResponse","type":"[AdminBatchProductVariantInventoryItemResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantInventoryItemResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The inventory item's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The inventory item's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The inventory item's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The inventory item's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The inventory item's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The inventory item's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The inventory item's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"location_levels","type":"[AdminInventoryLevel](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel/page.mdx)[]","description":"The item's associated inventory levels.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"updated","type":"[AdminInventoryItem](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The inventory item's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The inventory item's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The inventory item's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The inventory item's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The inventory item's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The inventory item's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","Line truncated
|
||||
+32
-2
@@ -2,10 +2,40 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# batchVariants
|
||||
|
||||
This method manages the variants of a product. It sends a request to the
|
||||
[Manage Variants](https://docs.medusajs.com/api/admin#products\_postproductsidvariantsbatch)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.batchVariants("prod_123", {
|
||||
create: [
|
||||
{
|
||||
title: "Blue Shirt",
|
||||
options: {
|
||||
Color: "Blue"
|
||||
},
|
||||
prices: []
|
||||
}
|
||||
],
|
||||
update: [
|
||||
{
|
||||
id: "variant_123",
|
||||
title: "Pants"
|
||||
}
|
||||
],
|
||||
delete: ["variant_123"]
|
||||
})
|
||||
.then(({ created, updated, deleted }) => {
|
||||
console.log(created, updated, deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminBatchUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchUpdateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children"Line truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminBatchProductVariantRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantRequest/page.mdx)","description":"The variants to create, update, or delete.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"create","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether Medusa manages the variant's inventory. If disabled,\nthe variant is always considered in stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"The variant's ranking among its sibling variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The variant's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The variant's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The variant's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The variant's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The variant's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The variant's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"The variant's inventory items. It's only\navailable if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`Record<string, string>`","description":"The variant's values for the associated product's options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"update","type":"[AdminBatchUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchUpdateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the variant to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The variant's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPCLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminBatchProductVariantResponse","type":"[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The variant's product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`stringLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product variants' details.","expandable":false,"children":[{"name":"AdminBatchProductVariantResponse","type":"[AdminBatchProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminBatchProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"created","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"The product variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the associated product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product that this variant belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":trueLine truncated
|
||||
+16
-2
@@ -2,10 +2,24 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# confirmImport
|
||||
|
||||
This method confirms a product import created using the method [import](../js_sdk.admin.Product.import/page.mdx).
|
||||
It sends a request to the
|
||||
[Confirm Product Import](https://docs.medusajs.com/api/admin#products\_postproductsimporttransaction\_idconfirm)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.confirmImport("transaction_123")
|
||||
.then(() => {
|
||||
console.log("Import confirmed")
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"transactionId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`object`","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":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
<TypeList types={[{"name":"transactionId","type":"`string`","description":"The ID of the transaction of the created product import. This is returned\nby the API route used to create the product import.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"`object`","description":"Query parameters to pass in the request.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<object>","optional":false,"defaultValue":"","description":"This method confirms a product import created using the method [import](../js_sdk.admin.Product.import/page.mdx).\nIt sends a request to the \n[Confirm Product Import](https://docs.medusajs.com/api/admin#products\\_postproductsimporttransaction\\_idconfirm)\nAPI route.","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="confirmImport"/>
|
||||
+30
-2
@@ -2,10 +2,38 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# create
|
||||
|
||||
This method creates a product. It sends a request to the
|
||||
[Create Product](https://docs.medusajs.com/api/admin#products\_postproducts)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.create({
|
||||
title: "Shirt",
|
||||
options: [{
|
||||
title: "Default",
|
||||
values: ["Default Option"]
|
||||
}],
|
||||
variants: [
|
||||
{
|
||||
title: "Default",
|
||||
options: {
|
||||
Default: "Default Option"
|
||||
},
|
||||
prices: []
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"subtitle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expaLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"subtitle","type":"`string`","description":"The product's subtitle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`string`","description":"The product's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether discounts can be applied on the product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"The product's images.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"The image's URL.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`string`","description":"The product's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string`","description":"The ID of the product's type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`string`","description":"The ID of the product in an external or third-party system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string`","description":"The ID of the product's collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"The product's categories.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of a product category that the product belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"The product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the associated product tag.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)[]","description":"The product's variants.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","desLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+21
-2
@@ -2,10 +2,29 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# createOption
|
||||
|
||||
This method creates an option in a product. It sends a request to the
|
||||
[Create Option](https://docs.medusajs.com/api/admin#products\_postproductsidoptions)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.createOption(
|
||||
"prod_123",
|
||||
{
|
||||
title: "Color",
|
||||
values: ["Green", "Blue"]
|
||||
}
|
||||
)
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductOption/page.mdx)","description":"The option's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","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 product.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="createOption"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+26
-2
@@ -2,10 +2,34 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# createVariant
|
||||
|
||||
This method creates a variant for a product. It sends a request to the
|
||||
[Create Variant](https://docs.medusajs.com/api/admin#products\_postproductsidvariants)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.createVariant("prod_123", {
|
||||
title: "Blue Shirt",
|
||||
options: {
|
||||
Color: "Blue"
|
||||
},
|
||||
prices: [
|
||||
{
|
||||
amount: 10,
|
||||
currency_code: "usd"
|
||||
}
|
||||
]
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"required_quantity","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"childLine truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx)","description":"The variant's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The price's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"The price's rules.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether Medusa manages the variant's inventory. If disabled,\nthe variant is always considered in stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"The variant's ranking among its sibling variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"The variant's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`number`","description":"The variant's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`number`","description":"The variant's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`number`","description":"The variant's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`string`","description":"The variant's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`string`","description":"The variant's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_items","type":"[AdminCreateProductVariantInventoryKit](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantInventoryKit/page.mdx)[]","description":"The variant's inventory items. It's only\navailable if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"inventory_item_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"required_quantity","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"The variant's values for the associated product's options.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+15
-2
@@ -2,10 +2,23 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# delete
|
||||
|
||||
This method deletes a product. It sends a request to the
|
||||
[Delete Product](https://docs.medusajs.com/api/admin#products\_deleteproductsid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.delete("prod_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product'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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductDeleteResponse","type":"[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductDeleteResponse","type":"[AdminProductDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
+15
-2
@@ -2,10 +2,23 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# deleteOption
|
||||
|
||||
This method deletes a product's option. It sends a request to the
|
||||
[Delete Option](https://docs.medusajs.com/api/admin#products\_deleteproductsidoptionsoption\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.deleteOption("prod_123", "prodopt_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The option'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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteOption"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductOptionDeleteResponse","type":"[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_option\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name"Line truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductOptionDeleteResponse","type":"[AdminProductOptionDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_option\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValueLine truncated
|
||||
+15
-2
@@ -2,10 +2,23 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# deleteVariant
|
||||
|
||||
This method deletes a product's variant. It sends a request to the
|
||||
[Delete Variant](https://docs.medusajs.com/api/admin#products\_deleteproductsidvariantsvariant\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.deleteVariant("prod_123", "variant_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteVariant"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the variant.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="deleteVariant"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantDeleteResponse","type":"[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"variant\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"Line truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductVariantDeleteResponse","type":"[AdminProductVariantDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"variant\"`","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":[]},{"name":"parent","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The parent resource of the item that was deleted, if applicable.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":Line truncated
|
||||
+24
-2
@@ -2,10 +2,32 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# export
|
||||
|
||||
This method starts a product export process to retrieve a CSV of exported products.
|
||||
|
||||
You'll receive in the response the transaction ID of the workflow generating the CSV file.
|
||||
To check the status of the execution, send a `GET` request to
|
||||
`/admin/workflows-executions/export-products/:transaction-id`.
|
||||
|
||||
Once the execution finishes successfully, a notification is created for the export.
|
||||
You can retrieve the notifications using the `/admin/notification` API route to
|
||||
retrieve the file's download URL.
|
||||
|
||||
This method sends a request to the [Export Product](https://docs.medusajs.com/api/admin#products\_postproductsexport)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.export({})
|
||||
.then(({ transaction_id }) => {
|
||||
console.log(transaction_id)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminExportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"createdLine truncated
|
||||
<TypeList types={[{"name":"body","type":"[AdminExportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductRequest/page.mdx)","description":"The export's details.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"Filters to specify which products to export.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"deLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminExportProductResponse","type":"[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="export"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The export's details.","expandable":false,"children":[{"name":"AdminExportProductResponse","type":"[AdminExportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminExportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"The ID of the export product workflow's transaction.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="export"/>
|
||||
+20
-2
@@ -2,10 +2,28 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# import
|
||||
|
||||
This method creates a product import. The products are only imported after
|
||||
the import is confirmed using the [confirmImport](../js_sdk.admin.Product.confirmImport/page.mdx) method.
|
||||
|
||||
This method sends a request to the
|
||||
[Create Product Import](https://docs.medusajs.com/api/admin#products\_postproductsimport)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.import({
|
||||
file // uploaded File instance
|
||||
})
|
||||
.then(({ transaction_id }) => {
|
||||
console.log(transaction_id)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminImportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductRequest/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"file","type":"[File](../../../../../core_flows/core_flows.File/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"`object`","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":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
<TypeList types={[{"name":"body","type":"[AdminImportProductRequest](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductRequest/page.mdx)","description":"The import's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"file","type":"[File](../../../../../core_flows/core_flows.File/page.mdx)","description":"The CSV file to import the products from.\n\nIt's an uploaded file of type [File](https://developer.mozilla.org/en-US/docs/Web/API/File).","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"`object`","description":"Query parameters to pass to the request.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminImportProductResponse","type":"[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"toCreate","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"toUpdate","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The import's details.","expandable":false,"children":[{"name":"AdminImportProductResponse","type":"[AdminImportProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"transaction_id","type":"`string`","description":"The ID of the import product workflow execution's transaction. \nThis is useful to confirm the import using the `/admin/products/:transaction-id/import` API route.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"summary","type":"`object`","description":"Details of the products to create or update when the import is confirmed.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"toCreate","type":"`number`","description":"The number of products that will be created by the import.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"toUpdate","type":"`number`","description":"The number of products that will be updated by the import.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="import"/>
|
||||
+44
-2
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of products. It sends a request to the
|
||||
[List Products](https://docs.medusajs.com/api/admin#products\_getproducts) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of products:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.list()
|
||||
.then(({ products, count, limit, offset }) => {
|
||||
console.log(products)
|
||||
})
|
||||
```
|
||||
|
||||
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.product.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ products, count, limit, offset }) => {
|
||||
console.log(products)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each products:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.list({
|
||||
fields: "id,*variants"
|
||||
})
|
||||
.then(({ products, count, limit, offset }) => {
|
||||
console.log(products)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"queryParams","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filers on the product's creation date.","optional":true,"defaultValue":"","expandable":false,"chilLine truncated
|
||||
<TypeList types={[{"name":"queryParams","type":"[AdminProductListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"([BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductListParams](../../../../../types/interfaces/types.BaseProductListParams/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":"A query or keywords to search the searchable fields by.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx) \\| [ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)[]","description":"Filter the product by status(es).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string` \\| `string`[]","description":"Filter the product by the sales channel(s) it belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"Filter by the product's title(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string` \\| `string`[]","description":"Filter by the product's handle(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by the product's id(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Filter by whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"tags","type":"`string` \\| `string`[]","description":"Filter by the product's tag(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`string` \\| `string`[]","description":"Filter by the product's type(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"category_id","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`string` \\| `string`[]","description":"Filter by the product's category(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`string` \\| `string`[]","description":"Filter by the product's collection(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filers on the product's creation date.","optional":true,"defaultValue":"","expandable":false,"chilLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductListResponse","type":"[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of products.","expandable":false,"children":[{"name":"AdminProductListResponse","type":"[AdminProductListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
+44
-2
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# listOptions
|
||||
|
||||
This method retrieves a paginated list of product options. It sends a request to the
|
||||
[List Options](https://docs.medusajs.com/api/admin#products\_getproductsidoptions) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of product options:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listOptions("prod_123")
|
||||
.then(({ product_options, count, limit, offset }) => {
|
||||
console.log(product_options)
|
||||
})
|
||||
```
|
||||
|
||||
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.product.listOptions("prod_123", {
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ product_options, count, limit, offset }) => {
|
||||
console.log(product_options)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product options:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listOptions("prod_123", {
|
||||
fields: "id,title"
|
||||
})
|
||||
.then(({ product_options, count, limit, offset }) => {
|
||||
console.log(product_options)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[AdminProductOptionParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/tyLine truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The ID of the product to retrieve its options","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductOptionParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":"([BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[BaseProductOptionParams](../../../../../types/interfaces/types.BaseProductOptionParams/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":[]},{"nameLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductOptionListResponse","type":"[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listOptions"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product options.","expandable":false,"children":[{"name":"AdminProductOptionListResponse","type":"[AdminProductOptionListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductOptionListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listOptions"/>
|
||||
+44
-2
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# listVariants
|
||||
|
||||
This method retrieves a paginated list of products. It sends a request to the
|
||||
[List Products](https://docs.medusajs.com/api/admin#products\_getproductsidvariants) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of product variants:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listVariants("prod_123")
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
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.product.listVariants("prod_123", {
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product variant:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.listVariants("prod_123", {
|
||||
fields: "id,*product"
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"queryParams","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.Line truncated
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The ID of the product to retrieve its variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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 filter the variant's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by variant ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Filter by whether Medusa manages the inventory of the variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Filter by whether the variant can be ordered even if it's\nout of stock.","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 variant's 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 variant's 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 variant's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"or\" condition.Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listVariants"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product variants.","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="listVariants"/>
|
||||
+30
-2
@@ -2,10 +2,38 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves a product by its ID. It sends a request to the
|
||||
[Get Product](https://docs.medusajs.com/api/admin#products\_getproductsid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a product by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieve("prod_123")
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieve("prod_123", {
|
||||
fields: "id,*variants"
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
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":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product'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 product.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+37
-2
@@ -2,10 +2,45 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieveOption
|
||||
|
||||
This method retrieves a product's option. It sends a request to the
|
||||
[Get Option](https://docs.medusajs.com/api/admin#products\_getproductsidoptionsoption\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a product option by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveOption(
|
||||
"prod_123",
|
||||
"prodopt_123"
|
||||
)
|
||||
.then(({ product_option }) => {
|
||||
console.log(product_option)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveOption(
|
||||
"prod_123",
|
||||
"prodopt_123",
|
||||
{
|
||||
fields: "id,title"
|
||||
}
|
||||
)
|
||||
.then(({ product_option }) => {
|
||||
console.log(product_option)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product option'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 product 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":"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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductOptionResponse","type":"[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_option","type":"[AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product that the option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The option's values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The ID of the product that the option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the option was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the option was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product option's details.","expandable":false,"children":[{"name":"AdminProductOptionResponse","type":"[AdminProductOptionResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_option","type":"[AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)","description":"The product option's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The option's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The associated product's details.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The option's values.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`null` \\| `string`","description":"The ID of the product that the option belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the option was created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the option was updated.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the option was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveOption"/>
|
||||
+37
-2
@@ -2,10 +2,45 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieveVariant
|
||||
|
||||
This method retrieves a product's variant. It sends a request to the
|
||||
[Retrieve Variant](https://docs.medusajs.com/api/admin#products\_getproductsidvariantsvariant\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a product variant by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveVariant(
|
||||
"prod_123",
|
||||
"variant_123"
|
||||
)
|
||||
.then(({ variant }) => {
|
||||
console.log(variant)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.product.retrieveVariant(
|
||||
"prod_123",
|
||||
"variant_123",
|
||||
{
|
||||
fields: "id, *product"
|
||||
}
|
||||
)
|
||||
.then(({ variant }) => {
|
||||
console.log(variant)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveVariant"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant'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 product variant.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieveVariant"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantResponse","type":"[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variant","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The variant's product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID ofLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product variant's details.","expandable":false,"children":[{"name":"AdminProductVariantResponse","type":"[AdminProductVariantResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"variant","type":"[AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"prices","type":"`null` \\| [AdminPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminPrice/page.mdx)[]","description":"The product variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOptionValue](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOptionValue/page.mdx)[]","description":"The variant's values for the associated product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`null` \\| `string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`null` \\| `boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`null` \\| `boolean`","description":"Whether Medusa manages the variant's inventory. If disabled, the variant\nis always considered in stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the variant was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the variant was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the variant was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`null` \\| [AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product that this variant belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"inventory_quantity","type":"`number`","description":"The variant's inventory quantity if `manage_inventory` is enabled.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`null` \\| `number`","description":"The variant's ranking among its siblings.","optional":true,"defaultValue":"","expandaLine truncated
|
||||
+17
-2
@@ -2,10 +2,25 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# update
|
||||
|
||||
This method updates a product. It sends a request to the
|
||||
[Update Product](https://docs.medusajs.com/api/admin#products\_postproductsid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.update("prod_123", {
|
||||
title: "Shirt",
|
||||
})
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"([AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx) \\| [AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx))[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type"Line truncated
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProduct/page.mdx)","description":"The data to update in the product.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The product's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether discounts can be applied on the product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`object`[]","description":"The product's images.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"url","type":"`string`","description":"The image's URL.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail URL.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in an external or third-party system.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"categories","type":"`object`[]","description":"The product's categories.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the category that the product belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tags","type":"`object`[]","description":"The product's tags.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of a tag that the product is associated with.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)[]","description":"The product's options.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variants","type":"([AdminCreateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariant/page.mdx) \\| [AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx))[]","description":"The product's variants.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandaLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+21
-2
@@ -2,10 +2,29 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# updateOption
|
||||
|
||||
This method updates a product's option. It sends a request to the
|
||||
[Update Option](https://docs.medusajs.com/api/admin#products\_postproductsidoptionsoption\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.updateOption(
|
||||
"prod_123",
|
||||
"prodopt_123",
|
||||
{
|
||||
title: "Color"
|
||||
}
|
||||
)
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOption"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the option to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductOption/page.mdx)","description":"The data to update in the option.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The option's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"`string`[]","description":"The option's values.","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 product.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateOption"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+21
-2
@@ -2,10 +2,29 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# updateVariant
|
||||
|
||||
This method updates a variant of a product. It sends a request to the
|
||||
[Update Variant](https://docs.medusajs.com/api/admin#products\_postproductsidvariantsvariant\_id)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.product.updateVariant(
|
||||
"prod_123",
|
||||
"variant_123",
|
||||
{
|
||||
title: "Blue Shirt",
|
||||
}
|
||||
)
|
||||
.then(({ product }) => {
|
||||
console.log(product)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="updateVariant"/>
|
||||
<TypeList types={[{"name":"productId","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The variant's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductVariant/page.mdx)","description":"The data to update in the variant.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"title","type":"`string`","description":"The variant's title.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The variant's SKU.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The variant's EAN.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The variant's UPC.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The variant's barcode.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The variant's HS code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The variant's MID code.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the variant can be ordered even if it's out of stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether Medusa should manage the variant's inventory. If disabled,\nthe variant is always considered in stock.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_rank","type":"`number`","description":"The variant's ranking among its sibling variants.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The variant's weight.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The variant's length.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The variant's height.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The variant's width.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The variant's origin country.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The variant's material.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"prices","type":"[AdminCreateProductVariantPrice](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductVariantPrice/page.mdx)[]","description":"The variant's prices.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The price's currency code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`number`","description":"The price's amount.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"min_quantity","type":"`null` \\| `number`","description":"The minimum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"max_quantity","type":"`null` \\| `number`","description":"The maximum quantity required in the cart for the price to apply.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"rules","type":"`null` \\| `object`","description":"The price's rules.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"options","type":"`Record<string, string>`","description":"The variant's values for the associated product's options.","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 product.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \\| `string`","description":"The date the product was created.","optLine truncated
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product's details.","expandable":false,"children":[{"name":"AdminProductResponse","type":"[AdminProductResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product","type":"[AdminProduct](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProduct/page.mdx)","description":"The product's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variants","type":"`null` \\| [AdminProductVariant](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariant/page.mdx)[]","description":"The product's variants.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"`null` \\| [AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product's type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`null` \\| [AdminProductOption](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductOption/page.mdx)[]","description":"The product's options.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"images","type":"`null` \\| [AdminProductImage](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx)[]","description":"The product's images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The product's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The product's title.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"handle","type":"`string`","description":"The product's handle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`null` \\| `string`","description":"The product's subtitle.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The product's description.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the product is a gift card.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"status","type":"[ProductStatus](../../../../../types/types/types.ProductStatus/page.mdx)","description":"The product's status.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The product's thumbnail.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The product's width.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The product's weight.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The product's length.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The product's height.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The product's origin country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The product's HS code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The product's MID code.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The product's material.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"collection_id","type":"`null` \\| `string`","description":"The ID of the associated product collection.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type_id","type":"`null` \\| `string`","description":"The ID of the associated product type.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discountable","type":"`boolean`","description":"Whether the product is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"external_id","type":"`null` \\| `string`","description":"The ID of the product in external systems.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`null` \Line truncated
|
||||
+17
-2
@@ -2,10 +2,25 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# create
|
||||
|
||||
This method creates a product tag. It sends a request to the
|
||||
[Create Product Tag](https://docs.medusajs.com/api/admin#product-tags\_postproducttags)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.create({
|
||||
value: "shirt"
|
||||
})
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductTag/page.mdx)","description":"The details of the product tag.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"Configure the fields to retrieve in the product tag.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product tag's details.","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"The tag's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
+15
-2
@@ -2,10 +2,23 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# delete
|
||||
|
||||
This method deletes a product tag. It sends a request to the
|
||||
[Delete Product Tag](https://docs.medusajs.com/api/admin#product-tags\_deleteproducttagsid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.delete("ptag_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The tag'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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagDeleteResponse","type":"[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_tag\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The deletion's details.","expandable":false,"children":[{"name":"AdminProductTagDeleteResponse","type":"[AdminProductTagDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_tag\"`","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
+44
-2
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of product tags. It sends a request to the
|
||||
[List Product Tags](https://docs.medusajs.com/api/admin#product-tags\_getproducttags) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of product tags:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.list()
|
||||
.then(({ product_tags, count, limit, offset }) => {
|
||||
console.log(product_tags)
|
||||
})
|
||||
```
|
||||
|
||||
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.productTag.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ product_tags, count, limit, offset }) => {
|
||||
console.log(product_tags)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product tag:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.list({
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_tags, count, limit, offset }) => {
|
||||
console.log(product_tags)
|
||||
})
|
||||
```
|
||||
|
||||
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":"[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](.Line truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/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":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"Apply filters on the tag's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"q","type":"`string`","description":"Query or keyword to apply on the tag's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by tag ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by value(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":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTagListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListParams/page.mdx)>)[]",Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagListResponse","type":"[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_tags","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product tags.","expandable":false,"children":[{"name":"AdminProductTagListResponse","type":"[AdminProductTagListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_tags","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)[]","description":"The list of product tags.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
+29
-2
@@ -2,10 +2,37 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves a product tag by its ID. It sends a request to the
|
||||
[Get Product Tag](https://docs.medusajs.com/api/admin#product-tags\_getproducttagsid) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a product tag by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.retrieve("ptag_123")
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.retrieve("ptag_123", {
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
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":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"Configure the fields to retrieve in the product tag.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product tag's details.","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"The tag's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
+17
-2
@@ -2,10 +2,25 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# update
|
||||
|
||||
This method updates a tag's details. It sends a request to the
|
||||
[Update Product Tag](https://docs.medusajs.com/api/admin#product-tags\_postproducttagsid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productTag.update("ptag_123", {
|
||||
value: "shirt"
|
||||
})
|
||||
.then(({ product_tag }) => {
|
||||
console.log(product_tag)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductTag/page.mdx)","description":"The data to update in the tag.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The tag's value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[AdminProductTagParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagParams/page.mdx)","description":"Configure the fields to retrieve in the product tag.","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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product tag's details.","expandable":false,"children":[{"name":"AdminProductTagResponse","type":"[AdminProductTagResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTagResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_tag","type":"[AdminProductTag](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTag/page.mdx)","description":"The tag's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The tag's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The tag's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the tag was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the tag was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the tag was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
+17
-2
@@ -2,10 +2,25 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# create
|
||||
|
||||
This method creates a product type. It sends a request to the
|
||||
[Create Product Type](https://docs.medusajs.com/api/admin#product-types\_postproducttypes)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.create({
|
||||
value: "Clothes"
|
||||
})
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_type)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"body","type":"[AdminCreateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminCreateProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","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 product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="create"/>
|
||||
+15
-2
@@ -2,10 +2,23 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# delete
|
||||
|
||||
This method deletes a product type. It sends a request to the
|
||||
[Delete Product Type](https://docs.medusajs.com/api/admin#product-types\_deleteproducttypesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.delete("ptyp_123")
|
||||
.then(({ deleted }) => {
|
||||
console.log(deleted)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeDeleteResponse","type":"[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeDeleteResponse","type":"[AdminProductTypeDeleteResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeDeleteResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the item that was deleted.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"object","type":"`\"product_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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="delete"/>
|
||||
+44
-2
@@ -2,10 +2,52 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of product types. It sends a request to the
|
||||
[List Product Types](https://docs.medusajs.com/api/admin#product-types\_getproducttypes) API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of product types:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.list()
|
||||
.then(({ product_types, count, limit, offset }) => {
|
||||
console.log(product_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.productType.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ product_types, count, limit, offset }) => {
|
||||
console.log(product_types)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each product type:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.list({
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_types, count, limit, offset }) => {
|
||||
console.log(product_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":"[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProduLine truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/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 product type ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string` \\| `string`[]","description":"Filter by value(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":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductTypeListParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypLine truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeListResponse","type":"[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_types","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product types.","expandable":false,"children":[{"name":"AdminProductTypeListResponse","type":"[AdminProductTypeListResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","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":"product_types","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)[]","description":"The list of product types.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
+30
-2
@@ -2,10 +2,38 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# retrieve
|
||||
|
||||
This method retrieves a product type by its ID. It sends a request to the
|
||||
[Get Product Type](https://docs.medusajs.com/api/admin#product-types\_getproducttypesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a product type by its ID:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.retrieve("ptyp_123")
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_type)
|
||||
})
|
||||
```
|
||||
|
||||
To specify the fields and relations to retrieve:
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.retrieve("ptyp_123", {
|
||||
fields: "id,*products"
|
||||
})
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_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":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTypeParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"query","type":"[AdminProductTypeParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeParams/page.mdx)","description":"Configure the fields to retrieve in the product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="retrieve"/>
|
||||
+17
-2
@@ -2,10 +2,25 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# update
|
||||
|
||||
This method updates a product type. It sends a request to the
|
||||
[Update Product Type](https://docs.medusajs.com/api/admin#product-types\_postproducttypesid)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
sdk.admin.productType.update("ptyp_123", {
|
||||
value: "Clothes"
|
||||
})
|
||||
.then(({ product_type }) => {
|
||||
console.log(product_type)
|
||||
})
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"query","type":"[SelectParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.SelectParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"fields","type":"`string`","description":"The fields and relations to retrieve separated by commas.\n\nLearn more in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"headers","type":"[ClientHeaders](../../../types/js_sdk.admin.ClientHeaders/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"tags","type":"`string`[]","description":"Tags to cache data under for Next.js applications.\n\nLearn more in [Next.js's documentation](https://nextjs.org/docs/app/building-your-application/caching#fetch-optionsnexttags-and-revalidatetag).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"body","type":"[AdminUpdateProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminUpdateProductType/page.mdx)","description":"The data to update in the product type.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"value","type":"`string`","description":"The type's value.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","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 product 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/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The product type's details.","expandable":false,"children":[{"name":"AdminProductTypeResponse","type":"[AdminProductTypeResponse](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductTypeResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"product_type","type":"[AdminProductType](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductType/page.mdx)","description":"The product type's details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The product type's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The product type's value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the product type was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the product type was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`null` \\| `string`","description":"The date the product type was deleted.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Key-value pairs of custom data.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="update"/>
|
||||
+45
-2
@@ -2,10 +2,53 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# list
|
||||
|
||||
This method retrieves a paginated list of product variants. It sends a request to the
|
||||
[List Product Variants](https://docs.medusajs.com/api/admin#product-variants\_getproductvariants)
|
||||
API route.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve the list of product variants:
|
||||
|
||||
```ts
|
||||
sdk.admin.productVariant.list()
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
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.productVariant.list({
|
||||
limit: 10,
|
||||
offset: 10
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Using the `fields` query parameter, you can specify the fields and relations to retrieve
|
||||
in each campaign:
|
||||
|
||||
```ts
|
||||
sdk.admin.productVariant.list({
|
||||
fields: "id,products"
|
||||
})
|
||||
.then(({ variants, count, limit, offset }) => {
|
||||
console.log(variants)
|
||||
})
|
||||
```
|
||||
|
||||
Learn more about the `fields` property in the [API reference](https://docs.medusajs.com/api/store#select-fields-and-relations).
|
||||
|
||||
## Parameters
|
||||
|
||||
<TypeList types={[{"name":"queryParams","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"[OperatorMap](../../../../../types/DAL/types/types.DAL.OperatorMap/page.mdx)<string>","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)>)[]","description":"An array of filters to apply on the entity, where each item in the array is joined with an \"orLine truncated
|
||||
<TypeList types={[{"name":"query","type":"[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx)","description":"Filters and pagination configurations.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"$and","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/page.mdx) \\| [BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<[AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.HttpTypes.AdminProductVariantParams/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 filter the variant's searchable fields.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"id","type":"`string` \\| `string`[]","description":"Filter by variant ID(s).","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Filter by whether Medusa manages the inventory of the variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Filter by whether the variant can be ordered even if it's\nout of stock.","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 variant's 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 variant's 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 variant's deletion date.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"$and","type":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"([BaseFilterable](../../../../../types/DAL/interfaces/types.DAL.BaseFilterable/page.mdx)<T> \\| T)[]","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":"$or","type":"([AdminProductVariantParams](../../../../../types/HttpTypes/interfaces/types.Line truncated
|
||||
|
||||
## Returns
|
||||
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
<TypeList types={[{"name":"Promise","type":"Promise<[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)>","optional":false,"defaultValue":"","description":"The paginated list of product variants.","expandable":false,"children":[{"name":"AdminProductVariantListResponse","type":"[AdminProductVariantListResponse](../../../../../types/HttpTypes/types/types.HttpTypes.AdminProductVariantListResponse/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"limit","type":"`number`","description":"The maximum number of items retrieved.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"offset","type":"`number`","description":"The number of items to skip before retrieving the returned items.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"count","type":"`number`","description":"The total number of items.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/v2/advanced-development/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="list"/>
|
||||
@@ -10,44 +10,44 @@ The `sdk.admin` class provides methods to send requests to Medusa's Admin API ro
|
||||
|
||||
## Properties
|
||||
|
||||
- [invite](../../Admin/properties/js_sdk.admin.Admin.invite/page.mdx)
|
||||
- [apiKey](../../Admin/properties/js_sdk.admin.Admin.apiKey/page.mdx)
|
||||
- [campaign](../../Admin/properties/js_sdk.admin.Admin.campaign/page.mdx)
|
||||
- [claim](../../Admin/properties/js_sdk.admin.Admin.claim/page.mdx)
|
||||
- [currency](../../Admin/properties/js_sdk.admin.Admin.currency/page.mdx)
|
||||
- [customer](../../Admin/properties/js_sdk.admin.Admin.customer/page.mdx)
|
||||
- [productCollection](../../Admin/properties/js_sdk.admin.Admin.productCollection/page.mdx)
|
||||
- [productCategory](../../Admin/properties/js_sdk.admin.Admin.productCategory/page.mdx)
|
||||
- [priceList](../../Admin/properties/js_sdk.admin.Admin.priceList/page.mdx)
|
||||
- [pricePreference](../../Admin/properties/js_sdk.admin.Admin.pricePreference/page.mdx)
|
||||
- [product](../../Admin/properties/js_sdk.admin.Admin.product/page.mdx)
|
||||
- [productType](../../Admin/properties/js_sdk.admin.Admin.productType/page.mdx)
|
||||
- [upload](../../Admin/properties/js_sdk.admin.Admin.upload/page.mdx)
|
||||
- [region](../../Admin/properties/js_sdk.admin.Admin.region/page.mdx)
|
||||
- [returnReason](../../Admin/properties/js_sdk.admin.Admin.returnReason/page.mdx)
|
||||
- [stockLocation](../../Admin/properties/js_sdk.admin.Admin.stockLocation/page.mdx)
|
||||
- [salesChannel](../../Admin/properties/js_sdk.admin.Admin.salesChannel/page.mdx)
|
||||
- [fulfillmentSet](../../Admin/properties/js_sdk.admin.Admin.fulfillmentSet/page.mdx)
|
||||
- [customerGroup](../../Admin/properties/js_sdk.admin.Admin.customerGroup/page.mdx)
|
||||
- [exchange](../../Admin/properties/js_sdk.admin.Admin.exchange/page.mdx)
|
||||
- [fulfillment](../../Admin/properties/js_sdk.admin.Admin.fulfillment/page.mdx)
|
||||
- [fulfillmentProvider](../../Admin/properties/js_sdk.admin.Admin.fulfillmentProvider/page.mdx)
|
||||
- [shippingOption](../../Admin/properties/js_sdk.admin.Admin.shippingOption/page.mdx)
|
||||
- [shippingProfile](../../Admin/properties/js_sdk.admin.Admin.shippingProfile/page.mdx)
|
||||
- [fulfillmentSet](../../Admin/properties/js_sdk.admin.Admin.fulfillmentSet/page.mdx)
|
||||
- [inventoryItem](../../Admin/properties/js_sdk.admin.Admin.inventoryItem/page.mdx)
|
||||
- [invite](../../Admin/properties/js_sdk.admin.Admin.invite/page.mdx)
|
||||
- [notification](../../Admin/properties/js_sdk.admin.Admin.notification/page.mdx)
|
||||
- [order](../../Admin/properties/js_sdk.admin.Admin.order/page.mdx)
|
||||
- [orderEdit](../../Admin/properties/js_sdk.admin.Admin.orderEdit/page.mdx)
|
||||
- [payment](../../Admin/properties/js_sdk.admin.Admin.payment/page.mdx)
|
||||
- [paymentCollection](../../Admin/properties/js_sdk.admin.Admin.paymentCollection/page.mdx)
|
||||
- [priceList](../../Admin/properties/js_sdk.admin.Admin.priceList/page.mdx)
|
||||
- [pricePreference](../../Admin/properties/js_sdk.admin.Admin.pricePreference/page.mdx)
|
||||
- [product](../../Admin/properties/js_sdk.admin.Admin.product/page.mdx)
|
||||
- [productCategory](../../Admin/properties/js_sdk.admin.Admin.productCategory/page.mdx)
|
||||
- [productCollection](../../Admin/properties/js_sdk.admin.Admin.productCollection/page.mdx)
|
||||
- [productTag](../../Admin/properties/js_sdk.admin.Admin.productTag/page.mdx)
|
||||
- [productType](../../Admin/properties/js_sdk.admin.Admin.productType/page.mdx)
|
||||
- [productVariant](../../Admin/properties/js_sdk.admin.Admin.productVariant/page.mdx)
|
||||
- [promotion](../../Admin/properties/js_sdk.admin.Admin.promotion/page.mdx)
|
||||
- [refundReason](../../Admin/properties/js_sdk.admin.Admin.refundReason/page.mdx)
|
||||
- [region](../../Admin/properties/js_sdk.admin.Admin.region/page.mdx)
|
||||
- [reservation](../../Admin/properties/js_sdk.admin.Admin.reservation/page.mdx)
|
||||
- [return](../../Admin/properties/js_sdk.admin.Admin.return/page.mdx)
|
||||
- [claim](../../Admin/properties/js_sdk.admin.Admin.claim/page.mdx)
|
||||
- [exchange](../../Admin/properties/js_sdk.admin.Admin.exchange/page.mdx)
|
||||
- [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)
|
||||
- [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)
|
||||
- [taxRate](../../Admin/properties/js_sdk.admin.Admin.taxRate/page.mdx)
|
||||
- [taxRegion](../../Admin/properties/js_sdk.admin.Admin.taxRegion/page.mdx)
|
||||
- [store](../../Admin/properties/js_sdk.admin.Admin.store/page.mdx)
|
||||
- [productTag](../../Admin/properties/js_sdk.admin.Admin.productTag/page.mdx)
|
||||
- [upload](../../Admin/properties/js_sdk.admin.Admin.upload/page.mdx)
|
||||
- [user](../../Admin/properties/js_sdk.admin.Admin.user/page.mdx)
|
||||
- [currency](../../Admin/properties/js_sdk.admin.Admin.currency/page.mdx)
|
||||
- [payment](../../Admin/properties/js_sdk.admin.Admin.payment/page.mdx)
|
||||
- [productVariant](../../Admin/properties/js_sdk.admin.Admin.productVariant/page.mdx)
|
||||
- [refundReason](../../Admin/properties/js_sdk.admin.Admin.refundReason/page.mdx)
|
||||
- [paymentCollection](../../Admin/properties/js_sdk.admin.Admin.paymentCollection/page.mdx)
|
||||
- [apiKey](../../Admin/properties/js_sdk.admin.Admin.apiKey/page.mdx)
|
||||
- [workflowExecution](../../Admin/properties/js_sdk.admin.Admin.workflowExecution/page.mdx)
|
||||
- [reservation](../../Admin/properties/js_sdk.admin.Admin.reservation/page.mdx)
|
||||
- [customerGroup](../../Admin/properties/js_sdk.admin.Admin.customerGroup/page.mdx)
|
||||
- [promotion](../../Admin/properties/js_sdk.admin.Admin.promotion/page.mdx)
|
||||
- [campaign](../../Admin/properties/js_sdk.admin.Admin.campaign/page.mdx)
|
||||
@@ -2,16 +2,16 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ApiKey
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchSalesChannels](../../ApiKey/methods/js_sdk.admin.ApiKey.batchSalesChannels/page.mdx)
|
||||
- [create](../../ApiKey/methods/js_sdk.admin.ApiKey.create/page.mdx)
|
||||
- [delete](../../ApiKey/methods/js_sdk.admin.ApiKey.delete/page.mdx)
|
||||
- [list](../../ApiKey/methods/js_sdk.admin.ApiKey.list/page.mdx)
|
||||
- [retrieve](../../ApiKey/methods/js_sdk.admin.ApiKey.retrieve/page.mdx)
|
||||
- [revoke](../../ApiKey/methods/js_sdk.admin.ApiKey.revoke/page.mdx)
|
||||
- [update](../../ApiKey/methods/js_sdk.admin.ApiKey.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ApiKey/properties/js_sdk.admin.ApiKey.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../ApiKey/methods/js_sdk.admin.ApiKey.list/page.mdx)
|
||||
- [create](../../ApiKey/methods/js_sdk.admin.ApiKey.create/page.mdx)
|
||||
- [revoke](../../ApiKey/methods/js_sdk.admin.ApiKey.revoke/page.mdx)
|
||||
- [retrieve](../../ApiKey/methods/js_sdk.admin.ApiKey.retrieve/page.mdx)
|
||||
- [update](../../ApiKey/methods/js_sdk.admin.ApiKey.update/page.mdx)
|
||||
- [delete](../../ApiKey/methods/js_sdk.admin.ApiKey.delete/page.mdx)
|
||||
- [batchSalesChannels](../../ApiKey/methods/js_sdk.admin.ApiKey.batchSalesChannels/page.mdx)
|
||||
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Campaign
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchPromotions](../../Campaign/methods/js_sdk.admin.Campaign.batchPromotions/page.mdx)
|
||||
- [create](../../Campaign/methods/js_sdk.admin.Campaign.create/page.mdx)
|
||||
- [delete](../../Campaign/methods/js_sdk.admin.Campaign.delete/page.mdx)
|
||||
- [list](../../Campaign/methods/js_sdk.admin.Campaign.list/page.mdx)
|
||||
- [retrieve](../../Campaign/methods/js_sdk.admin.Campaign.retrieve/page.mdx)
|
||||
- [update](../../Campaign/methods/js_sdk.admin.Campaign.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Campaign/properties/js_sdk.admin.Campaign.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../Campaign/methods/js_sdk.admin.Campaign.retrieve/page.mdx)
|
||||
- [list](../../Campaign/methods/js_sdk.admin.Campaign.list/page.mdx)
|
||||
- [create](../../Campaign/methods/js_sdk.admin.Campaign.create/page.mdx)
|
||||
- [update](../../Campaign/methods/js_sdk.admin.Campaign.update/page.mdx)
|
||||
- [delete](../../Campaign/methods/js_sdk.admin.Campaign.delete/page.mdx)
|
||||
- [batchPromotions](../../Campaign/methods/js_sdk.admin.Campaign.batchPromotions/page.mdx)
|
||||
@@ -2,30 +2,30 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Claim
|
||||
|
||||
## Methods
|
||||
|
||||
- [addInboundItems](../../Claim/methods/js_sdk.admin.Claim.addInboundItems/page.mdx)
|
||||
- [addInboundShipping](../../Claim/methods/js_sdk.admin.Claim.addInboundShipping/page.mdx)
|
||||
- [addItems](../../Claim/methods/js_sdk.admin.Claim.addItems/page.mdx)
|
||||
- [addOutboundItems](../../Claim/methods/js_sdk.admin.Claim.addOutboundItems/page.mdx)
|
||||
- [addOutboundShipping](../../Claim/methods/js_sdk.admin.Claim.addOutboundShipping/page.mdx)
|
||||
- [cancel](../../Claim/methods/js_sdk.admin.Claim.cancel/page.mdx)
|
||||
- [cancelRequest](../../Claim/methods/js_sdk.admin.Claim.cancelRequest/page.mdx)
|
||||
- [create](../../Claim/methods/js_sdk.admin.Claim.create/page.mdx)
|
||||
- [deleteInboundShipping](../../Claim/methods/js_sdk.admin.Claim.deleteInboundShipping/page.mdx)
|
||||
- [deleteOutboundShipping](../../Claim/methods/js_sdk.admin.Claim.deleteOutboundShipping/page.mdx)
|
||||
- [list](../../Claim/methods/js_sdk.admin.Claim.list/page.mdx)
|
||||
- [removeInboundItem](../../Claim/methods/js_sdk.admin.Claim.removeInboundItem/page.mdx)
|
||||
- [removeItem](../../Claim/methods/js_sdk.admin.Claim.removeItem/page.mdx)
|
||||
- [removeOutboundItem](../../Claim/methods/js_sdk.admin.Claim.removeOutboundItem/page.mdx)
|
||||
- [request](../../Claim/methods/js_sdk.admin.Claim.request/page.mdx)
|
||||
- [retrieve](../../Claim/methods/js_sdk.admin.Claim.retrieve/page.mdx)
|
||||
- [updateInboundItem](../../Claim/methods/js_sdk.admin.Claim.updateInboundItem/page.mdx)
|
||||
- [updateInboundShipping](../../Claim/methods/js_sdk.admin.Claim.updateInboundShipping/page.mdx)
|
||||
- [updateItem](../../Claim/methods/js_sdk.admin.Claim.updateItem/page.mdx)
|
||||
- [updateOutboundItem](../../Claim/methods/js_sdk.admin.Claim.updateOutboundItem/page.mdx)
|
||||
- [updateOutboundShipping](../../Claim/methods/js_sdk.admin.Claim.updateOutboundShipping/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Claim/properties/js_sdk.admin.Claim.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Claim/methods/js_sdk.admin.Claim.list/page.mdx)
|
||||
- [retrieve](../../Claim/methods/js_sdk.admin.Claim.retrieve/page.mdx)
|
||||
- [create](../../Claim/methods/js_sdk.admin.Claim.create/page.mdx)
|
||||
- [cancel](../../Claim/methods/js_sdk.admin.Claim.cancel/page.mdx)
|
||||
- [addItems](../../Claim/methods/js_sdk.admin.Claim.addItems/page.mdx)
|
||||
- [updateItem](../../Claim/methods/js_sdk.admin.Claim.updateItem/page.mdx)
|
||||
- [removeItem](../../Claim/methods/js_sdk.admin.Claim.removeItem/page.mdx)
|
||||
- [addInboundItems](../../Claim/methods/js_sdk.admin.Claim.addInboundItems/page.mdx)
|
||||
- [updateInboundItem](../../Claim/methods/js_sdk.admin.Claim.updateInboundItem/page.mdx)
|
||||
- [removeInboundItem](../../Claim/methods/js_sdk.admin.Claim.removeInboundItem/page.mdx)
|
||||
- [addInboundShipping](../../Claim/methods/js_sdk.admin.Claim.addInboundShipping/page.mdx)
|
||||
- [updateInboundShipping](../../Claim/methods/js_sdk.admin.Claim.updateInboundShipping/page.mdx)
|
||||
- [deleteInboundShipping](../../Claim/methods/js_sdk.admin.Claim.deleteInboundShipping/page.mdx)
|
||||
- [addOutboundItems](../../Claim/methods/js_sdk.admin.Claim.addOutboundItems/page.mdx)
|
||||
- [updateOutboundItem](../../Claim/methods/js_sdk.admin.Claim.updateOutboundItem/page.mdx)
|
||||
- [removeOutboundItem](../../Claim/methods/js_sdk.admin.Claim.removeOutboundItem/page.mdx)
|
||||
- [addOutboundShipping](../../Claim/methods/js_sdk.admin.Claim.addOutboundShipping/page.mdx)
|
||||
- [updateOutboundShipping](../../Claim/methods/js_sdk.admin.Claim.updateOutboundShipping/page.mdx)
|
||||
- [deleteOutboundShipping](../../Claim/methods/js_sdk.admin.Claim.deleteOutboundShipping/page.mdx)
|
||||
- [request](../../Claim/methods/js_sdk.admin.Claim.request/page.mdx)
|
||||
- [cancelRequest](../../Claim/methods/js_sdk.admin.Claim.cancelRequest/page.mdx)
|
||||
@@ -2,25 +2,25 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Client
|
||||
|
||||
## Properties
|
||||
|
||||
- [fetch\_](../../Client/properties/js_sdk.admin.Client.fetch_/page.mdx)
|
||||
- [config](../../Client/properties/js_sdk.admin.Client.config/page.mdx)
|
||||
- [logger](../../Client/properties/js_sdk.admin.Client.logger/page.mdx)
|
||||
- [DEFAULT\_JWT\_STORAGE\_KEY](../../Client/properties/js_sdk.admin.Client.DEFAULT_JWT_STORAGE_KEY/page.mdx)
|
||||
- [token](../../Client/properties/js_sdk.admin.Client.token/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [fetch](../../Client/methods/js_sdk.admin.Client.fetch/page.mdx)
|
||||
- [fetchStream](../../Client/methods/js_sdk.admin.Client.fetchStream/page.mdx)
|
||||
- [setToken](../../Client/methods/js_sdk.admin.Client.setToken/page.mdx)
|
||||
- [clearToken](../../Client/methods/js_sdk.admin.Client.clearToken/page.mdx)
|
||||
- [clearToken\_](../../Client/methods/js_sdk.admin.Client.clearToken_/page.mdx)
|
||||
- [initClient](../../Client/methods/js_sdk.admin.Client.initClient/page.mdx)
|
||||
- [fetch](../../Client/methods/js_sdk.admin.Client.fetch/page.mdx)
|
||||
- [fetchStream](../../Client/methods/js_sdk.admin.Client.fetchStream/page.mdx)
|
||||
- [getApiKeyHeader\_](../../Client/methods/js_sdk.admin.Client.getApiKeyHeader_/page.mdx)
|
||||
- [getPublishableKeyHeader\_](../../Client/methods/js_sdk.admin.Client.getPublishableKeyHeader_/page.mdx)
|
||||
- [getJwtHeader\_](../../Client/methods/js_sdk.admin.Client.getJwtHeader_/page.mdx)
|
||||
- [setToken\_](../../Client/methods/js_sdk.admin.Client.setToken_/page.mdx)
|
||||
- [getPublishableKeyHeader\_](../../Client/methods/js_sdk.admin.Client.getPublishableKeyHeader_/page.mdx)
|
||||
- [getToken\_](../../Client/methods/js_sdk.admin.Client.getToken_/page.mdx)
|
||||
- [getTokenStorageInfo\_](../../Client/methods/js_sdk.admin.Client.getTokenStorageInfo_/page.mdx)
|
||||
- [initClient](../../Client/methods/js_sdk.admin.Client.initClient/page.mdx)
|
||||
- [setToken](../../Client/methods/js_sdk.admin.Client.setToken/page.mdx)
|
||||
- [setToken\_](../../Client/methods/js_sdk.admin.Client.setToken_/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [config](../../Client/properties/js_sdk.admin.Client.config/page.mdx)
|
||||
- [DEFAULT\_JWT\_STORAGE\_KEY](../../Client/properties/js_sdk.admin.Client.DEFAULT_JWT_STORAGE_KEY/page.mdx)
|
||||
- [fetch\_](../../Client/properties/js_sdk.admin.Client.fetch_/page.mdx)
|
||||
- [logger](../../Client/properties/js_sdk.admin.Client.logger/page.mdx)
|
||||
- [token](../../Client/properties/js_sdk.admin.Client.token/page.mdx)
|
||||
@@ -2,11 +2,11 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Currency
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Currency/properties/js_sdk.admin.Currency.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Currency/methods/js_sdk.admin.Currency.list/page.mdx)
|
||||
- [retrieve](../../Currency/methods/js_sdk.admin.Currency.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Currency/properties/js_sdk.admin.Currency.client/page.mdx)
|
||||
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Customer
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchCustomerGroups](../../Customer/methods/js_sdk.admin.Customer.batchCustomerGroups/page.mdx)
|
||||
- [create](../../Customer/methods/js_sdk.admin.Customer.create/page.mdx)
|
||||
- [delete](../../Customer/methods/js_sdk.admin.Customer.delete/page.mdx)
|
||||
- [list](../../Customer/methods/js_sdk.admin.Customer.list/page.mdx)
|
||||
- [retrieve](../../Customer/methods/js_sdk.admin.Customer.retrieve/page.mdx)
|
||||
- [update](../../Customer/methods/js_sdk.admin.Customer.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Customer/properties/js_sdk.admin.Customer.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../Customer/methods/js_sdk.admin.Customer.create/page.mdx)
|
||||
- [update](../../Customer/methods/js_sdk.admin.Customer.update/page.mdx)
|
||||
- [list](../../Customer/methods/js_sdk.admin.Customer.list/page.mdx)
|
||||
- [retrieve](../../Customer/methods/js_sdk.admin.Customer.retrieve/page.mdx)
|
||||
- [delete](../../Customer/methods/js_sdk.admin.Customer.delete/page.mdx)
|
||||
- [batchCustomerGroups](../../Customer/methods/js_sdk.admin.Customer.batchCustomerGroups/page.mdx)
|
||||
+9
-9
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# CustomerGroup
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchCustomers](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.batchCustomers/page.mdx)
|
||||
- [create](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.create/page.mdx)
|
||||
- [delete](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.delete/page.mdx)
|
||||
- [list](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.list/page.mdx)
|
||||
- [retrieve](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.retrieve/page.mdx)
|
||||
- [update](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../CustomerGroup/properties/js_sdk.admin.CustomerGroup.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.retrieve/page.mdx)
|
||||
- [list](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.list/page.mdx)
|
||||
- [create](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.create/page.mdx)
|
||||
- [update](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.update/page.mdx)
|
||||
- [delete](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.delete/page.mdx)
|
||||
- [batchCustomers](../../CustomerGroup/methods/js_sdk.admin.CustomerGroup.batchCustomers/page.mdx)
|
||||
@@ -2,27 +2,27 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Exchange
|
||||
|
||||
## Methods
|
||||
|
||||
- [addInboundItems](../../Exchange/methods/js_sdk.admin.Exchange.addInboundItems/page.mdx)
|
||||
- [addInboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.addInboundShipping/page.mdx)
|
||||
- [addOutboundItems](../../Exchange/methods/js_sdk.admin.Exchange.addOutboundItems/page.mdx)
|
||||
- [addOutboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.addOutboundShipping/page.mdx)
|
||||
- [cancel](../../Exchange/methods/js_sdk.admin.Exchange.cancel/page.mdx)
|
||||
- [cancelRequest](../../Exchange/methods/js_sdk.admin.Exchange.cancelRequest/page.mdx)
|
||||
- [create](../../Exchange/methods/js_sdk.admin.Exchange.create/page.mdx)
|
||||
- [deleteInboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.deleteInboundShipping/page.mdx)
|
||||
- [deleteOutboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.deleteOutboundShipping/page.mdx)
|
||||
- [list](../../Exchange/methods/js_sdk.admin.Exchange.list/page.mdx)
|
||||
- [removeInboundItem](../../Exchange/methods/js_sdk.admin.Exchange.removeInboundItem/page.mdx)
|
||||
- [removeOutboundItem](../../Exchange/methods/js_sdk.admin.Exchange.removeOutboundItem/page.mdx)
|
||||
- [request](../../Exchange/methods/js_sdk.admin.Exchange.request/page.mdx)
|
||||
- [retrieve](../../Exchange/methods/js_sdk.admin.Exchange.retrieve/page.mdx)
|
||||
- [updateInboundItem](../../Exchange/methods/js_sdk.admin.Exchange.updateInboundItem/page.mdx)
|
||||
- [updateInboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.updateInboundShipping/page.mdx)
|
||||
- [updateOutboundItem](../../Exchange/methods/js_sdk.admin.Exchange.updateOutboundItem/page.mdx)
|
||||
- [updateOutboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.updateOutboundShipping/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Exchange/properties/js_sdk.admin.Exchange.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Exchange/methods/js_sdk.admin.Exchange.list/page.mdx)
|
||||
- [retrieve](../../Exchange/methods/js_sdk.admin.Exchange.retrieve/page.mdx)
|
||||
- [create](../../Exchange/methods/js_sdk.admin.Exchange.create/page.mdx)
|
||||
- [cancel](../../Exchange/methods/js_sdk.admin.Exchange.cancel/page.mdx)
|
||||
- [addInboundItems](../../Exchange/methods/js_sdk.admin.Exchange.addInboundItems/page.mdx)
|
||||
- [updateInboundItem](../../Exchange/methods/js_sdk.admin.Exchange.updateInboundItem/page.mdx)
|
||||
- [removeInboundItem](../../Exchange/methods/js_sdk.admin.Exchange.removeInboundItem/page.mdx)
|
||||
- [addInboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.addInboundShipping/page.mdx)
|
||||
- [updateInboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.updateInboundShipping/page.mdx)
|
||||
- [deleteInboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.deleteInboundShipping/page.mdx)
|
||||
- [addOutboundItems](../../Exchange/methods/js_sdk.admin.Exchange.addOutboundItems/page.mdx)
|
||||
- [updateOutboundItem](../../Exchange/methods/js_sdk.admin.Exchange.updateOutboundItem/page.mdx)
|
||||
- [removeOutboundItem](../../Exchange/methods/js_sdk.admin.Exchange.removeOutboundItem/page.mdx)
|
||||
- [addOutboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.addOutboundShipping/page.mdx)
|
||||
- [updateOutboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.updateOutboundShipping/page.mdx)
|
||||
- [deleteOutboundShipping](../../Exchange/methods/js_sdk.admin.Exchange.deleteOutboundShipping/page.mdx)
|
||||
- [request](../../Exchange/methods/js_sdk.admin.Exchange.request/page.mdx)
|
||||
- [cancelRequest](../../Exchange/methods/js_sdk.admin.Exchange.cancelRequest/page.mdx)
|
||||
+6
-6
@@ -2,12 +2,12 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Fulfillment
|
||||
|
||||
## Methods
|
||||
|
||||
- [cancel](../../Fulfillment/methods/js_sdk.admin.Fulfillment.cancel/page.mdx)
|
||||
- [create](../../Fulfillment/methods/js_sdk.admin.Fulfillment.create/page.mdx)
|
||||
- [createShipment](../../Fulfillment/methods/js_sdk.admin.Fulfillment.createShipment/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Fulfillment/properties/js_sdk.admin.Fulfillment.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../Fulfillment/methods/js_sdk.admin.Fulfillment.create/page.mdx)
|
||||
- [cancel](../../Fulfillment/methods/js_sdk.admin.Fulfillment.cancel/page.mdx)
|
||||
- [createShipment](../../Fulfillment/methods/js_sdk.admin.Fulfillment.createShipment/page.mdx)
|
||||
+4
-4
@@ -2,10 +2,10 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# FulfillmentProvider
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../FulfillmentProvider/properties/js_sdk.admin.FulfillmentProvider.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../FulfillmentProvider/methods/js_sdk.admin.FulfillmentProvider.list/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../FulfillmentProvider/properties/js_sdk.admin.FulfillmentProvider.client/page.mdx)
|
||||
+8
-8
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# FulfillmentSet
|
||||
|
||||
## Methods
|
||||
|
||||
- [createServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.createServiceZone/page.mdx)
|
||||
- [delete](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.delete/page.mdx)
|
||||
- [deleteServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.deleteServiceZone/page.mdx)
|
||||
- [retrieveServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.retrieveServiceZone/page.mdx)
|
||||
- [updateServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.updateServiceZone/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../FulfillmentSet/properties/js_sdk.admin.FulfillmentSet.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [delete](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.delete/page.mdx)
|
||||
- [createServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.createServiceZone/page.mdx)
|
||||
- [retrieveServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.retrieveServiceZone/page.mdx)
|
||||
- [updateServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.updateServiceZone/page.mdx)
|
||||
- [deleteServiceZone](../../FulfillmentSet/methods/js_sdk.admin.FulfillmentSet.deleteServiceZone/page.mdx)
|
||||
+12
-12
@@ -2,18 +2,18 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# InventoryItem
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchUpdateLevels](../../InventoryItem/methods/js_sdk.admin.InventoryItem.batchUpdateLevels/page.mdx)
|
||||
- [create](../../InventoryItem/methods/js_sdk.admin.InventoryItem.create/page.mdx)
|
||||
- [delete](../../InventoryItem/methods/js_sdk.admin.InventoryItem.delete/page.mdx)
|
||||
- [deleteLevel](../../InventoryItem/methods/js_sdk.admin.InventoryItem.deleteLevel/page.mdx)
|
||||
- [list](../../InventoryItem/methods/js_sdk.admin.InventoryItem.list/page.mdx)
|
||||
- [listLevels](../../InventoryItem/methods/js_sdk.admin.InventoryItem.listLevels/page.mdx)
|
||||
- [retrieve](../../InventoryItem/methods/js_sdk.admin.InventoryItem.retrieve/page.mdx)
|
||||
- [update](../../InventoryItem/methods/js_sdk.admin.InventoryItem.update/page.mdx)
|
||||
- [updateLevel](../../InventoryItem/methods/js_sdk.admin.InventoryItem.updateLevel/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../InventoryItem/properties/js_sdk.admin.InventoryItem.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../InventoryItem/methods/js_sdk.admin.InventoryItem.create/page.mdx)
|
||||
- [update](../../InventoryItem/methods/js_sdk.admin.InventoryItem.update/page.mdx)
|
||||
- [list](../../InventoryItem/methods/js_sdk.admin.InventoryItem.list/page.mdx)
|
||||
- [retrieve](../../InventoryItem/methods/js_sdk.admin.InventoryItem.retrieve/page.mdx)
|
||||
- [delete](../../InventoryItem/methods/js_sdk.admin.InventoryItem.delete/page.mdx)
|
||||
- [listLevels](../../InventoryItem/methods/js_sdk.admin.InventoryItem.listLevels/page.mdx)
|
||||
- [updateLevel](../../InventoryItem/methods/js_sdk.admin.InventoryItem.updateLevel/page.mdx)
|
||||
- [deleteLevel](../../InventoryItem/methods/js_sdk.admin.InventoryItem.deleteLevel/page.mdx)
|
||||
- [batchUpdateLevels](../../InventoryItem/methods/js_sdk.admin.InventoryItem.batchUpdateLevels/page.mdx)
|
||||
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Invite
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Invite/properties/js_sdk.admin.Invite.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [accept](../../Invite/methods/js_sdk.admin.Invite.accept/page.mdx)
|
||||
- [create](../../Invite/methods/js_sdk.admin.Invite.create/page.mdx)
|
||||
- [retrieve](../../Invite/methods/js_sdk.admin.Invite.retrieve/page.mdx)
|
||||
- [delete](../../Invite/methods/js_sdk.admin.Invite.delete/page.mdx)
|
||||
- [list](../../Invite/methods/js_sdk.admin.Invite.list/page.mdx)
|
||||
- [resend](../../Invite/methods/js_sdk.admin.Invite.resend/page.mdx)
|
||||
- [delete](../../Invite/methods/js_sdk.admin.Invite.delete/page.mdx)
|
||||
- [retrieve](../../Invite/methods/js_sdk.admin.Invite.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Invite/properties/js_sdk.admin.Invite.client/page.mdx)
|
||||
+5
-5
@@ -2,11 +2,11 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Notification
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Notification/methods/js_sdk.admin.Notification.list/page.mdx)
|
||||
- [retrieve](../../Notification/methods/js_sdk.admin.Notification.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Notification/properties/js_sdk.admin.Notification.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../Notification/methods/js_sdk.admin.Notification.retrieve/page.mdx)
|
||||
- [list](../../Notification/methods/js_sdk.admin.Notification.list/page.mdx)
|
||||
@@ -2,19 +2,20 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Order
|
||||
|
||||
## Methods
|
||||
|
||||
- [cancel](../../Order/methods/js_sdk.admin.Order.cancel/page.mdx)
|
||||
- [cancelFulfillment](../../Order/methods/js_sdk.admin.Order.cancelFulfillment/page.mdx)
|
||||
- [createFulfillment](../../Order/methods/js_sdk.admin.Order.createFulfillment/page.mdx)
|
||||
- [createShipment](../../Order/methods/js_sdk.admin.Order.createShipment/page.mdx)
|
||||
- [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)
|
||||
- [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)
|
||||
- [retrievePreview](../../Order/methods/js_sdk.admin.Order.retrievePreview/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Order/properties/js_sdk.admin.Order.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../Order/methods/js_sdk.admin.Order.retrieve/page.mdx)
|
||||
- [retrievePreview](../../Order/methods/js_sdk.admin.Order.retrievePreview/page.mdx)
|
||||
- [list](../../Order/methods/js_sdk.admin.Order.list/page.mdx)
|
||||
- [cancel](../../Order/methods/js_sdk.admin.Order.cancel/page.mdx)
|
||||
- [createFulfillment](../../Order/methods/js_sdk.admin.Order.createFulfillment/page.mdx)
|
||||
- [cancelFulfillment](../../Order/methods/js_sdk.admin.Order.cancelFulfillment/page.mdx)
|
||||
- [createShipment](../../Order/methods/js_sdk.admin.Order.createShipment/page.mdx)
|
||||
- [markAsDelivered](../../Order/methods/js_sdk.admin.Order.markAsDelivered/page.mdx)
|
||||
- [listChanges](../../Order/methods/js_sdk.admin.Order.listChanges/page.mdx)
|
||||
- [listLineItems](../../Order/methods/js_sdk.admin.Order.listLineItems/page.mdx)
|
||||
+11
-11
@@ -2,17 +2,17 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# OrderEdit
|
||||
|
||||
## Methods
|
||||
|
||||
- [addItems](../../OrderEdit/methods/js_sdk.admin.OrderEdit.addItems/page.mdx)
|
||||
- [cancelRequest](../../OrderEdit/methods/js_sdk.admin.OrderEdit.cancelRequest/page.mdx)
|
||||
- [confirm](../../OrderEdit/methods/js_sdk.admin.OrderEdit.confirm/page.mdx)
|
||||
- [initiateRequest](../../OrderEdit/methods/js_sdk.admin.OrderEdit.initiateRequest/page.mdx)
|
||||
- [removeAddedItem](../../OrderEdit/methods/js_sdk.admin.OrderEdit.removeAddedItem/page.mdx)
|
||||
- [request](../../OrderEdit/methods/js_sdk.admin.OrderEdit.request/page.mdx)
|
||||
- [updateAddedItem](../../OrderEdit/methods/js_sdk.admin.OrderEdit.updateAddedItem/page.mdx)
|
||||
- [updateOriginalItem](../../OrderEdit/methods/js_sdk.admin.OrderEdit.updateOriginalItem/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../OrderEdit/properties/js_sdk.admin.OrderEdit.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [initiateRequest](../../OrderEdit/methods/js_sdk.admin.OrderEdit.initiateRequest/page.mdx)
|
||||
- [request](../../OrderEdit/methods/js_sdk.admin.OrderEdit.request/page.mdx)
|
||||
- [confirm](../../OrderEdit/methods/js_sdk.admin.OrderEdit.confirm/page.mdx)
|
||||
- [cancelRequest](../../OrderEdit/methods/js_sdk.admin.OrderEdit.cancelRequest/page.mdx)
|
||||
- [addItems](../../OrderEdit/methods/js_sdk.admin.OrderEdit.addItems/page.mdx)
|
||||
- [updateOriginalItem](../../OrderEdit/methods/js_sdk.admin.OrderEdit.updateOriginalItem/page.mdx)
|
||||
- [updateAddedItem](../../OrderEdit/methods/js_sdk.admin.OrderEdit.updateAddedItem/page.mdx)
|
||||
- [removeAddedItem](../../OrderEdit/methods/js_sdk.admin.OrderEdit.removeAddedItem/page.mdx)
|
||||
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Payment
|
||||
|
||||
## Methods
|
||||
|
||||
- [capture](../../Payment/methods/js_sdk.admin.Payment.capture/page.mdx)
|
||||
- [list](../../Payment/methods/js_sdk.admin.Payment.list/page.mdx)
|
||||
- [listPaymentProviders](../../Payment/methods/js_sdk.admin.Payment.listPaymentProviders/page.mdx)
|
||||
- [refund](../../Payment/methods/js_sdk.admin.Payment.refund/page.mdx)
|
||||
- [retrieve](../../Payment/methods/js_sdk.admin.Payment.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Payment/properties/js_sdk.admin.Payment.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Payment/methods/js_sdk.admin.Payment.list/page.mdx)
|
||||
- [listPaymentProviders](../../Payment/methods/js_sdk.admin.Payment.listPaymentProviders/page.mdx)
|
||||
- [retrieve](../../Payment/methods/js_sdk.admin.Payment.retrieve/page.mdx)
|
||||
- [capture](../../Payment/methods/js_sdk.admin.Payment.capture/page.mdx)
|
||||
- [refund](../../Payment/methods/js_sdk.admin.Payment.refund/page.mdx)
|
||||
+4
-4
@@ -2,12 +2,12 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# PaymentCollection
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../PaymentCollection/properties/js_sdk.admin.PaymentCollection.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../PaymentCollection/methods/js_sdk.admin.PaymentCollection.create/page.mdx)
|
||||
- [delete](../../PaymentCollection/methods/js_sdk.admin.PaymentCollection.delete/page.mdx)
|
||||
- [markAsPaid](../../PaymentCollection/methods/js_sdk.admin.PaymentCollection.markAsPaid/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../PaymentCollection/properties/js_sdk.admin.PaymentCollection.client/page.mdx)
|
||||
+10
-10
@@ -2,16 +2,16 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# PriceList
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchPrices](../../PriceList/methods/js_sdk.admin.PriceList.batchPrices/page.mdx)
|
||||
- [create](../../PriceList/methods/js_sdk.admin.PriceList.create/page.mdx)
|
||||
- [delete](../../PriceList/methods/js_sdk.admin.PriceList.delete/page.mdx)
|
||||
- [linkProducts](../../PriceList/methods/js_sdk.admin.PriceList.linkProducts/page.mdx)
|
||||
- [list](../../PriceList/methods/js_sdk.admin.PriceList.list/page.mdx)
|
||||
- [retrieve](../../PriceList/methods/js_sdk.admin.PriceList.retrieve/page.mdx)
|
||||
- [update](../../PriceList/methods/js_sdk.admin.PriceList.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../PriceList/properties/js_sdk.admin.PriceList.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../PriceList/methods/js_sdk.admin.PriceList.retrieve/page.mdx)
|
||||
- [list](../../PriceList/methods/js_sdk.admin.PriceList.list/page.mdx)
|
||||
- [create](../../PriceList/methods/js_sdk.admin.PriceList.create/page.mdx)
|
||||
- [update](../../PriceList/methods/js_sdk.admin.PriceList.update/page.mdx)
|
||||
- [delete](../../PriceList/methods/js_sdk.admin.PriceList.delete/page.mdx)
|
||||
- [batchPrices](../../PriceList/methods/js_sdk.admin.PriceList.batchPrices/page.mdx)
|
||||
- [linkProducts](../../PriceList/methods/js_sdk.admin.PriceList.linkProducts/page.mdx)
|
||||
+8
-8
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# PricePreference
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../PricePreference/methods/js_sdk.admin.PricePreference.create/page.mdx)
|
||||
- [delete](../../PricePreference/methods/js_sdk.admin.PricePreference.delete/page.mdx)
|
||||
- [list](../../PricePreference/methods/js_sdk.admin.PricePreference.list/page.mdx)
|
||||
- [retrieve](../../PricePreference/methods/js_sdk.admin.PricePreference.retrieve/page.mdx)
|
||||
- [update](../../PricePreference/methods/js_sdk.admin.PricePreference.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../PricePreference/properties/js_sdk.admin.PricePreference.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../PricePreference/methods/js_sdk.admin.PricePreference.retrieve/page.mdx)
|
||||
- [list](../../PricePreference/methods/js_sdk.admin.PricePreference.list/page.mdx)
|
||||
- [create](../../PricePreference/methods/js_sdk.admin.PricePreference.create/page.mdx)
|
||||
- [update](../../PricePreference/methods/js_sdk.admin.PricePreference.update/page.mdx)
|
||||
- [delete](../../PricePreference/methods/js_sdk.admin.PricePreference.delete/page.mdx)
|
||||
@@ -2,30 +2,30 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Product
|
||||
|
||||
## Methods
|
||||
|
||||
- [batch](../../Product/methods/js_sdk.admin.Product.batch/page.mdx)
|
||||
- [batchVariantInventoryItems](../../Product/methods/js_sdk.admin.Product.batchVariantInventoryItems/page.mdx)
|
||||
- [batchVariants](../../Product/methods/js_sdk.admin.Product.batchVariants/page.mdx)
|
||||
- [confirmImport](../../Product/methods/js_sdk.admin.Product.confirmImport/page.mdx)
|
||||
- [create](../../Product/methods/js_sdk.admin.Product.create/page.mdx)
|
||||
- [createOption](../../Product/methods/js_sdk.admin.Product.createOption/page.mdx)
|
||||
- [createVariant](../../Product/methods/js_sdk.admin.Product.createVariant/page.mdx)
|
||||
- [delete](../../Product/methods/js_sdk.admin.Product.delete/page.mdx)
|
||||
- [deleteOption](../../Product/methods/js_sdk.admin.Product.deleteOption/page.mdx)
|
||||
- [deleteVariant](../../Product/methods/js_sdk.admin.Product.deleteVariant/page.mdx)
|
||||
- [export](../../Product/methods/js_sdk.admin.Product.export/page.mdx)
|
||||
- [import](../../Product/methods/js_sdk.admin.Product.import/page.mdx)
|
||||
- [list](../../Product/methods/js_sdk.admin.Product.list/page.mdx)
|
||||
- [listOptions](../../Product/methods/js_sdk.admin.Product.listOptions/page.mdx)
|
||||
- [listVariants](../../Product/methods/js_sdk.admin.Product.listVariants/page.mdx)
|
||||
- [retrieve](../../Product/methods/js_sdk.admin.Product.retrieve/page.mdx)
|
||||
- [retrieveOption](../../Product/methods/js_sdk.admin.Product.retrieveOption/page.mdx)
|
||||
- [retrieveVariant](../../Product/methods/js_sdk.admin.Product.retrieveVariant/page.mdx)
|
||||
- [update](../../Product/methods/js_sdk.admin.Product.update/page.mdx)
|
||||
- [updateOption](../../Product/methods/js_sdk.admin.Product.updateOption/page.mdx)
|
||||
- [updateVariant](../../Product/methods/js_sdk.admin.Product.updateVariant/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Product/properties/js_sdk.admin.Product.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [import](../../Product/methods/js_sdk.admin.Product.import/page.mdx)
|
||||
- [confirmImport](../../Product/methods/js_sdk.admin.Product.confirmImport/page.mdx)
|
||||
- [export](../../Product/methods/js_sdk.admin.Product.export/page.mdx)
|
||||
- [batch](../../Product/methods/js_sdk.admin.Product.batch/page.mdx)
|
||||
- [create](../../Product/methods/js_sdk.admin.Product.create/page.mdx)
|
||||
- [update](../../Product/methods/js_sdk.admin.Product.update/page.mdx)
|
||||
- [list](../../Product/methods/js_sdk.admin.Product.list/page.mdx)
|
||||
- [retrieve](../../Product/methods/js_sdk.admin.Product.retrieve/page.mdx)
|
||||
- [delete](../../Product/methods/js_sdk.admin.Product.delete/page.mdx)
|
||||
- [batchVariants](../../Product/methods/js_sdk.admin.Product.batchVariants/page.mdx)
|
||||
- [createVariant](../../Product/methods/js_sdk.admin.Product.createVariant/page.mdx)
|
||||
- [updateVariant](../../Product/methods/js_sdk.admin.Product.updateVariant/page.mdx)
|
||||
- [listVariants](../../Product/methods/js_sdk.admin.Product.listVariants/page.mdx)
|
||||
- [retrieveVariant](../../Product/methods/js_sdk.admin.Product.retrieveVariant/page.mdx)
|
||||
- [deleteVariant](../../Product/methods/js_sdk.admin.Product.deleteVariant/page.mdx)
|
||||
- [batchVariantInventoryItems](../../Product/methods/js_sdk.admin.Product.batchVariantInventoryItems/page.mdx)
|
||||
- [createOption](../../Product/methods/js_sdk.admin.Product.createOption/page.mdx)
|
||||
- [updateOption](../../Product/methods/js_sdk.admin.Product.updateOption/page.mdx)
|
||||
- [listOptions](../../Product/methods/js_sdk.admin.Product.listOptions/page.mdx)
|
||||
- [retrieveOption](../../Product/methods/js_sdk.admin.Product.retrieveOption/page.mdx)
|
||||
- [deleteOption](../../Product/methods/js_sdk.admin.Product.deleteOption/page.mdx)
|
||||
+6
-6
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ProductCategory
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductCategory/properties/js_sdk.admin.ProductCategory.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ProductCategory/methods/js_sdk.admin.ProductCategory.create/page.mdx)
|
||||
- [update](../../ProductCategory/methods/js_sdk.admin.ProductCategory.update/page.mdx)
|
||||
- [delete](../../ProductCategory/methods/js_sdk.admin.ProductCategory.delete/page.mdx)
|
||||
- [list](../../ProductCategory/methods/js_sdk.admin.ProductCategory.list/page.mdx)
|
||||
- [retrieve](../../ProductCategory/methods/js_sdk.admin.ProductCategory.retrieve/page.mdx)
|
||||
- [delete](../../ProductCategory/methods/js_sdk.admin.ProductCategory.delete/page.mdx)
|
||||
- [update](../../ProductCategory/methods/js_sdk.admin.ProductCategory.update/page.mdx)
|
||||
- [updateProducts](../../ProductCategory/methods/js_sdk.admin.ProductCategory.updateProducts/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductCategory/properties/js_sdk.admin.ProductCategory.client/page.mdx)
|
||||
+6
-6
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ProductCollection
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductCollection/properties/js_sdk.admin.ProductCollection.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ProductCollection/methods/js_sdk.admin.ProductCollection.create/page.mdx)
|
||||
- [update](../../ProductCollection/methods/js_sdk.admin.ProductCollection.update/page.mdx)
|
||||
- [delete](../../ProductCollection/methods/js_sdk.admin.ProductCollection.delete/page.mdx)
|
||||
- [list](../../ProductCollection/methods/js_sdk.admin.ProductCollection.list/page.mdx)
|
||||
- [retrieve](../../ProductCollection/methods/js_sdk.admin.ProductCollection.retrieve/page.mdx)
|
||||
- [delete](../../ProductCollection/methods/js_sdk.admin.ProductCollection.delete/page.mdx)
|
||||
- [update](../../ProductCollection/methods/js_sdk.admin.ProductCollection.update/page.mdx)
|
||||
- [updateProducts](../../ProductCollection/methods/js_sdk.admin.ProductCollection.updateProducts/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductCollection/properties/js_sdk.admin.ProductCollection.client/page.mdx)
|
||||
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ProductTag
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductTag/properties/js_sdk.admin.ProductTag.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ProductTag/methods/js_sdk.admin.ProductTag.create/page.mdx)
|
||||
- [update](../../ProductTag/methods/js_sdk.admin.ProductTag.update/page.mdx)
|
||||
- [delete](../../ProductTag/methods/js_sdk.admin.ProductTag.delete/page.mdx)
|
||||
- [list](../../ProductTag/methods/js_sdk.admin.ProductTag.list/page.mdx)
|
||||
- [retrieve](../../ProductTag/methods/js_sdk.admin.ProductTag.retrieve/page.mdx)
|
||||
- [delete](../../ProductTag/methods/js_sdk.admin.ProductTag.delete/page.mdx)
|
||||
- [update](../../ProductTag/methods/js_sdk.admin.ProductTag.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductTag/properties/js_sdk.admin.ProductTag.client/page.mdx)
|
||||
+6
-6
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ProductType
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductType/properties/js_sdk.admin.ProductType.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ProductType/methods/js_sdk.admin.ProductType.create/page.mdx)
|
||||
- [update](../../ProductType/methods/js_sdk.admin.ProductType.update/page.mdx)
|
||||
- [delete](../../ProductType/methods/js_sdk.admin.ProductType.delete/page.mdx)
|
||||
- [list](../../ProductType/methods/js_sdk.admin.ProductType.list/page.mdx)
|
||||
- [retrieve](../../ProductType/methods/js_sdk.admin.ProductType.retrieve/page.mdx)
|
||||
- [delete](../../ProductType/methods/js_sdk.admin.ProductType.delete/page.mdx)
|
||||
- [update](../../ProductType/methods/js_sdk.admin.ProductType.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductType/properties/js_sdk.admin.ProductType.client/page.mdx)
|
||||
+4
-4
@@ -2,10 +2,10 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ProductVariant
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductVariant/properties/js_sdk.admin.ProductVariant.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../ProductVariant/methods/js_sdk.admin.ProductVariant.list/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ProductVariant/properties/js_sdk.admin.ProductVariant.client/page.mdx)
|
||||
+14
-14
@@ -2,20 +2,20 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Promotion
|
||||
|
||||
## Methods
|
||||
|
||||
- [addRules](../../Promotion/methods/js_sdk.admin.Promotion.addRules/page.mdx)
|
||||
- [create](../../Promotion/methods/js_sdk.admin.Promotion.create/page.mdx)
|
||||
- [delete](../../Promotion/methods/js_sdk.admin.Promotion.delete/page.mdx)
|
||||
- [list](../../Promotion/methods/js_sdk.admin.Promotion.list/page.mdx)
|
||||
- [listRuleAttributes](../../Promotion/methods/js_sdk.admin.Promotion.listRuleAttributes/page.mdx)
|
||||
- [listRules](../../Promotion/methods/js_sdk.admin.Promotion.listRules/page.mdx)
|
||||
- [listRuleValues](../../Promotion/methods/js_sdk.admin.Promotion.listRuleValues/page.mdx)
|
||||
- [removeRules](../../Promotion/methods/js_sdk.admin.Promotion.removeRules/page.mdx)
|
||||
- [retrieve](../../Promotion/methods/js_sdk.admin.Promotion.retrieve/page.mdx)
|
||||
- [update](../../Promotion/methods/js_sdk.admin.Promotion.update/page.mdx)
|
||||
- [updateRules](../../Promotion/methods/js_sdk.admin.Promotion.updateRules/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Promotion/properties/js_sdk.admin.Promotion.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../Promotion/methods/js_sdk.admin.Promotion.retrieve/page.mdx)
|
||||
- [list](../../Promotion/methods/js_sdk.admin.Promotion.list/page.mdx)
|
||||
- [create](../../Promotion/methods/js_sdk.admin.Promotion.create/page.mdx)
|
||||
- [update](../../Promotion/methods/js_sdk.admin.Promotion.update/page.mdx)
|
||||
- [delete](../../Promotion/methods/js_sdk.admin.Promotion.delete/page.mdx)
|
||||
- [addRules](../../Promotion/methods/js_sdk.admin.Promotion.addRules/page.mdx)
|
||||
- [updateRules](../../Promotion/methods/js_sdk.admin.Promotion.updateRules/page.mdx)
|
||||
- [removeRules](../../Promotion/methods/js_sdk.admin.Promotion.removeRules/page.mdx)
|
||||
- [listRules](../../Promotion/methods/js_sdk.admin.Promotion.listRules/page.mdx)
|
||||
- [listRuleAttributes](../../Promotion/methods/js_sdk.admin.Promotion.listRuleAttributes/page.mdx)
|
||||
- [listRuleValues](../../Promotion/methods/js_sdk.admin.Promotion.listRuleValues/page.mdx)
|
||||
+4
-4
@@ -2,10 +2,10 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# RefundReason
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../RefundReason/properties/js_sdk.admin.RefundReason.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../RefundReason/methods/js_sdk.admin.RefundReason.list/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../RefundReason/properties/js_sdk.admin.RefundReason.client/page.mdx)
|
||||
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Region
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Region/properties/js_sdk.admin.Region.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../Region/methods/js_sdk.admin.Region.create/page.mdx)
|
||||
- [update](../../Region/methods/js_sdk.admin.Region.update/page.mdx)
|
||||
- [delete](../../Region/methods/js_sdk.admin.Region.delete/page.mdx)
|
||||
- [list](../../Region/methods/js_sdk.admin.Region.list/page.mdx)
|
||||
- [retrieve](../../Region/methods/js_sdk.admin.Region.retrieve/page.mdx)
|
||||
- [delete](../../Region/methods/js_sdk.admin.Region.delete/page.mdx)
|
||||
- [update](../../Region/methods/js_sdk.admin.Region.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Region/properties/js_sdk.admin.Region.client/page.mdx)
|
||||
+8
-8
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Reservation
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../Reservation/methods/js_sdk.admin.Reservation.create/page.mdx)
|
||||
- [delete](../../Reservation/methods/js_sdk.admin.Reservation.delete/page.mdx)
|
||||
- [list](../../Reservation/methods/js_sdk.admin.Reservation.list/page.mdx)
|
||||
- [retrieve](../../Reservation/methods/js_sdk.admin.Reservation.retrieve/page.mdx)
|
||||
- [update](../../Reservation/methods/js_sdk.admin.Reservation.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Reservation/properties/js_sdk.admin.Reservation.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../Reservation/methods/js_sdk.admin.Reservation.retrieve/page.mdx)
|
||||
- [list](../../Reservation/methods/js_sdk.admin.Reservation.list/page.mdx)
|
||||
- [create](../../Reservation/methods/js_sdk.admin.Reservation.create/page.mdx)
|
||||
- [update](../../Reservation/methods/js_sdk.admin.Reservation.update/page.mdx)
|
||||
- [delete](../../Reservation/methods/js_sdk.admin.Reservation.delete/page.mdx)
|
||||
@@ -2,31 +2,31 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Return
|
||||
|
||||
## Methods
|
||||
|
||||
- [addReturnItem](../../Return/methods/js_sdk.admin.Return.addReturnItem/page.mdx)
|
||||
- [addReturnShipping](../../Return/methods/js_sdk.admin.Return.addReturnShipping/page.mdx)
|
||||
- [cancel](../../Return/methods/js_sdk.admin.Return.cancel/page.mdx)
|
||||
- [cancelReceive](../../Return/methods/js_sdk.admin.Return.cancelReceive/page.mdx)
|
||||
- [cancelRequest](../../Return/methods/js_sdk.admin.Return.cancelRequest/page.mdx)
|
||||
- [confirmReceive](../../Return/methods/js_sdk.admin.Return.confirmReceive/page.mdx)
|
||||
- [confirmRequest](../../Return/methods/js_sdk.admin.Return.confirmRequest/page.mdx)
|
||||
- [deleteReturnShipping](../../Return/methods/js_sdk.admin.Return.deleteReturnShipping/page.mdx)
|
||||
- [dismissItems](../../Return/methods/js_sdk.admin.Return.dismissItems/page.mdx)
|
||||
- [initiateReceive](../../Return/methods/js_sdk.admin.Return.initiateReceive/page.mdx)
|
||||
- [initiateRequest](../../Return/methods/js_sdk.admin.Return.initiateRequest/page.mdx)
|
||||
- [list](../../Return/methods/js_sdk.admin.Return.list/page.mdx)
|
||||
- [receiveItems](../../Return/methods/js_sdk.admin.Return.receiveItems/page.mdx)
|
||||
- [removeDismissItem](../../Return/methods/js_sdk.admin.Return.removeDismissItem/page.mdx)
|
||||
- [removeReceiveItem](../../Return/methods/js_sdk.admin.Return.removeReceiveItem/page.mdx)
|
||||
- [removeReturnItem](../../Return/methods/js_sdk.admin.Return.removeReturnItem/page.mdx)
|
||||
- [retrieve](../../Return/methods/js_sdk.admin.Return.retrieve/page.mdx)
|
||||
- [updateDismissItem](../../Return/methods/js_sdk.admin.Return.updateDismissItem/page.mdx)
|
||||
- [updateReceiveItem](../../Return/methods/js_sdk.admin.Return.updateReceiveItem/page.mdx)
|
||||
- [updateRequest](../../Return/methods/js_sdk.admin.Return.updateRequest/page.mdx)
|
||||
- [updateReturnItem](../../Return/methods/js_sdk.admin.Return.updateReturnItem/page.mdx)
|
||||
- [updateReturnShipping](../../Return/methods/js_sdk.admin.Return.updateReturnShipping/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Return/properties/js_sdk.admin.Return.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Return/methods/js_sdk.admin.Return.list/page.mdx)
|
||||
- [retrieve](../../Return/methods/js_sdk.admin.Return.retrieve/page.mdx)
|
||||
- [initiateRequest](../../Return/methods/js_sdk.admin.Return.initiateRequest/page.mdx)
|
||||
- [cancel](../../Return/methods/js_sdk.admin.Return.cancel/page.mdx)
|
||||
- [cancelRequest](../../Return/methods/js_sdk.admin.Return.cancelRequest/page.mdx)
|
||||
- [addReturnItem](../../Return/methods/js_sdk.admin.Return.addReturnItem/page.mdx)
|
||||
- [updateReturnItem](../../Return/methods/js_sdk.admin.Return.updateReturnItem/page.mdx)
|
||||
- [removeReturnItem](../../Return/methods/js_sdk.admin.Return.removeReturnItem/page.mdx)
|
||||
- [addReturnShipping](../../Return/methods/js_sdk.admin.Return.addReturnShipping/page.mdx)
|
||||
- [updateReturnShipping](../../Return/methods/js_sdk.admin.Return.updateReturnShipping/page.mdx)
|
||||
- [deleteReturnShipping](../../Return/methods/js_sdk.admin.Return.deleteReturnShipping/page.mdx)
|
||||
- [updateRequest](../../Return/methods/js_sdk.admin.Return.updateRequest/page.mdx)
|
||||
- [confirmRequest](../../Return/methods/js_sdk.admin.Return.confirmRequest/page.mdx)
|
||||
- [initiateReceive](../../Return/methods/js_sdk.admin.Return.initiateReceive/page.mdx)
|
||||
- [receiveItems](../../Return/methods/js_sdk.admin.Return.receiveItems/page.mdx)
|
||||
- [updateReceiveItem](../../Return/methods/js_sdk.admin.Return.updateReceiveItem/page.mdx)
|
||||
- [removeReceiveItem](../../Return/methods/js_sdk.admin.Return.removeReceiveItem/page.mdx)
|
||||
- [dismissItems](../../Return/methods/js_sdk.admin.Return.dismissItems/page.mdx)
|
||||
- [updateDismissItem](../../Return/methods/js_sdk.admin.Return.updateDismissItem/page.mdx)
|
||||
- [removeDismissItem](../../Return/methods/js_sdk.admin.Return.removeDismissItem/page.mdx)
|
||||
- [confirmReceive](../../Return/methods/js_sdk.admin.Return.confirmReceive/page.mdx)
|
||||
- [cancelReceive](../../Return/methods/js_sdk.admin.Return.cancelReceive/page.mdx)
|
||||
+8
-8
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ReturnReason
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ReturnReason/methods/js_sdk.admin.ReturnReason.create/page.mdx)
|
||||
- [delete](../../ReturnReason/methods/js_sdk.admin.ReturnReason.delete/page.mdx)
|
||||
- [list](../../ReturnReason/methods/js_sdk.admin.ReturnReason.list/page.mdx)
|
||||
- [retrieve](../../ReturnReason/methods/js_sdk.admin.ReturnReason.retrieve/page.mdx)
|
||||
- [update](../../ReturnReason/methods/js_sdk.admin.ReturnReason.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ReturnReason/properties/js_sdk.admin.ReturnReason.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../ReturnReason/methods/js_sdk.admin.ReturnReason.list/page.mdx)
|
||||
- [retrieve](../../ReturnReason/methods/js_sdk.admin.ReturnReason.retrieve/page.mdx)
|
||||
- [create](../../ReturnReason/methods/js_sdk.admin.ReturnReason.create/page.mdx)
|
||||
- [update](../../ReturnReason/methods/js_sdk.admin.ReturnReason.update/page.mdx)
|
||||
- [delete](../../ReturnReason/methods/js_sdk.admin.ReturnReason.delete/page.mdx)
|
||||
+10
-10
@@ -2,16 +2,16 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# SalesChannel
|
||||
|
||||
## Methods
|
||||
|
||||
- [batchProducts](../../SalesChannel/methods/js_sdk.admin.SalesChannel.batchProducts/page.mdx)
|
||||
- [create](../../SalesChannel/methods/js_sdk.admin.SalesChannel.create/page.mdx)
|
||||
- [delete](../../SalesChannel/methods/js_sdk.admin.SalesChannel.delete/page.mdx)
|
||||
- [list](../../SalesChannel/methods/js_sdk.admin.SalesChannel.list/page.mdx)
|
||||
- [retrieve](../../SalesChannel/methods/js_sdk.admin.SalesChannel.retrieve/page.mdx)
|
||||
- [update](../../SalesChannel/methods/js_sdk.admin.SalesChannel.update/page.mdx)
|
||||
- [updateProducts](../../SalesChannel/methods/js_sdk.admin.SalesChannel.updateProducts/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../SalesChannel/properties/js_sdk.admin.SalesChannel.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../SalesChannel/methods/js_sdk.admin.SalesChannel.create/page.mdx)
|
||||
- [update](../../SalesChannel/methods/js_sdk.admin.SalesChannel.update/page.mdx)
|
||||
- [delete](../../SalesChannel/methods/js_sdk.admin.SalesChannel.delete/page.mdx)
|
||||
- [retrieve](../../SalesChannel/methods/js_sdk.admin.SalesChannel.retrieve/page.mdx)
|
||||
- [list](../../SalesChannel/methods/js_sdk.admin.SalesChannel.list/page.mdx)
|
||||
- [updateProducts](../../SalesChannel/methods/js_sdk.admin.SalesChannel.updateProducts/page.mdx)
|
||||
- [batchProducts](../../SalesChannel/methods/js_sdk.admin.SalesChannel.batchProducts/page.mdx)
|
||||
+6
-6
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ShippingOption
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ShippingOption/properties/js_sdk.admin.ShippingOption.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ShippingOption/methods/js_sdk.admin.ShippingOption.create/page.mdx)
|
||||
- [retrieve](../../ShippingOption/methods/js_sdk.admin.ShippingOption.retrieve/page.mdx)
|
||||
- [update](../../ShippingOption/methods/js_sdk.admin.ShippingOption.update/page.mdx)
|
||||
- [delete](../../ShippingOption/methods/js_sdk.admin.ShippingOption.delete/page.mdx)
|
||||
- [list](../../ShippingOption/methods/js_sdk.admin.ShippingOption.list/page.mdx)
|
||||
- [retrieve](../../ShippingOption/methods/js_sdk.admin.ShippingOption.retrieve/page.mdx)
|
||||
- [update](../../ShippingOption/methods/js_sdk.admin.ShippingOption.update/page.mdx)
|
||||
- [updateRules](../../ShippingOption/methods/js_sdk.admin.ShippingOption.updateRules/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ShippingOption/properties/js_sdk.admin.ShippingOption.client/page.mdx)
|
||||
+5
-5
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# ShippingProfile
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ShippingProfile/properties/js_sdk.admin.ShippingProfile.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../ShippingProfile/methods/js_sdk.admin.ShippingProfile.create/page.mdx)
|
||||
- [update](../../ShippingProfile/methods/js_sdk.admin.ShippingProfile.update/page.mdx)
|
||||
- [delete](../../ShippingProfile/methods/js_sdk.admin.ShippingProfile.delete/page.mdx)
|
||||
- [list](../../ShippingProfile/methods/js_sdk.admin.ShippingProfile.list/page.mdx)
|
||||
- [retrieve](../../ShippingProfile/methods/js_sdk.admin.ShippingProfile.retrieve/page.mdx)
|
||||
- [update](../../ShippingProfile/methods/js_sdk.admin.ShippingProfile.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../ShippingProfile/properties/js_sdk.admin.ShippingProfile.client/page.mdx)
|
||||
+9
-9
@@ -2,17 +2,17 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# StockLocation
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../StockLocation/properties/js_sdk.admin.StockLocation.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../StockLocation/methods/js_sdk.admin.StockLocation.create/page.mdx)
|
||||
- [update](../../StockLocation/methods/js_sdk.admin.StockLocation.update/page.mdx)
|
||||
- [delete](../../StockLocation/methods/js_sdk.admin.StockLocation.delete/page.mdx)
|
||||
- [retrieve](../../StockLocation/methods/js_sdk.admin.StockLocation.retrieve/page.mdx)
|
||||
- [list](../../StockLocation/methods/js_sdk.admin.StockLocation.list/page.mdx)
|
||||
- [updateSalesChannels](../../StockLocation/methods/js_sdk.admin.StockLocation.updateSalesChannels/page.mdx)
|
||||
- [createFulfillmentSet](../../StockLocation/methods/js_sdk.admin.StockLocation.createFulfillmentSet/page.mdx)
|
||||
- [delete](../../StockLocation/methods/js_sdk.admin.StockLocation.delete/page.mdx)
|
||||
- [list](../../StockLocation/methods/js_sdk.admin.StockLocation.list/page.mdx)
|
||||
- [retrieve](../../StockLocation/methods/js_sdk.admin.StockLocation.retrieve/page.mdx)
|
||||
- [update](../../StockLocation/methods/js_sdk.admin.StockLocation.update/page.mdx)
|
||||
- [updateFulfillmentProviders](../../StockLocation/methods/js_sdk.admin.StockLocation.updateFulfillmentProviders/page.mdx)
|
||||
- [updateSalesChannels](../../StockLocation/methods/js_sdk.admin.StockLocation.updateSalesChannels/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../StockLocation/properties/js_sdk.admin.StockLocation.client/page.mdx)
|
||||
@@ -2,12 +2,12 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Store
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../Store/methods/js_sdk.admin.Store.list/page.mdx)
|
||||
- [retrieve](../../Store/methods/js_sdk.admin.Store.retrieve/page.mdx)
|
||||
- [update](../../Store/methods/js_sdk.admin.Store.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Store/properties/js_sdk.admin.Store.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [retrieve](../../Store/methods/js_sdk.admin.Store.retrieve/page.mdx)
|
||||
- [list](../../Store/methods/js_sdk.admin.Store.list/page.mdx)
|
||||
- [update](../../Store/methods/js_sdk.admin.Store.update/page.mdx)
|
||||
@@ -2,14 +2,14 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# TaxRate
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../TaxRate/properties/js_sdk.admin.TaxRate.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../TaxRate/methods/js_sdk.admin.TaxRate.create/page.mdx)
|
||||
- [update](../../TaxRate/methods/js_sdk.admin.TaxRate.update/page.mdx)
|
||||
- [delete](../../TaxRate/methods/js_sdk.admin.TaxRate.delete/page.mdx)
|
||||
- [retrieve](../../TaxRate/methods/js_sdk.admin.TaxRate.retrieve/page.mdx)
|
||||
- [list](../../TaxRate/methods/js_sdk.admin.TaxRate.list/page.mdx)
|
||||
- [retrieve](../../TaxRate/methods/js_sdk.admin.TaxRate.retrieve/page.mdx)
|
||||
- [update](../../TaxRate/methods/js_sdk.admin.TaxRate.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../TaxRate/properties/js_sdk.admin.TaxRate.client/page.mdx)
|
||||
@@ -2,13 +2,13 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# TaxRegion
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../TaxRegion/properties/js_sdk.admin.TaxRegion.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../TaxRegion/methods/js_sdk.admin.TaxRegion.create/page.mdx)
|
||||
- [delete](../../TaxRegion/methods/js_sdk.admin.TaxRegion.delete/page.mdx)
|
||||
- [retrieve](../../TaxRegion/methods/js_sdk.admin.TaxRegion.retrieve/page.mdx)
|
||||
- [list](../../TaxRegion/methods/js_sdk.admin.TaxRegion.list/page.mdx)
|
||||
- [retrieve](../../TaxRegion/methods/js_sdk.admin.TaxRegion.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../TaxRegion/properties/js_sdk.admin.TaxRegion.client/page.mdx)
|
||||
@@ -2,12 +2,12 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# Upload
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Upload/properties/js_sdk.admin.Upload.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../Upload/methods/js_sdk.admin.Upload.create/page.mdx)
|
||||
- [retrieve](../../Upload/methods/js_sdk.admin.Upload.retrieve/page.mdx)
|
||||
- [delete](../../Upload/methods/js_sdk.admin.Upload.delete/page.mdx)
|
||||
- [retrieve](../../Upload/methods/js_sdk.admin.Upload.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../Upload/properties/js_sdk.admin.Upload.client/page.mdx)
|
||||
@@ -2,15 +2,15 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# User
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../User/properties/js_sdk.admin.User.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../../User/methods/js_sdk.admin.User.create/page.mdx)
|
||||
- [update](../../User/methods/js_sdk.admin.User.update/page.mdx)
|
||||
- [list](../../User/methods/js_sdk.admin.User.list/page.mdx)
|
||||
- [retrieve](../../User/methods/js_sdk.admin.User.retrieve/page.mdx)
|
||||
- [delete](../../User/methods/js_sdk.admin.User.delete/page.mdx)
|
||||
- [list](../../User/methods/js_sdk.admin.User.list/page.mdx)
|
||||
- [me](../../User/methods/js_sdk.admin.User.me/page.mdx)
|
||||
- [retrieve](../../User/methods/js_sdk.admin.User.retrieve/page.mdx)
|
||||
- [update](../../User/methods/js_sdk.admin.User.update/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../User/properties/js_sdk.admin.User.client/page.mdx)
|
||||
+4
-4
@@ -2,11 +2,11 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
# WorkflowExecution
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../WorkflowExecution/properties/js_sdk.admin.WorkflowExecution.client/page.mdx)
|
||||
|
||||
## Methods
|
||||
|
||||
- [list](../../WorkflowExecution/methods/js_sdk.admin.WorkflowExecution.list/page.mdx)
|
||||
- [retrieve](../../WorkflowExecution/methods/js_sdk.admin.WorkflowExecution.retrieve/page.mdx)
|
||||
|
||||
## Properties
|
||||
|
||||
- [client](../../WorkflowExecution/properties/js_sdk.admin.WorkflowExecution.client/page.mdx)
|
||||
+1
-1
@@ -4,5 +4,5 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
## Properties
|
||||
|
||||
- [stream](../../FetchStreamResponse/properties/js_sdk.admin.FetchStreamResponse.stream/page.mdx)
|
||||
- [abort](../../FetchStreamResponse/properties/js_sdk.admin.FetchStreamResponse.abort/page.mdx)
|
||||
- [stream](../../FetchStreamResponse/properties/js_sdk.admin.FetchStreamResponse.stream/page.mdx)
|
||||
+1
-1
@@ -5,7 +5,7 @@ import { TypeList } from "docs-ui"
|
||||
## Properties
|
||||
|
||||
- [comment](../../ServerSentEventMessage/properties/js_sdk.admin.ServerSentEventMessage.comment/page.mdx)
|
||||
- [event](../../ServerSentEventMessage/properties/js_sdk.admin.ServerSentEventMessage.event/page.mdx)
|
||||
- [data](../../ServerSentEventMessage/properties/js_sdk.admin.ServerSentEventMessage.data/page.mdx)
|
||||
- [event](../../ServerSentEventMessage/properties/js_sdk.admin.ServerSentEventMessage.event/page.mdx)
|
||||
- [id](../../ServerSentEventMessage/properties/js_sdk.admin.ServerSentEventMessage.id/page.mdx)
|
||||
- [retry](../../ServerSentEventMessage/properties/js_sdk.admin.ServerSentEventMessage.retry/page.mdx)
|
||||
Reference in new issue
Block a user