docs: generate inventory and stock location references (#5645)
This commit is contained in:
1
www/apps/docs/content/references/inventory/.nojekyll
Normal file
1
www/apps/docs/content/references/inventory/.nojekyll
Normal file
@@ -0,0 +1 @@
|
||||
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
||||
@@ -0,0 +1,212 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/adjustInventory
|
||||
sidebar_label: adjustInventory
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# adjustInventory - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `adjustInventory` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to adjust the inventory level's stocked quantity. The inventory level is identified by the IDs of its associated inventory item and location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function adjustInventory (
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
adjustment: number
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryLevel = await inventoryModule.adjustInventory(
|
||||
inventoryItemId,
|
||||
locationId,
|
||||
adjustment
|
||||
)
|
||||
|
||||
// do something with the inventory level or return it.
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "adjustment",
|
||||
"type": "`number`",
|
||||
"description": "A positive or negative number used to adjust the inventory level's stocked quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The inventory level's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the incoming stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "the item location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the reserved stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the total stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,119 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/confirmInventory
|
||||
sidebar_label: confirmInventory
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# confirmInventory - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `confirmInventory` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to confirm whether the specified quantity of an inventory item is available in the specified locations.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function confirmInventory (
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
quantity: number
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
return await inventoryModule.confirmInventory(
|
||||
inventoryItemId,
|
||||
locationIds,
|
||||
quantity
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item to check its availability.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationIds",
|
||||
"type": "`string`[]",
|
||||
"description": "The IDs of the locations to check the quantity availability in.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The quantity to check if available for the inventory item in the specified locations.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<boolean>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Whether the specified quantity is available for the inventory item in the specified locations.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "boolean",
|
||||
"type": "`boolean`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,390 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/createInventoryItem
|
||||
sidebar_label: createInventoryItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# createInventoryItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `createInventoryItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to create an inventory item.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function createInventoryItem (item: {
|
||||
sku: string,
|
||||
requires_shipping: boolean
|
||||
}) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryItem = await inventoryModule.createInventoryItem(
|
||||
item
|
||||
)
|
||||
|
||||
// do something with the inventory item or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[CreateInventoryItemInput](../../interfaces/CreateInventoryItemInput.mdx)",
|
||||
"description": "The details of the inventory item to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "description",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The description of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The height of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The HS code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The length of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The material of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The MID code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The origin country of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The SKU of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The thumbnail of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The title of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The weight of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The width of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryItemDTO](../../types/InventoryItemDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created inventory item's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The height of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The inventory item's ID.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The length of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "Whether the item requires shipping.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Stock Keeping Unit (SKU) code of the Inventory Item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Thumbnail for the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Title of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The weight of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The width of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,237 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/createInventoryItems
|
||||
sidebar_label: createInventoryItems
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# createInventoryItems - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `createInventoryItems` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to create inventory items.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function createInventoryItems (items: {
|
||||
sku: string,
|
||||
requires_shipping: boolean
|
||||
}[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryItems = await inventoryModule.createInventoryItems(
|
||||
items
|
||||
)
|
||||
|
||||
// do something with the inventory items or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[CreateInventoryItemInput](../../interfaces/CreateInventoryItemInput.mdx)[]",
|
||||
"description": "The details of the inventory items to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "description",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The description of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The height of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The HS code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The length of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The material of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The MID code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The origin country of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The SKU of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The thumbnail of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The title of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The weight of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The width of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryItemDTO](../../types/InventoryItemDTO.mdx)[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created inventory items' details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryItemDTO[]",
|
||||
"type": "[InventoryItemDTO](../../types/InventoryItemDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,238 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/createInventoryLevel
|
||||
sidebar_label: createInventoryLevel
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# createInventoryLevel - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `createInventoryLevel` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to create inventory level.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function createInventoryLevel (item: {
|
||||
inventory_item_id: string
|
||||
location_id: string
|
||||
stocked_quantity: number
|
||||
}) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryLevel = await inventoryModule.createInventoryLevel(
|
||||
item
|
||||
)
|
||||
|
||||
// do something with the inventory level or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "data",
|
||||
"type": "[CreateInventoryLevelInput](../../interfaces/CreateInventoryLevelInput.mdx)",
|
||||
"description": "The details of the inventory level to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The incoming quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The stocked quantity of the associated inventory item in the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created inventory level's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the incoming stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "the item location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the reserved stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the total stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,157 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/createInventoryLevels
|
||||
sidebar_label: createInventoryLevels
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# createInventoryLevels - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `createInventoryLevels` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to create inventory levels.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function createInventoryLevels (items: {
|
||||
inventory_item_id: string
|
||||
location_id: string
|
||||
stocked_quantity: number
|
||||
}[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryLevels = await inventoryModule.createInventoryLevels(
|
||||
items
|
||||
)
|
||||
|
||||
// do something with the inventory levels or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "data",
|
||||
"type": "[CreateInventoryLevelInput](../../interfaces/CreateInventoryLevelInput.mdx)[]",
|
||||
"description": "The details of the inventory levels to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The incoming quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The stocked quantity of the associated inventory item in the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created inventory levels' details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO[]",
|
||||
"type": "[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,274 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/createReservationItem
|
||||
sidebar_label: createReservationItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# createReservationItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `createReservationItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to create a reservation item.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function createReservationItem (item: {
|
||||
inventory_item_id: string,
|
||||
location_id: string,
|
||||
quantity: number
|
||||
}) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const reservationItem = await inventoryModule.createReservationItems(
|
||||
item
|
||||
)
|
||||
|
||||
// do something with the reservation item or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[CreateReservationItemInput](../../interfaces/CreateReservationItemInput.mdx)",
|
||||
"description": "The details of the reservation item to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string`",
|
||||
"description": "The user or system that created the reservation. Can be any form of identification string.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string`",
|
||||
"description": "The description of the reservation.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "external_id",
|
||||
"type": "`string`",
|
||||
"description": "An ID associated with an external third-party system that the reservation item is connected to.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated line item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[ReservationItemDTO](../../types/ReservationItemDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created reservation item's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "ReservationItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a reservation of an inventory item at a stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "UserId of user who created the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the inventory item the reservation relates to",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the location of the reservation",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,184 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/createReservationItems
|
||||
sidebar_label: createReservationItems
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# createReservationItems - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `createReservationItems` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to create reservation items.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function createReservationItems (items: {
|
||||
inventory_item_id: string,
|
||||
location_id: string,
|
||||
quantity: number
|
||||
}[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const reservationItems = await inventoryModule.createReservationItems(
|
||||
items
|
||||
)
|
||||
|
||||
// do something with the reservation items or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[CreateReservationItemInput](../../interfaces/CreateReservationItemInput.mdx)[]",
|
||||
"description": "The details of the reservation items to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string`",
|
||||
"description": "The user or system that created the reservation. Can be any form of identification string.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string`",
|
||||
"description": "The description of the reservation.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "external_id",
|
||||
"type": "`string`",
|
||||
"description": "An ID associated with an external third-party system that the reservation item is connected to.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated line item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[ReservationItemDTO](../../types/ReservationItemDTO.mdx)[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created reservation items' details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "ReservationItemDTO[]",
|
||||
"type": "[ReservationItemDTO](../../types/ReservationItemDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "ReservationItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a reservation of an inventory item at a stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,88 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/deleteInventoryItem
|
||||
sidebar_label: deleteInventoryItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# deleteInventoryItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteInventoryItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to delete an inventory item or multiple inventory items. The inventory items are only soft deleted and can be restored using the
|
||||
[restoreInventoryItem](IInventoryService.restoreInventoryItem.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function deleteInventoryItem (
|
||||
inventoryItems: string[]
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.deleteInventoryItem(
|
||||
inventoryItems
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The ID(s) of the inventory item(s) to delete.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the inventory item(s) are successfully deleted.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/deleteInventoryItemLevelByLocationId
|
||||
sidebar_label: deleteInventoryItemLevelByLocationId
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# deleteInventoryItemLevelByLocationId - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteInventoryItemLevelByLocationId` method. This belongs to the Inventory Module.
|
||||
|
||||
This method deletes the inventory item level(s) for the ID(s) of associated location(s).
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function deleteInventoryItemLevelByLocationId (
|
||||
locationIds: string[]
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.deleteInventoryItemLevelByLocationId(
|
||||
locationIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "locationId",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The ID(s) of the associated location(s).",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the inventory item level(s) are successfully restored.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,98 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/deleteInventoryLevel
|
||||
sidebar_label: deleteInventoryLevel
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# deleteInventoryLevel - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteInventoryLevel` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to delete an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function deleteInventoryLevel (
|
||||
inventoryItemId: string,
|
||||
locationId: string
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.deleteInventoryLevel(
|
||||
inventoryItemId,
|
||||
locationId
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the inventory level(s) are successfully restored.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/deleteReservationItem
|
||||
sidebar_label: deleteReservationItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# deleteReservationItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteReservationItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to delete a reservation item or multiple reservation items by their IDs.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function deleteReservationItems (
|
||||
reservationItemIds: string[]
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.deleteReservationItem(
|
||||
reservationItemIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "reservationItemId",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The ID(s) of the reservation item(s) to delete.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the reservation item(s) are successfully deleted.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/deleteReservationItemByLocationId
|
||||
sidebar_label: deleteReservationItemByLocationId
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# deleteReservationItemByLocationId - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteReservationItemByLocationId` method. This belongs to the Inventory Module.
|
||||
|
||||
This method deletes reservation item(s) by the ID(s) of associated location(s).
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function deleteReservationItemByLocationId (
|
||||
locationIds: string[]
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.deleteReservationItemByLocationId(
|
||||
locationIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "locationId",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The ID(s) of the associated location(s).",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the reservation item(s) are successfully restored.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/deleteReservationItemsByLineItem
|
||||
sidebar_label: deleteReservationItemsByLineItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# deleteReservationItemsByLineItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `deleteReservationItemsByLineItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to delete the reservation items associated with a line item or multiple line items.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function deleteReservationItemsByLineItem (
|
||||
lineItemIds: string[]
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.deleteReservationItemsByLineItem(
|
||||
lineItemIds
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "lineItemId",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The ID(s) of the line item(s).",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share re9sources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the reservation items are successfully deleted.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,288 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/listInventoryItems
|
||||
sidebar_label: listInventoryItems
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# listInventoryItems - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `listInventoryItems` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve a paginated list of inventory items along with the total count of available inventory items satisfying the provided filters.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of inventory items using their IDs:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryItems (ids: string[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [inventoryItems, count] = await inventoryModule.listInventoryItems({
|
||||
id: ids
|
||||
})
|
||||
|
||||
// do something with the inventory items or return them
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the inventory items:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryItems (ids: string[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [inventoryItems, count] = await inventoryModule.listInventoryItems({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["inventory_level"]
|
||||
})
|
||||
|
||||
// do something with the inventory items or return them
|
||||
}
|
||||
```
|
||||
|
||||
By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryItems (ids: string[], skip: number, take: number) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [inventoryItems, count] = await inventoryModule.listInventoryItems({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["inventory_level"],
|
||||
skip,
|
||||
take
|
||||
})
|
||||
|
||||
// do something with the inventory items or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "selector",
|
||||
"type": "[FilterableInventoryItemProps](../../interfaces/FilterableInventoryItemProps.mdx)",
|
||||
"description": "The filters to apply on the retrieved inventory items.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](../../interfaces/StringComparisonOperator.mdx)",
|
||||
"description": "The HS Codes to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter inventory items by the ID of their associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The origin country to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"type": "`string`",
|
||||
"description": "Search term to search inventory items' attributes.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "Filter inventory items by whether they require shipping.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](../../interfaces/StringComparisonOperator.mdx)",
|
||||
"description": "The SKUs to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[InventoryItemDTO](../../types/InventoryItemDTO.mdx)>",
|
||||
"description": "The configurations determining how the inventory items are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[[InventoryItemDTO](../../types/InventoryItemDTO.mdx)[], number]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The list of inventory items along with the total count.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryItemDTO[]",
|
||||
"type": "[InventoryItemDTO](../../types/InventoryItemDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,270 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/listInventoryLevels
|
||||
sidebar_label: listInventoryLevels
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# listInventoryLevels - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `listInventoryLevels` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve a paginated list of inventory levels along with the total count of available inventory levels satisfying the provided filters.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of inventory levels using their IDs:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryLevels (inventoryItemIds: string[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({
|
||||
inventory_item_id: inventoryItemIds
|
||||
})
|
||||
|
||||
// do something with the inventory levels or return them
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the inventory levels:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryLevels (inventoryItemIds: string[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({
|
||||
inventory_item_id: inventoryItemIds
|
||||
}, {
|
||||
relations: ["inventory_item"]
|
||||
})
|
||||
|
||||
// do something with the inventory levels or return them
|
||||
}
|
||||
```
|
||||
|
||||
By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryLevels (inventoryItemIds: string[], skip: number, take: number) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [inventoryLevels, count] = await inventoryModule.listInventoryLevels({
|
||||
inventory_item_id: inventoryItemIds
|
||||
}, {
|
||||
relations: ["inventory_item"],
|
||||
skip,
|
||||
take
|
||||
})
|
||||
|
||||
// do something with the inventory levels or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "selector",
|
||||
"type": "[FilterableInventoryLevelProps](../../interfaces/FilterableInventoryLevelProps.mdx)",
|
||||
"description": "The filters to apply on the retrieved inventory levels.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](../../interfaces/NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on inventory levels' `incoming_quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter inventory levels by the ID of their associated inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter inventory levels by the ID of their associated inventory location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](../../interfaces/NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on inventory levels' `reserved_quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](../../interfaces/NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on inventory levels' `stocked_quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)>",
|
||||
"description": "The configurations determining how the inventory levels are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a inventory level.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)[], number]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The list of inventory levels along with the total count.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO[]",
|
||||
"type": "[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,288 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/listReservationItems
|
||||
sidebar_label: listReservationItems
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# listReservationItems - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `listReservationItems` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve a paginated list of reservation items along with the total count of available reservation items satisfying the provided filters.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of reservation items using their IDs:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveReservationItems (ids: string[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [reservationItems, count] = await inventoryModule.listReservationItems({
|
||||
id: ids
|
||||
})
|
||||
|
||||
// do something with the reservation items or return them
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the reservation items:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveReservationItems (ids: string[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [reservationItems, count] = await inventoryModule.listReservationItems({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["inventory_item"]
|
||||
})
|
||||
|
||||
// do something with the reservation items or return them
|
||||
}
|
||||
```
|
||||
|
||||
By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveReservationItems (ids: string[], skip: number, take: number) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const [reservationItems, count] = await inventoryModule.listReservationItems({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["inventory_item"],
|
||||
skip,
|
||||
take
|
||||
})
|
||||
|
||||
// do something with the reservation items or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "selector",
|
||||
"type": "[FilterableReservationItemProps](../../interfaces/FilterableReservationItemProps.mdx)",
|
||||
"description": "The filters to apply on the retrieved reservation items.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The \"created by\" values to filter reservation items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| [StringComparisonOperator](../../interfaces/StringComparisonOperator.mdx)",
|
||||
"description": "Description filters to apply on the reservation items' `description` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter reservation items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter reservation items by the ID of their associated inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter reservation items by the ID of their associated line item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter reservation items by the ID of their associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](../../interfaces/NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on the reservation items' `quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[ReservationItemDTO](../../types/ReservationItemDTO.mdx)>",
|
||||
"description": "The configurations determining how the reservation items are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a reservation item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[[ReservationItemDTO](../../types/ReservationItemDTO.mdx)[], number]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The list of reservation items along with the total count.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "ReservationItemDTO[]",
|
||||
"type": "[ReservationItemDTO](../../types/ReservationItemDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,87 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/restoreInventoryItem
|
||||
sidebar_label: restoreInventoryItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# restoreInventoryItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `restoreInventoryItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to restore an inventory item or multiple inventory items that were previously deleted using the [deleteInventoryItem](IInventoryService.deleteInventoryItem.mdx) method.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function restoreInventoryItem (
|
||||
inventoryItems: string[]
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
await inventoryModule.restoreInventoryItem(
|
||||
inventoryItems
|
||||
)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The ID(s) of the inventory item(s) to restore.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the inventory item(s) are successfully restored.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/retrieveAvailableQuantity
|
||||
sidebar_label: retrieveAvailableQuantity
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieveAvailableQuantity - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveAvailableQuantity` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve the available quantity of an inventory item within the specified locations.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveAvailableQuantity (
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const quantity = await inventoryModule.retrieveAvailableQuantity(
|
||||
inventoryItemId,
|
||||
locationIds,
|
||||
)
|
||||
|
||||
// do something with the quantity or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item to retrieve its quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationIds",
|
||||
"type": "`string`[]",
|
||||
"description": "The IDs of the locations to retrieve the available quantity from.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<number>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The available quantity of the inventory item in the specified locations.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,352 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/retrieveInventoryItem
|
||||
sidebar_label: retrieveInventoryItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieveInventoryItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveInventoryItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve an inventory item by its ID
|
||||
|
||||
## Example
|
||||
|
||||
A simple example that retrieves a inventory item by its ID:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryItem (id: string) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryItem = await inventoryModule.retrieveInventoryItem(id)
|
||||
|
||||
// do something with the inventory item or return it
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryItem (id: string) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryItem = await inventoryModule.retrieveInventoryItem(id, {
|
||||
relations: ["inventory_level"]
|
||||
})
|
||||
|
||||
// do something with the inventory item or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item to retrieve.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[InventoryItemDTO](../../types/InventoryItemDTO.mdx)>",
|
||||
"description": "The configurations determining how the inventory item is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryItemDTO](../../types/InventoryItemDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The retrieved inventory item.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The height of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The inventory item's ID.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The length of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "Whether the item requires shipping.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Stock Keeping Unit (SKU) code of the Inventory Item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Thumbnail for the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Title of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The weight of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The width of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,201 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/retrieveInventoryLevel
|
||||
sidebar_label: retrieveInventoryLevel
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieveInventoryLevel - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveInventoryLevel` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve an inventory level for an inventory item and a location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveInventoryLevel (
|
||||
inventoryItemId: string,
|
||||
locationId: string
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryLevel = await inventoryModule.retrieveInventoryLevel(
|
||||
inventoryItemId,
|
||||
locationId
|
||||
)
|
||||
|
||||
// do something with the inventory level or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The retrieved inventory level.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the incoming stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "the item location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the reserved stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the total stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,195 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/retrieveReservationItem
|
||||
sidebar_label: retrieveReservationItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieveReservationItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveReservationItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve a reservation item by its ID.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveReservationItem (id: string) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const reservationItem = await inventoryModule.retrieveReservationItem(id)
|
||||
|
||||
// do something with the reservation item or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "reservationId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the reservation item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[ReservationItemDTO](../../types/ReservationItemDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The retrieved reservation item.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "ReservationItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a reservation of an inventory item at a stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "UserId of user who created the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the inventory item the reservation relates to",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the location of the reservation",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/retrieveReservedQuantity
|
||||
sidebar_label: retrieveReservedQuantity
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieveReservedQuantity - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveReservedQuantity` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve the reserved quantity of an inventory item within the specified locations.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveReservedQuantity (
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const quantity = await inventoryModule.retrieveReservedQuantity(
|
||||
inventoryItemId,
|
||||
locationIds,
|
||||
)
|
||||
|
||||
// do something with the quantity or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item to retrieve its reserved quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationIds",
|
||||
"type": "`string`[]",
|
||||
"description": "The IDs of the locations to retrieve the reserved quantity from.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<number>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The reserved quantity of the inventory item in the specified locations.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,110 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/retrieveStockedQuantity
|
||||
sidebar_label: retrieveStockedQuantity
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieveStockedQuantity - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieveStockedQuantity` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to retrieve the stocked quantity of an inventory item within the specified locations.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function retrieveStockedQuantity (
|
||||
inventoryItemId: string,
|
||||
locationIds: string[],
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const quantity = await inventoryModule.retrieveStockedQuantity(
|
||||
inventoryItemId,
|
||||
locationIds,
|
||||
)
|
||||
|
||||
// do something with the quantity or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item to retrieve its stocked quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationIds",
|
||||
"type": "`string`[]",
|
||||
"description": "The IDs of the locations to retrieve the stocked quantity from.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<number>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The stocked quantity of the inventory item in the specified locations.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,402 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/updateInventoryItem
|
||||
sidebar_label: updateInventoryItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# updateInventoryItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `updateInventoryItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to update an inventory item.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function updateInventoryItem (
|
||||
inventoryItemId: string,
|
||||
sku: string
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryItem = await inventoryModule.updateInventoryItem(
|
||||
inventoryItemId,
|
||||
{
|
||||
sku
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the inventory item or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[Partial](../../types/Partial.mdx)<[CreateInventoryItemInput](../../interfaces/CreateInventoryItemInput.mdx)>",
|
||||
"description": "The attributes to update in the inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "description",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The description of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The height of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The HS code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The length of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The material of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The MID code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The origin country of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The SKU of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The thumbnail of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The title of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The weight of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The width of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryItemDTO](../../types/InventoryItemDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The updated inventory item's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The height of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The inventory item's ID.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The length of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "Whether the item requires shipping.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Stock Keeping Unit (SKU) code of the Inventory Item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Thumbnail for the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Title of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The weight of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The width of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,233 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/updateInventoryLevel
|
||||
sidebar_label: updateInventoryLevel
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# updateInventoryLevel - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `updateInventoryLevel` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to update an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function updateInventoryLevel (
|
||||
inventoryItemId: string,
|
||||
locationId: string,
|
||||
stockedQuantity: number
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryLevel = await inventoryModule.updateInventoryLevels(
|
||||
inventoryItemId,
|
||||
locationId,
|
||||
{
|
||||
stocked_quantity: stockedQuantity
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the inventory level or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "inventoryItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "locationId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "update",
|
||||
"type": "[UpdateInventoryLevelInput](../../interfaces/UpdateInventoryLevelInput.mdx)",
|
||||
"description": "The attributes to update in the location level.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The incoming quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The stocked quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The updated inventory level's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the incoming stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "the item location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the reserved stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the total stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,148 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/updateInventoryLevels
|
||||
sidebar_label: updateInventoryLevels
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# updateInventoryLevels - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `updateInventoryLevels` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to update inventory levels. Each inventory level is identified by the IDs of its associated inventory item and location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function updateInventoryLevels (items: {
|
||||
inventory_item_id: string,
|
||||
location_id: string,
|
||||
stocked_quantity: number
|
||||
}[]) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const inventoryLevels = await inventoryModule.updateInventoryLevels(
|
||||
items
|
||||
)
|
||||
|
||||
// do something with the inventory levels or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "updates",
|
||||
"type": "[BulkUpdateInventoryLevelInput](../../interfaces/BulkUpdateInventoryLevelInput.mdx)[]",
|
||||
"description": "The attributes to update in each inventory level.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory level.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The updated inventory levels' details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO[]",
|
||||
"type": "[InventoryLevelDTO](../../types/InventoryLevelDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "InventoryLevelDTO",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,249 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory/updateReservationItem
|
||||
sidebar_label: updateReservationItem
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# updateReservationItem - Inventory Module Reference
|
||||
|
||||
This documentation provides a reference to the `updateReservationItem` method. This belongs to the Inventory Module.
|
||||
|
||||
This method is used to update a reservation item.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeInventoryModule,
|
||||
} from "@medusajs/inventory"
|
||||
|
||||
async function updateReservationItem (
|
||||
reservationItemId: string,
|
||||
quantity: number
|
||||
) {
|
||||
const inventoryModule = await initializeInventoryModule({})
|
||||
|
||||
const reservationItem = await inventoryModule.updateReservationItem(
|
||||
reservationItemId,
|
||||
{
|
||||
quantity
|
||||
}
|
||||
)
|
||||
|
||||
// do something with the reservation item or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "reservationItemId",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the reservation item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[UpdateReservationItemInput](../../interfaces/UpdateReservationItemInput.mdx)",
|
||||
"description": "The attributes to update in the reservation item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string`",
|
||||
"description": "The description of the reservation item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[ReservationItemDTO](../../types/ReservationItemDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The updated reservation item.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "ReservationItemDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a reservation of an inventory item at a stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "UserId of user who created the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the inventory item the reservation relates to",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the location of the reservation",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
40
www/apps/docs/content/references/inventory/index.md
Normal file
40
www/apps/docs/content/references/inventory/index.md
Normal file
@@ -0,0 +1,40 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Inventory Module Reference Reference
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [BulkUpdateInventoryLevelInput](interfaces/BulkUpdateInventoryLevelInput.mdx)
|
||||
- [CreateInventoryItemInput](interfaces/CreateInventoryItemInput.mdx)
|
||||
- [CreateInventoryLevelInput](interfaces/CreateInventoryLevelInput.mdx)
|
||||
- [CreateReservationItemInput](interfaces/CreateReservationItemInput.mdx)
|
||||
- [FilterableInventoryItemProps](interfaces/FilterableInventoryItemProps.mdx)
|
||||
- [FilterableInventoryLevelProps](interfaces/FilterableInventoryLevelProps.mdx)
|
||||
- [FilterableReservationItemProps](interfaces/FilterableReservationItemProps.mdx)
|
||||
- [FindConfig](interfaces/FindConfig.mdx)
|
||||
- [IInventoryService](interfaces/IInventoryService.mdx)
|
||||
- [JoinerServiceConfig](interfaces/JoinerServiceConfig.mdx)
|
||||
- [JoinerServiceConfigAlias](interfaces/JoinerServiceConfigAlias.mdx)
|
||||
- [NumericalComparisonOperator](interfaces/NumericalComparisonOperator.mdx)
|
||||
- [SharedContext](interfaces/SharedContext.mdx)
|
||||
- [StringComparisonOperator](interfaces/StringComparisonOperator.mdx)
|
||||
- [UpdateInventoryLevelInput](interfaces/UpdateInventoryLevelInput.mdx)
|
||||
- [UpdateReservationItemInput](interfaces/UpdateReservationItemInput.mdx)
|
||||
|
||||
## Type Aliases
|
||||
|
||||
- [Exclude](types/Exclude.mdx)
|
||||
- [InventoryItemDTO](types/InventoryItemDTO.mdx)
|
||||
- [InventoryLevelDTO](types/InventoryLevelDTO.mdx)
|
||||
- [JoinerRelationship](types/JoinerRelationship.mdx)
|
||||
- [ModuleJoinerConfig](types/ModuleJoinerConfig.mdx)
|
||||
- [ModuleJoinerRelationship](types/ModuleJoinerRelationship.mdx)
|
||||
- [Omit](types/Omit.mdx)
|
||||
- [Partial](types/Partial.mdx)
|
||||
- [Pick](types/Pick.mdx)
|
||||
- [Record](types/Record.mdx)
|
||||
- [ReservationItemDTO](types/ReservationItemDTO.mdx)
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# BulkUpdateInventoryLevelInput
|
||||
|
||||
The attributes to update in an inventory level. The inventory level is identified by the IDs of its associated inventory item and location.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory level.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,140 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# CreateInventoryItemInput
|
||||
|
||||
The details of the inventory item to be created.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "description",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The description of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The height of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The HS code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The length of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The material of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The MID code of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The origin country of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The SKU of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The thumbnail of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "``null`` \\| `string`",
|
||||
"description": "The title of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The weight of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "``null`` \\| `number`",
|
||||
"description": "The width of the inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# CreateInventoryLevelInput
|
||||
|
||||
The details of the inventory level to be created.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The incoming quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The stocked quantity of the associated inventory item in the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# CreateReservationItemInput
|
||||
|
||||
The details of the reservation item to be created.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string`",
|
||||
"description": "The user or system that created the reservation. Can be any form of identification string.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string`",
|
||||
"description": "The description of the reservation.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "external_id",
|
||||
"type": "`string`",
|
||||
"description": "An ID associated with an external third-party system that the reservation item is connected to.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated inventory item.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated line item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,77 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# FilterableInventoryItemProps
|
||||
|
||||
The filters to apply on retrieved inventory items.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](StringComparisonOperator.mdx)",
|
||||
"description": "The HS Codes to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter inventory items by the ID of their associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The origin country to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "q",
|
||||
"type": "`string`",
|
||||
"description": "Search term to search inventory items' attributes.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "Filter inventory items by whether they require shipping.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](StringComparisonOperator.mdx)",
|
||||
"description": "The SKUs to filter inventory items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,59 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# FilterableInventoryLevelProps
|
||||
|
||||
The filters to apply on retrieved inventory levels.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on inventory levels' `incoming_quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter inventory levels by the ID of their associated inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter inventory levels by the ID of their associated inventory location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on inventory levels' `reserved_quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on inventory levels' `stocked_quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,77 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# FilterableReservationItemProps
|
||||
|
||||
The filters to apply on retrieved reservation items.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The \"created by\" values to filter reservation items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| [StringComparisonOperator](StringComparisonOperator.mdx)",
|
||||
"description": "Description filters to apply on the reservation items' `description` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter reservation items by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter reservation items by the ID of their associated inventory item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter reservation items by the ID of their associated line item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "Filter reservation items by the ID of their associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number` \\| [NumericalComparisonOperator](NumericalComparisonOperator.mdx)",
|
||||
"description": "Filters to apply on the reservation items' `quantity` attribute.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,93 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# FindConfig
|
||||
|
||||
An object that is used to configure how an entity is retrieved from the database. It accepts as a typed parameter an `Entity` class,
|
||||
which provides correct typing of field names in its properties.
|
||||
|
||||
## Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Entity",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,41 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
slug: /references/inventory
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# IInventoryService Reference
|
||||
|
||||
This section of the documentation provides a reference to the `IInventoryService` interface’s methods. This is the interface developers use to use the functionalities provided by the Inventory Module.
|
||||
|
||||
## Methods
|
||||
|
||||
- [adjustInventory](../IInventoryService/methods/IInventoryService.adjustInventory.mdx)
|
||||
- [confirmInventory](../IInventoryService/methods/IInventoryService.confirmInventory.mdx)
|
||||
- [createInventoryItem](../IInventoryService/methods/IInventoryService.createInventoryItem.mdx)
|
||||
- [createInventoryItems](../IInventoryService/methods/IInventoryService.createInventoryItems.mdx)
|
||||
- [createInventoryLevel](../IInventoryService/methods/IInventoryService.createInventoryLevel.mdx)
|
||||
- [createInventoryLevels](../IInventoryService/methods/IInventoryService.createInventoryLevels.mdx)
|
||||
- [createReservationItem](../IInventoryService/methods/IInventoryService.createReservationItem.mdx)
|
||||
- [createReservationItems](../IInventoryService/methods/IInventoryService.createReservationItems.mdx)
|
||||
- [deleteInventoryItem](../IInventoryService/methods/IInventoryService.deleteInventoryItem.mdx)
|
||||
- [deleteInventoryItemLevelByLocationId](../IInventoryService/methods/IInventoryService.deleteInventoryItemLevelByLocationId.mdx)
|
||||
- [deleteInventoryLevel](../IInventoryService/methods/IInventoryService.deleteInventoryLevel.mdx)
|
||||
- [deleteReservationItem](../IInventoryService/methods/IInventoryService.deleteReservationItem.mdx)
|
||||
- [deleteReservationItemByLocationId](../IInventoryService/methods/IInventoryService.deleteReservationItemByLocationId.mdx)
|
||||
- [deleteReservationItemsByLineItem](../IInventoryService/methods/IInventoryService.deleteReservationItemsByLineItem.mdx)
|
||||
- [listInventoryItems](../IInventoryService/methods/IInventoryService.listInventoryItems.mdx)
|
||||
- [listInventoryLevels](../IInventoryService/methods/IInventoryService.listInventoryLevels.mdx)
|
||||
- [listReservationItems](../IInventoryService/methods/IInventoryService.listReservationItems.mdx)
|
||||
- [restoreInventoryItem](../IInventoryService/methods/IInventoryService.restoreInventoryItem.mdx)
|
||||
- [retrieveAvailableQuantity](../IInventoryService/methods/IInventoryService.retrieveAvailableQuantity.mdx)
|
||||
- [retrieveInventoryItem](../IInventoryService/methods/IInventoryService.retrieveInventoryItem.mdx)
|
||||
- [retrieveInventoryLevel](../IInventoryService/methods/IInventoryService.retrieveInventoryLevel.mdx)
|
||||
- [retrieveReservationItem](../IInventoryService/methods/IInventoryService.retrieveReservationItem.mdx)
|
||||
- [retrieveReservedQuantity](../IInventoryService/methods/IInventoryService.retrieveReservedQuantity.mdx)
|
||||
- [retrieveStockedQuantity](../IInventoryService/methods/IInventoryService.retrieveStockedQuantity.mdx)
|
||||
- [updateInventoryItem](../IInventoryService/methods/IInventoryService.updateInventoryItem.mdx)
|
||||
- [updateInventoryLevel](../IInventoryService/methods/IInventoryService.updateInventoryLevel.mdx)
|
||||
- [updateInventoryLevels](../IInventoryService/methods/IInventoryService.updateInventoryLevels.mdx)
|
||||
- [updateReservationItem](../IInventoryService/methods/IInventoryService.updateReservationItem.mdx)
|
||||
@@ -0,0 +1,240 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# JoinerServiceConfig
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "[JoinerServiceConfigAlias](JoinerServiceConfigAlias.mdx) \\| [JoinerServiceConfigAlias](JoinerServiceConfigAlias.mdx)[]",
|
||||
"description": "Property name to use as entrypoint to the service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "extends",
|
||||
"type": "`{ relationship: [JoinerRelationship](../types/JoinerRelationship.mdx) ; serviceName: string }`[]",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "relationship",
|
||||
"type": "[JoinerRelationship](../types/JoinerRelationship.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "foreignKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inverse",
|
||||
"type": "`boolean`",
|
||||
"description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isInternalService",
|
||||
"type": "`boolean`",
|
||||
"description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isList",
|
||||
"type": "`boolean`",
|
||||
"description": "Force the relationship to return a list",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fieldAlias",
|
||||
"type": "`Record<string, string \\| { forwardArgumentsOnPath: string[] ; path: string }>`",
|
||||
"description": "alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\\_price\\_set.amount' })",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKeys",
|
||||
"type": "`string`[]",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "relationships",
|
||||
"type": "[JoinerRelationship](../types/JoinerRelationship.mdx)[]",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "foreignKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inverse",
|
||||
"type": "`boolean`",
|
||||
"description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isInternalService",
|
||||
"type": "`boolean`",
|
||||
"description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isList",
|
||||
"type": "`boolean`",
|
||||
"description": "Force the relationship to return a list",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# JoinerServiceConfigAlias
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# NumericalComparisonOperator
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "gt",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "gte",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "lt",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "lte",
|
||||
"type": "`number`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# SharedContext
|
||||
|
||||
A shared context object that is used to share resources between the application and the module.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# StringComparisonOperator
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "contains",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "ends_with",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "gt",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "gte",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "lt",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "lte",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "starts_with",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# UpdateInventoryLevelInput
|
||||
|
||||
The attributes to update in an inventory level.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The incoming quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "The stocked quantity of the associated inventory item in the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,50 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# UpdateReservationItemInput
|
||||
|
||||
The attributes to update in a reservation item.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string`",
|
||||
"description": "The description of the reservation item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the associated location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "``null`` \\| `Record<string, unknown>`",
|
||||
"description": "Holds custom data in key-value pairs.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The reserved quantity.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
34
www/apps/docs/content/references/inventory/types/Exclude.mdx
Normal file
34
www/apps/docs/content/references/inventory/types/Exclude.mdx
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Exclude
|
||||
|
||||
**Exclude**`<TypeParameter T, TypeParameter U>`: T extends U ? never : T
|
||||
|
||||
Exclude from T those types that are assignable to U
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "U",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,176 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# InventoryItemDTO
|
||||
|
||||
**InventoryItemDTO**: `Object`
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "height",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The height of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "hs_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Harmonized System code of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The inventory item's ID.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "length",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The length of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "material",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The material and composition that the Inventory Item is made of, May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "mid_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Manufacturers Identification code that identifies the manufacturer of the Inventory Item. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "origin_country",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The country in which the Inventory Item was produced. May be used by Fulfillment Providers to pass customs information to shipping carriers.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "requires_shipping",
|
||||
"type": "`boolean`",
|
||||
"description": "Whether the item requires shipping.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "sku",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "The Stock Keeping Unit (SKU) code of the Inventory Item.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "thumbnail",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Thumbnail for the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "title",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Title of the inventory item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "weight",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The weight of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "width",
|
||||
"type": "`number` \\| ``null``",
|
||||
"description": "The width of the Inventory Item. May be used in shipping rate calculations.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,104 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# InventoryLevelDTO
|
||||
|
||||
**InventoryLevelDTO**: `Object`
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "incoming_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the incoming stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "the item location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "reserved_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the reserved stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "stocked_quantity",
|
||||
"type": "`number`",
|
||||
"description": "the total stock quantity of an inventory item at the given location ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# JoinerRelationship
|
||||
|
||||
**JoinerRelationship**: `Object`
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "foreignKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inverse",
|
||||
"type": "`boolean`",
|
||||
"description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isInternalService",
|
||||
"type": "`boolean`",
|
||||
"description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isList",
|
||||
"type": "`boolean`",
|
||||
"description": "Force the relationship to return a list",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# ModuleJoinerConfig
|
||||
|
||||
**ModuleJoinerConfig**: [Omit](Omit.mdx)<[JoinerServiceConfig](../interfaces/JoinerServiceConfig.mdx), `"serviceName"` \| `"primaryKeys"` \| `"relationships"` \| `"extends"`> & { databaseConfig?: { extraFields?: Record<string, { defaultValue?: string ; nullable?: boolean ; options?: Record<string, unknown> ; type: `"date"` \| `"time"` \| `"datetime"` \| `"bigint"` \| `"blob"` \| `"uint8array"` \| `"array"` \| `"enumArray"` \| `"enum"` \| `"json"` \| `"integer"` \| `"smallint"` \| `"tinyint"` \| `"mediumint"` \| `"float"` \| `"double"` \| `"boolean"` \| `"decimal"` \| `"string"` \| `"uuid"` \| `"text"` }> ; idPrefix?: string ; tableName?: string } ; extends?: { fieldAlias?: Record<string, string \| { forwardArgumentsOnPath: string[] ; path: string }> ; relationship: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx) ; serviceName: string }[] ; isLink?: boolean ; isReadOnlyLink?: boolean ; linkableKeys?: Record<string, string> ; primaryKeys?: string[] ; relationships?: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx)[] ; schema?: string ; serviceName?: string }
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# ModuleJoinerRelationship
|
||||
|
||||
**ModuleJoinerRelationship**: [JoinerRelationship](JoinerRelationship.mdx) & { deleteCascade?: boolean ; isInternalService?: boolean }
|
||||
34
www/apps/docs/content/references/inventory/types/Omit.mdx
Normal file
34
www/apps/docs/content/references/inventory/types/Omit.mdx
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Omit
|
||||
|
||||
**Omit**`<TypeParameter T, TypeParameter K>`: [Pick](Pick.mdx)<T, [Exclude](Exclude.mdx)<keyof T, K>>
|
||||
|
||||
Construct a type with the properties of T except for those in type K.
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "K",
|
||||
"type": "keyof `any`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
25
www/apps/docs/content/references/inventory/types/Partial.mdx
Normal file
25
www/apps/docs/content/references/inventory/types/Partial.mdx
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Partial
|
||||
|
||||
**Partial**`<TypeParameter T>`: { [P in keyof T]?: T[P] }
|
||||
|
||||
Make all properties in T optional
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
34
www/apps/docs/content/references/inventory/types/Pick.mdx
Normal file
34
www/apps/docs/content/references/inventory/types/Pick.mdx
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Pick
|
||||
|
||||
**Pick**`<TypeParameter T, TypeParameter K>`: { [P in K]: T[P] }
|
||||
|
||||
From T, pick a set of properties whose keys are in the union K
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "K",
|
||||
"type": "keyof `T`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
34
www/apps/docs/content/references/inventory/types/Record.mdx
Normal file
34
www/apps/docs/content/references/inventory/types/Record.mdx
Normal file
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Record
|
||||
|
||||
**Record**`<TypeParameter K, TypeParameter T>`: { [P in K]: T }
|
||||
|
||||
Construct a type with a set of properties K of type T
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "K",
|
||||
"type": "keyof `any`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,115 @@
|
||||
---
|
||||
displayed_sidebar: inventoryReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# ReservationItemDTO
|
||||
|
||||
**ReservationItemDTO**: `Object`
|
||||
|
||||
Represents a reservation of an inventory item at a stock location
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_by",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "UserId of user who created the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "description",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Description of the reservation item",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inventory_item_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the inventory item the reservation relates to",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "line_item_id",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "location_id",
|
||||
"type": "`string`",
|
||||
"description": "The id of the location of the reservation",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "quantity",
|
||||
"type": "`number`",
|
||||
"description": "The id of the reservation item",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1 @@
|
||||
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
|
||||
@@ -0,0 +1,207 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location/create
|
||||
sidebar_label: create
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# create - Stock Location Module Reference
|
||||
|
||||
This documentation provides a reference to the `create` method. This belongs to the Stock Location Module.
|
||||
|
||||
This method is used to create a stock location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function createStockLocation (name: string) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocation = await stockLocationModule.create({
|
||||
name
|
||||
})
|
||||
|
||||
// do something with the stock location or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[CreateStockLocationInput](../../types/CreateStockLocationInput.mdx)",
|
||||
"description": "The details of the stock location to create.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address",
|
||||
"type": "`string` \\| [StockLocationAddressInput](../../types/StockLocationAddressInput.mdx)",
|
||||
"description": "Stock location address object",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "The Stock location address ID",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The stock location name",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[StockLocationDTO](../../types/StockLocationDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The created stock location's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "StockLocationDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a Stock Location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address",
|
||||
"type": "[StockLocationAddressDTO](../../types/StockLocationAddressDTO.mdx)",
|
||||
"description": "The Address of the Stock Location",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The stock location's ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The name of the stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,83 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location/delete
|
||||
sidebar_label: delete
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# delete - Stock Location Module Reference
|
||||
|
||||
This documentation provides a reference to the `delete` method. This belongs to the Stock Location Module.
|
||||
|
||||
This method is used to delete a stock location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function deleteStockLocation (id:string) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
await stockLocationModule.delete(id)
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the stock location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<void>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "Resolves when the stock location is successfully deleted.",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,244 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location/list
|
||||
sidebar_label: list
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# list - Stock Location Module Reference
|
||||
|
||||
This documentation provides a reference to the `list` method. This belongs to the Stock Location Module.
|
||||
|
||||
This method is used to retrieve a paginated list of stock locations based on optional filters and configuration.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of stock locations using their IDs:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function listStockLocations (ids: string[]) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocations = await stockLocationModule.list({
|
||||
id: ids
|
||||
})
|
||||
|
||||
// do something with the stock locations or return them
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the stock locations:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function listStockLocations (ids: string[]) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocations = await stockLocationModule.list({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["address"]
|
||||
})
|
||||
|
||||
// do something with the stock locations or return them
|
||||
}
|
||||
```
|
||||
|
||||
By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function listStockLocations (ids: string[], skip: number, take: number) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocations = await stockLocationModule.list({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["address"],
|
||||
skip,
|
||||
take
|
||||
})
|
||||
|
||||
// do something with the stock locations or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "selector",
|
||||
"type": "[FilterableStockLocationProps](../../interfaces/FilterableStockLocationProps.mdx)",
|
||||
"description": "The filters to apply on the retrieved stock locations.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter stock locations by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](../../interfaces/StringComparisonOperator.mdx)",
|
||||
"description": "The names to filter stock locations by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[StockLocationDTO](../../types/StockLocationDTO.mdx)>",
|
||||
"description": "The configurations determining how the stock locations are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a stock location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[StockLocationDTO](../../types/StockLocationDTO.mdx)[]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The list of stock locations.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "StockLocationDTO[]",
|
||||
"type": "[StockLocationDTO](../../types/StockLocationDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "StockLocationDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a Stock Location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,243 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location/listAndCount
|
||||
sidebar_label: listAndCount
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# listAndCount - Stock Location Module Reference
|
||||
|
||||
This documentation provides a reference to the `listAndCount` method. This belongs to the Stock Location Module.
|
||||
|
||||
This method is used to retrieve a paginated list of stock locations along with the total count of available stock locations satisfying the provided filters.
|
||||
|
||||
## Example
|
||||
|
||||
To retrieve a list of stock locations using their IDs:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function listStockLocations (ids: string[]) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const [stockLocations, count] = await stockLocationModule.listAndCount({
|
||||
id: ids
|
||||
})
|
||||
|
||||
// do something with the stock locations or return them
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved within the stock locations:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function listStockLocations (ids: string[]) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const [stockLocations, count] = await stockLocationModule.listAndCount({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["address"]
|
||||
})
|
||||
|
||||
// do something with the stock locations or return them
|
||||
}
|
||||
```
|
||||
|
||||
By default, only the first `10` records are retrieved. You can control pagination by specifying the `skip` and `take` properties of the `config` parameter:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function listStockLocations (ids: string[], skip: number, take: number) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const [stockLocations, count] = await stockLocationModule.listAndCount({
|
||||
id: ids
|
||||
}, {
|
||||
relations: ["address"],
|
||||
skip,
|
||||
take
|
||||
})
|
||||
|
||||
// do something with the stock locations or return them
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "selector",
|
||||
"type": "[FilterableStockLocationProps](../../interfaces/FilterableStockLocationProps.mdx)",
|
||||
"description": "The filters to apply on the retrieved stock locations.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter stock locations by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](../../interfaces/StringComparisonOperator.mdx)",
|
||||
"description": "The names to filter stock locations by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[StockLocationDTO](../../types/StockLocationDTO.mdx)>",
|
||||
"description": "The configurations determining how the stock locations are retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a stock location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[[StockLocationDTO](../../types/StockLocationDTO.mdx)[], number]>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The list of stock locations along with the total count.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "StockLocationDTO[]",
|
||||
"type": "[StockLocationDTO](../../types/StockLocationDTO.mdx)[]",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "number",
|
||||
"type": "`number`",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"description": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,262 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location/retrieve
|
||||
sidebar_label: retrieve
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# retrieve - Stock Location Module Reference
|
||||
|
||||
This documentation provides a reference to the `retrieve` method. This belongs to the Stock Location Module.
|
||||
|
||||
This method is used to retrieve a stock location by its ID
|
||||
|
||||
## Example
|
||||
|
||||
A simple example that retrieves a inventory item by its ID:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function retrieveStockLocation (id: string) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocation = await stockLocationModule.retrieve(id)
|
||||
|
||||
// do something with the stock location or return it
|
||||
}
|
||||
```
|
||||
|
||||
To specify relations that should be retrieved:
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function retrieveStockLocation (id: string) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocation = await stockLocationModule.retrieve(id, {
|
||||
relations: ["address"]
|
||||
})
|
||||
|
||||
// do something with the stock location or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "config",
|
||||
"type": "[FindConfig](../../interfaces/FindConfig.mdx)<[StockLocationDTO](../../types/StockLocationDTO.mdx)>",
|
||||
"description": "The configurations determining how the stock location is retrieved. Its properties, such as `select` or `relations`, accept the attributes or relations associated with a stock location.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[StockLocationDTO](../../types/StockLocationDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The stock location's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "StockLocationDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a Stock Location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address",
|
||||
"type": "[StockLocationAddressDTO](../../types/StockLocationAddressDTO.mdx)",
|
||||
"description": "The Address of the Stock Location",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The stock location's ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The name of the stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,289 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location/update
|
||||
sidebar_label: update
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# update - Stock Location Module Reference
|
||||
|
||||
This documentation provides a reference to the `update` method. This belongs to the Stock Location Module.
|
||||
|
||||
This method is used to update a stock location.
|
||||
|
||||
## Example
|
||||
|
||||
```ts
|
||||
import {
|
||||
initialize as initializeStockLocationModule,
|
||||
} from "@medusajs/stock-location"
|
||||
|
||||
async function updateStockLocation (id:string, name: string) {
|
||||
const stockLocationModule = await initializeStockLocationModule({})
|
||||
|
||||
const stockLocation = await stockLocationModule.update(id, {
|
||||
name
|
||||
})
|
||||
|
||||
// do something with the stock location or return it
|
||||
}
|
||||
```
|
||||
|
||||
## Parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The ID of the stock location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "input",
|
||||
"type": "[UpdateStockLocationInput](../../types/UpdateStockLocationInput.mdx)",
|
||||
"description": "The attributes to update in the stock location.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address",
|
||||
"type": "[StockLocationAddressInput](../../types/StockLocationAddressInput.mdx)",
|
||||
"description": "Stock location address object",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address_1",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_2",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' complement",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "city",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' city",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "country_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' country",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "phone",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' phone number",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "postal_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' postal code",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "province",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' province",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "The Stock location address ID",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The stock location name",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "context",
|
||||
"type": "[SharedContext](../../interfaces/SharedContext.mdx)",
|
||||
"description": "A context used to share resources, such as transaction manager, between the application and the module.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
|
||||
## Returns
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Promise",
|
||||
"type": "Promise<[StockLocationDTO](../../types/StockLocationDTO.mdx)>",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"description": "The stock location's details.",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "StockLocationDTO",
|
||||
"type": "`object`",
|
||||
"description": "Represents a Stock Location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address",
|
||||
"type": "[StockLocationAddressDTO](../../types/StockLocationAddressDTO.mdx)",
|
||||
"description": "The Address of the Stock Location",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The stock location's ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The name of the stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]} />
|
||||
32
www/apps/docs/content/references/stock-location/index.md
Normal file
32
www/apps/docs/content/references/stock-location/index.md
Normal file
@@ -0,0 +1,32 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Stock Location Module Reference Reference
|
||||
|
||||
## Interfaces
|
||||
|
||||
- [FilterableStockLocationProps](interfaces/FilterableStockLocationProps.mdx)
|
||||
- [FindConfig](interfaces/FindConfig.mdx)
|
||||
- [IStockLocationService](interfaces/IStockLocationService.mdx)
|
||||
- [JoinerServiceConfig](interfaces/JoinerServiceConfig.mdx)
|
||||
- [JoinerServiceConfigAlias](interfaces/JoinerServiceConfigAlias.mdx)
|
||||
- [SharedContext](interfaces/SharedContext.mdx)
|
||||
- [StringComparisonOperator](interfaces/StringComparisonOperator.mdx)
|
||||
|
||||
## Type Aliases
|
||||
|
||||
- [CreateStockLocationInput](types/CreateStockLocationInput.mdx)
|
||||
- [Exclude](types/Exclude.mdx)
|
||||
- [JoinerRelationship](types/JoinerRelationship.mdx)
|
||||
- [ModuleJoinerConfig](types/ModuleJoinerConfig.mdx)
|
||||
- [ModuleJoinerRelationship](types/ModuleJoinerRelationship.mdx)
|
||||
- [Omit](types/Omit.mdx)
|
||||
- [Pick](types/Pick.mdx)
|
||||
- [Record](types/Record.mdx)
|
||||
- [StockLocationAddressDTO](types/StockLocationAddressDTO.mdx)
|
||||
- [StockLocationAddressInput](types/StockLocationAddressInput.mdx)
|
||||
- [StockLocationDTO](types/StockLocationDTO.mdx)
|
||||
- [UpdateStockLocationInput](types/UpdateStockLocationInput.mdx)
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# FilterableStockLocationProps
|
||||
|
||||
The filters to apply on the retrieved stock locations.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "The IDs to filter stock locations by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string` \\| `string`[] \\| [StringComparisonOperator](StringComparisonOperator.mdx)",
|
||||
"description": "The names to filter stock locations by.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,93 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# FindConfig
|
||||
|
||||
An object that is used to configure how an entity is retrieved from the database. It accepts as a typed parameter an `Entity` class,
|
||||
which provides correct typing of field names in its properties.
|
||||
|
||||
## Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "Entity",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "order",
|
||||
"type": "`object`",
|
||||
"description": "An object used to specify how to sort the returned records. Its keys are the names of attributes of the entity, and a key's value can either be `ASC` to sort retrieved records in an ascending order, or `DESC` to sort retrieved records in a descending order.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "__type",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "relations",
|
||||
"type": "`string`[]",
|
||||
"description": "An array of strings, each being relation names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "select",
|
||||
"type": "(`string` \\| keyof `Entity`)[]",
|
||||
"description": "An array of strings, each being attribute names of the entity to retrieve in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "skip",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to skip before retrieving the results.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "take",
|
||||
"type": "`number`",
|
||||
"description": "A number indicating the number of records to return in the result.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "withDeleted",
|
||||
"type": "`boolean`",
|
||||
"description": "A boolean indicating whether deleted records should also be retrieved as part of the result. This only works if the entity extends the `SoftDeletableEntity` class.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,19 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
slug: /references/stock-location
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# IStockLocationService Reference
|
||||
|
||||
This section of the documentation provides a reference to the `IStockLocationService` interface’s methods. This is the interface developers use to use the functionalities provided by the Stock Location Module.
|
||||
|
||||
## Methods
|
||||
|
||||
- [create](../IStockLocationService/methods/IStockLocationService.create.mdx)
|
||||
- [delete](../IStockLocationService/methods/IStockLocationService.delete.mdx)
|
||||
- [list](../IStockLocationService/methods/IStockLocationService.list.mdx)
|
||||
- [listAndCount](../IStockLocationService/methods/IStockLocationService.listAndCount.mdx)
|
||||
- [retrieve](../IStockLocationService/methods/IStockLocationService.retrieve.mdx)
|
||||
- [update](../IStockLocationService/methods/IStockLocationService.update.mdx)
|
||||
@@ -0,0 +1,240 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# JoinerServiceConfig
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "[JoinerServiceConfigAlias](JoinerServiceConfigAlias.mdx) \\| [JoinerServiceConfigAlias](JoinerServiceConfigAlias.mdx)[]",
|
||||
"description": "Property name to use as entrypoint to the service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "extends",
|
||||
"type": "`{ relationship: [JoinerRelationship](../types/JoinerRelationship.mdx) ; serviceName: string }`[]",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "relationship",
|
||||
"type": "[JoinerRelationship](../types/JoinerRelationship.mdx)",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "foreignKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inverse",
|
||||
"type": "`boolean`",
|
||||
"description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isInternalService",
|
||||
"type": "`boolean`",
|
||||
"description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isList",
|
||||
"type": "`boolean`",
|
||||
"description": "Force the relationship to return a list",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "fieldAlias",
|
||||
"type": "`Record<string, string \\| { forwardArgumentsOnPath: string[] ; path: string }>`",
|
||||
"description": "alias for deeper nested relationships (e.g. { 'price': 'prices.calculated\\_price\\_set.amount' })",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKeys",
|
||||
"type": "`string`[]",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "relationships",
|
||||
"type": "[JoinerRelationship](../types/JoinerRelationship.mdx)[]",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "foreignKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inverse",
|
||||
"type": "`boolean`",
|
||||
"description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isInternalService",
|
||||
"type": "`boolean`",
|
||||
"description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isList",
|
||||
"type": "`boolean`",
|
||||
"description": "Force the relationship to return a list",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,30 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# JoinerServiceConfigAlias
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string` \\| `string`[]",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,32 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# SharedContext
|
||||
|
||||
A shared context object that is used to share resources between the application and the module.
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "manager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of an entity manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "transactionManager",
|
||||
"type": "EntityManager",
|
||||
"description": "An instance of a transaction manager.",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,75 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# StringComparisonOperator
|
||||
|
||||
## Properties
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "contains",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "ends_with",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "gt",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "gte",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "lt",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "lte",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "starts_with",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,52 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# CreateStockLocationInput
|
||||
|
||||
**CreateStockLocationInput**: `Object`
|
||||
|
||||
Represents the Input to create a Stock Location
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "address",
|
||||
"type": "`string` \\| [StockLocationAddressInput](StockLocationAddressInput.mdx)",
|
||||
"description": "Stock location address object",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "The Stock location address ID",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The stock location name",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Exclude
|
||||
|
||||
**Exclude**`<TypeParameter T, TypeParameter U>`: T extends U ? never : T
|
||||
|
||||
Exclude from T those types that are assignable to U
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "U",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,86 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# JoinerRelationship
|
||||
|
||||
**JoinerRelationship**: `Object`
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "alias",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "args",
|
||||
"type": "`Record<string, any>`",
|
||||
"description": "Extra arguments to pass to the remoteFetchData callback",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "foreignKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "inverse",
|
||||
"type": "`boolean`",
|
||||
"description": "In an inverted relationship the foreign key is on the other service and the primary key is on the current service",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isInternalService",
|
||||
"type": "`boolean`",
|
||||
"description": "If true, the relationship is an internal service from the medusa core TODO: Remove when there are no more \"internal\" services",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "isList",
|
||||
"type": "`boolean`",
|
||||
"description": "Force the relationship to return a list",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "primaryKey",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "serviceName",
|
||||
"type": "`string`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# ModuleJoinerConfig
|
||||
|
||||
**ModuleJoinerConfig**: [Omit](Omit.mdx)<[JoinerServiceConfig](../interfaces/JoinerServiceConfig.mdx), `"serviceName"` \| `"primaryKeys"` \| `"relationships"` \| `"extends"`> & { databaseConfig?: { extraFields?: Record<string, { defaultValue?: string ; nullable?: boolean ; options?: Record<string, unknown> ; type: `"date"` \| `"time"` \| `"datetime"` \| `"bigint"` \| `"blob"` \| `"uint8array"` \| `"array"` \| `"enumArray"` \| `"enum"` \| `"json"` \| `"integer"` \| `"smallint"` \| `"tinyint"` \| `"mediumint"` \| `"float"` \| `"double"` \| `"boolean"` \| `"decimal"` \| `"string"` \| `"uuid"` \| `"text"` }> ; idPrefix?: string ; tableName?: string } ; extends?: { fieldAlias?: Record<string, string \| { forwardArgumentsOnPath: string[] ; path: string }> ; relationship: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx) ; serviceName: string }[] ; isLink?: boolean ; isReadOnlyLink?: boolean ; linkableKeys?: Record<string, string> ; primaryKeys?: string[] ; relationships?: [ModuleJoinerRelationship](ModuleJoinerRelationship.mdx)[] ; schema?: string ; serviceName?: string }
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# ModuleJoinerRelationship
|
||||
|
||||
**ModuleJoinerRelationship**: [JoinerRelationship](JoinerRelationship.mdx) & { deleteCascade?: boolean ; isInternalService?: boolean }
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Omit
|
||||
|
||||
**Omit**`<TypeParameter T, TypeParameter K>`: [Pick](Pick.mdx)<T, [Exclude](Exclude.mdx)<keyof T, K>>
|
||||
|
||||
Construct a type with the properties of T except for those in type K.
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "K",
|
||||
"type": "keyof `any`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Pick
|
||||
|
||||
**Pick**`<TypeParameter T, TypeParameter K>`: { [P in K]: T[P] }
|
||||
|
||||
From T, pick a set of properties whose keys are in the union K
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "K",
|
||||
"type": "keyof `T`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,34 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# Record
|
||||
|
||||
**Record**`<TypeParameter K, TypeParameter T>`: { [P in K]: T }
|
||||
|
||||
Construct a type with a set of properties K of type T
|
||||
|
||||
### Type parameters
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "K",
|
||||
"type": "keyof `any`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "T",
|
||||
"type": "`object`",
|
||||
"description": "",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,133 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# StockLocationAddressDTO
|
||||
|
||||
**StockLocationAddressDTO**: `Object`
|
||||
|
||||
Represents a Stock Location Address
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "address_1",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_2",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' complement",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "city",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' city",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "company",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location company' name",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "country_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' country",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The stock location address' ID",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "phone",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' phone number",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "postal_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' postal code",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "province",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' province",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,88 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# StockLocationAddressInput
|
||||
|
||||
**StockLocationAddressInput**: `Object`
|
||||
|
||||
Represents a Stock Location Address Input
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "address_1",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_2",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' complement",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "city",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' city",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "country_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' country",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "phone",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' phone number",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "postal_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' postal code",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "province",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' province",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,206 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# StockLocationDTO
|
||||
|
||||
**StockLocationDTO**: `Object`
|
||||
|
||||
Represents a Stock Location
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "address",
|
||||
"type": "[StockLocationAddressDTO](StockLocationAddressDTO.mdx)",
|
||||
"description": "The Address of the Stock Location",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address_1",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_2",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' complement",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "city",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' city",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "company",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location company' name",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "country_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' country",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The stock location address' ID",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "phone",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' phone number",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "postal_code",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' postal code",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "province",
|
||||
"type": "`string` \\| ``null``",
|
||||
"description": "Stock location address' province",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "created_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was created.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "deleted_at",
|
||||
"type": "`string` \\| `Date` \\| ``null``",
|
||||
"description": "The date with timezone at which the resource was deleted.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "id",
|
||||
"type": "`string`",
|
||||
"description": "The stock location's ID",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>` \\| ``null``",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The name of the stock location",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "updated_at",
|
||||
"type": "`string` \\| `Date`",
|
||||
"description": "The date with timezone at which the resource was updated.",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
@@ -0,0 +1,125 @@
|
||||
---
|
||||
displayed_sidebar: stockLocationReference
|
||||
---
|
||||
|
||||
import ParameterTypes from "@site/src/components/ParameterTypes"
|
||||
|
||||
# UpdateStockLocationInput
|
||||
|
||||
**UpdateStockLocationInput**: `Object`
|
||||
|
||||
Represents the Input to update a Stock Location
|
||||
|
||||
### Type declaration
|
||||
|
||||
<ParameterTypes parameters={[
|
||||
{
|
||||
"name": "address",
|
||||
"type": "[StockLocationAddressInput](StockLocationAddressInput.mdx)",
|
||||
"description": "Stock location address object",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": [
|
||||
{
|
||||
"name": "address_1",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "address_2",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' complement",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "city",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' city",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "country_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' country",
|
||||
"optional": false,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "phone",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' phone number",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "postal_code",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' postal code",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "province",
|
||||
"type": "`string`",
|
||||
"description": "Stock location address' province",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "address_id",
|
||||
"type": "`string`",
|
||||
"description": "The Stock location address ID",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "metadata",
|
||||
"type": "`Record<string, unknown>`",
|
||||
"description": "An optional key-value map with additional details",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"name": "name",
|
||||
"type": "`string`",
|
||||
"description": "The stock location name",
|
||||
"optional": true,
|
||||
"defaultValue": "",
|
||||
"expandable": false,
|
||||
"children": []
|
||||
}
|
||||
]} />
|
||||
Reference in New Issue
Block a user