chore(docs): Generated References (automated) (#13544)
Generated the following references: - `api_key_models` - `auth_models` - `cart_models` - `core_flows` - `currency_models` - `customer_models` - `fulfillment_models` - `inventory_next_models` - `js_sdk` - `modules` - `order` - `order_models` - `payment_models` - `pricing_models` - `product_models` - `promotion_models` - `region_models` - `sales_channel_models` - `stock_location_next_models` - `store_models` - `tax_models` - `types` - `user_models` Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <27354907+shahednasser@users.noreply.github.com>
This commit is contained in:
528 files changed
+249559
-245963
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -12055,6 +12055,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.user/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.user"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.workflowExecution/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.workflowExecution"
|
||||
|
||||
@@ -740,6 +740,15 @@ const generatedgeneratedToolsSidebarSidebar = {
|
||||
"description": "",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"type": "link",
|
||||
"path": "/references/js-sdk/admin/views",
|
||||
"title": "views",
|
||||
"description": "",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
|
||||
@@ -4914,6 +4914,11 @@ export const slugChanges = [
|
||||
"newSlug": "/references/js-sdk/admin/user",
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.user/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views",
|
||||
"newSlug": "/references/js-sdk/admin/views",
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.views/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/js_sdk/admin/Admin/properties/js_sdk.admin.Admin.workflowExecution",
|
||||
"newSlug": "/references/js-sdk/admin/workflowExecution",
|
||||
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the ApiKey data model. It belongs to the API Key Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/api-key/src/models/api-key.ts#L3" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/api-key/src/models/api-key.ts#L3" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the API key.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"token","type":"`TextProperty`","description":"The token of the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"salt","type":"`TextProperty`","description":"Salt used to create the API key token.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"redacted","type":"`TextProperty`","description":"The redacted form of the api key's token. this is useful when showing portion of the token.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"type","type":"EnumProperty<[\"publishable\", \"secret\"]>","description":"The type of the API key. Can be `secret` or `publishable`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_by","type":"`TextProperty`","description":"The ID of the user that created the API key","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"last_used_at","type":"`DateTimeProperty`","description":"The date the API key was last used.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_by","type":"`TextProperty`","description":"The ID of the user that revoked the API key","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"revoked_at","type":"`DateTimeProperty`","description":"The date the API key was revoked.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ApiKey"/>
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the AuthIdentity data model. It belongs to the Auth Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/auth/src/models/auth-identity.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/auth/src/models/auth-identity.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany<[ProviderIdentity](../auth_models.ProviderIdentity/page.mdx)>","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo<[AuthIdentity](./page.mdx)>","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany<[ProviderIdentity](../auth_models.ProviderIdentity/page.mdx)>","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="AuthIdentity"/>
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the ProviderIdentity data model. It belongs to the Auth Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/auth/src/models/provider-identity.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/auth/src/models/provider-identity.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo<[AuthIdentity](../auth_models.AuthIdentity/page.mdx)>","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the auth identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_identities","type":"HasMany<[ProviderIdentity](./page.mdx)>","description":"The associated `ProviderIdentity` records.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the provider identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"entity_id","type":"`TextProperty`","description":"The entity ID of the provider identity","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider","type":"`TextProperty`","description":"The ID of the provider that created this identity.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"auth_identity","type":"BelongsTo<[AuthIdentity](../auth_models.AuthIdentity/page.mdx)>","description":"The associated `AuthIdentity`.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"app_metadata","type":"`JSONProperty`","description":"The app metadata of the auth identity","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"user_metadata","type":"`JSONProperty`","description":"The user metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_metadata","type":"`JSONProperty`","description":"The provider metadata of the provider identity.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="ProviderIdentity"/>
|
||||
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the Address data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/address.ts#L3" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/address.ts#L3" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the customer that the address belongs to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"company","type":"`TextProperty`","description":"The company of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"first_name","type":"`TextProperty`","description":"The first name of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"last_name","type":"`TextProperty`","description":"The last name of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_1","type":"`TextProperty`","description":"The first line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"address_2","type":"`TextProperty`","description":"The second line of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"city","type":"`TextProperty`","description":"The city of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"country_code","type":"`TextProperty`","description":"The ISO 2 country code of the address. For example, `us`.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"province","type":"`TextProperty`","description":"The province of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"postal_code","type":"`TextProperty`","description":"The postal code of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"phone","type":"`TextProperty`","description":"The phone of the address","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" sectionTitle="Address"/>
|
||||
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the Cart data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/cart.ts#L7" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/cart.ts#L7" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of promotion that applied the adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`TextProperty`","description":"The ID of the external provider that the adjustment is related to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"`TextProperty`","description":"The ID of the applied promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"HasMany<[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item tax line","optional":true,"defaultValue":"","expandableLine truncated
|
||||
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the CreditLine data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/credit-line.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/credit-line.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the credit line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"tax_lines","type":"HasMany<[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"subtitle","type":"`TextProperty`","description":"The subtitle of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`TextProperty`","description":"The thumbnail URL of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`TextProperty`","description":"The ID of the variant added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`TextProperty`","description":"The ID of the product added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"`TextProperty`","description":"The title of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"`TextProperty`","description":"The description of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"`TextProperty`","description":"The subtitle of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"`TextProperty`","description":"The type of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type_id","type":"`TextProperty`","description":"The ID of the type of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_collection","type":"`TextProperty`","description":"The collection of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_handle","type":"`TextProperty`","description":"The unique handle of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_sku","tLine truncated
|
||||
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the LineItem data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/line-item.ts#L6" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/line-item.ts#L6" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](./page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"tax_lines","type":"HasMany<[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"subtitle","type":"`TextProperty`","description":"The subtitle of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`TextProperty`","description":"The thumbnail URL of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name"Line truncated
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the LineItemAdjustment data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/line-item-adjustment.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/line-item-adjustment.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](./page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of promotion that applied the adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`TextProperty`","description":"The ID of the external provider that the adjustment is related to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"`TextProperty`","description":"The ID of the applied promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"HasMany<[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,Line truncated
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the LineItemTaxLine data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/line-item-tax-line.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/line-item-tax-line.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the line item adjustment","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item adjustment is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the line item adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of promotion that applied the adjustment","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`TextProperty`","description":"The ID of the external provider that the adjustment is related to.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promotion_id","type":"`TextProperty`","description":"The ID of the applied promotion.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"tax_lines","type":"HasMany<[LineItemTaxLine](./page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"BelongsTo<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated line item.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","typeLine truncated
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the ShippingMethod data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/shipping-method.ts#L6" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/shipping-method.ts#L6" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`TextProperty`","description":"The name of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the shipping method's amount is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`TextProperty`","description":"The title of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"quantity","type":"`NumberProperty`","description":"The quantity of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`BooleanProperty`","description":"Whether the line item requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`BooleanProperty`","description":"Whether the line item is discountable.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`BooleanProperty`","description":"Whether the line item is a giftcard.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the line item's price is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_custom_price","type":"`BooleanProperty`","description":"Whether the line item's price is custom.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"`BigNumberProperty`","description":"The unit price of the line item","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"adjustments","type":"HasMany<[LineItemAdjustment](../cart_models.LineItemAdjustment/page.mdx)>","description":"The associated adjustments.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"tax_lines","type":"HasMany<[LineItemTaxLine](../cart_models.LineItemTaxLine/page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"subtitle","type":"`TextProperty`","description":"The subtitle of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`TextProperty`","description":"The thumbnail URL of the line item","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`TextProperty`","description":"The ID of the variant added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`TextProperty`","description":"The ID of the product added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"`TextProperty`","description":"The title of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"`TextProperty`","description":"The description of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"`TextProperty`","description":"The subtitle of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"`TextProperty`","description":"The type of the line item's product","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type_id","type":"`TextProLine truncated
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the ShippingMethodAdjustment data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/shipping-method-adjustment.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/shipping-method-adjustment.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method adjustment.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The shipping method adjustment's amount","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo<[ShippingMethod](../cart_models.ShippingMethod/page.mdx)>","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`TextProperty`","description":"The name of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the shipping method's amount is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"credit_lines","type":"HasMany<[CreditLine](../cart_models.CreditLine/page.mdx)>","description":"The associated credit\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"shipping_methods","type":"HasMany<[ShippingMethod](../cart_models.ShippingMethod/page.mdx)>","description":"The associated shipping\\_methods.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"region_id","type":"`TextProperty`","description":"The ID of the cart's region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`TextProperty`","description":"The ID of the cart's sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`TextProperty`","description":"The email of the cart's customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"completed_at","type":"`DateTimeProperty`","description":"The date the cart was completed.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"HasOneWithForeignKey<[Address](../cart_models.Address/page.mdx)>","description":"The associated shipping\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"billing_address","type":"HasOneWithForeignKey<[Address](../cart_models.Address/page.mdx)>","description":"The associated billing\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"tax_lines","type":"HasMany<[ShippingMethodTaxLine](../cart_models.ShippingMethodTaxLine/page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo<[ShippingMethod](../cart_models.ShippingMethod/page.mdx)>","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextProperty`","description":"The description of the shipping method tax line","optional":true,"defaultValue":"","Line truncated
|
||||
+1
-1
@@ -10,6 +10,6 @@ import { TypeList } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the ShippingMethodTaxLine data model. It belongs to the Cart Module.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/ed0dafb24c10a68d27745d9f4268e622f4d9912c/packages/modules/cart/src/models/shipping-method-tax-line.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/modules/cart/src/models/shipping-method-tax-line.ts#L4" />
|
||||
|
||||
<TypeList types={[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo<[ShippingMethod](../cart_models.ShippingMethod/page.mdx)>","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`TextProperty`","description":"The name of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"amount","type":"`BigNumberProperty`","description":"The amount of the shipping method","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`BooleanProperty`","description":"Whether the shipping method's amount is tax inclusive.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"BelongsTo<[Cart](../cart_models.Cart/page.mdx)>","description":"The associated cart.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`TextProperty`","description":"The ISO 3 currency code of the cart, such as `usd`.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"HasMany<[LineItem](../cart_models.LineItem/page.mdx)>","description":"The associated items.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"credit_lines","type":"HasMany<[CreditLine](../cart_models.CreditLine/page.mdx)>","description":"The associated credit\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"shipping_methods","type":"HasMany<[ShippingMethod](../cart_models.ShippingMethod/page.mdx)>","description":"The associated shipping\\_methods.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"region_id","type":"`TextProperty`","description":"The ID of the cart's region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`TextProperty`","description":"The ID of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`TextProperty`","description":"The ID of the cart's sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`TextProperty`","description":"The email of the cart's customer","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`JSONProperty`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"completed_at","type":"`DateTimeProperty`","description":"The date the cart was completed.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"HasOneWithForeignKey<[Address](../cart_models.Address/page.mdx)>","description":"The associated shipping\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]},{"name":"billing_address","type":"HasOneWithForeignKey<[Address](../cart_models.Address/page.mdx)>","description":"The associated billing\\_address.","optional":true,"defaultValue":"","expandable":true,"children":[]}]},{"name":"tax_lines","type":"HasMany<[ShippingMethodTaxLine](./page.mdx)>","description":"The associated tax\\_lines.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"PrimaryKeyModifier<IdProperty>","description":"The ID of the shipping method tax line.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"code","type":"`TextProperty`","description":"The code of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"rate","type":"`FloatProperty`","description":"The rate of the applied tax rate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_method","type":"BelongsTo<[ShippingMethod](../cart_models.ShippingMethod/page.mdx)>","description":"The associated shipping\\_method.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"description","type":"`TextPLine truncated
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow creates one or more API keys, which can be secret or publishable.
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
create API keys within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts#L51" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts#L51" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ This workflow deletes one or more secret or publishable API keys. It's used by t
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
delete API keys within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts#L36" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts#L36" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ This workflow manages the sales channels of a publishable API key. It's used by
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
manage the sales channels of a publishable API key within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts#L39" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts#L39" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ This workflow is used by the [Revoke API Key API Route](https://docs.medusajs.co
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
revoke API keys within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts#L59" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow updates one or more secret or publishable API keys. It's used by t
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
update API keys within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ how to handle this event.
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
generate reset password tokens within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createCartsStep({
|
||||
"currency_code": "pab"
|
||||
"currency_code": "btn"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = retrieveCartStep({
|
||||
"id": "id_09O9ypq1i8"
|
||||
"id": "id_SMZKOoxX4DQCNz"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = updateCartPromotionsStep({
|
||||
"id": "id_WiXLgsrkmb9"
|
||||
"id": "id_6jnLnQI2YKKcxm"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-2
@@ -2,7 +2,6 @@
|
||||
slug: /references/medusa-workflows/steps/validateCartShippingOptionsStep
|
||||
sidebar_label: validateCartShippingOptionsStep
|
||||
tags:
|
||||
- fulfillment
|
||||
- step
|
||||
---
|
||||
|
||||
@@ -29,4 +28,4 @@ const data = validateCartShippingOptionsStep({
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"ValidateCartShippingOptionsStepInput","type":"[ValidateCartShippingOptionsStepInput](../../../../interfaces/core_flows.ValidateCartShippingOptionsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the cart and its shipping options context.","expandable":false,"children":[{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"The cart to validate shipping options for.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultVaLine truncated
|
||||
<TypeList types={[{"name":"ValidateCartShippingOptionsStepInput","type":"[ValidateCartShippingOptionsStepInput](../../../../interfaces/core_flows.ValidateCartShippingOptionsStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the cart and its shipping options context.","expandable":false,"children":[{"name":"option_ids","type":"`string`[]","description":"The IDs of the shipping options to validate.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"The cart to validate shipping options for.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency of the cart","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"original_item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"numeric","type":"`number`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"bigNumber","type":"`BigNumber`","description":"","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"oriLine truncated
|
||||
+5
-5
@@ -3,12 +3,12 @@ slug: /references/medusa-workflows/addShippingMethodToCartWorkflow
|
||||
sidebar_label: addShippingMethodToCartWorkflow
|
||||
sidebar_description: Add a shipping method to a cart.
|
||||
tags:
|
||||
- locking
|
||||
- remote query
|
||||
- fulfillment
|
||||
- cart
|
||||
- event bus
|
||||
- workflow
|
||||
- locking
|
||||
- query
|
||||
- pricing
|
||||
- tax
|
||||
@@ -29,7 +29,7 @@ This workflow adds a shipping method to a cart. It's executed by the
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding a shipping method to the cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L81" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L83" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -178,11 +178,11 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"addShippingMethodToCartWorkflow","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1},{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":2},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":3},{"type":"step","name":"validateCartShippingOptionsStep","description":"This step validates shipping options to ensure they can be applied on a cart.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartShippingOptionsStep/page.mdx","depth":4},{"type":"workflow","name":"listShippingOptionsForCartWithPricingWorkflow","description":"List a cart's shipping options with prices.","link":"../core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx","depth":5},{"type":"step","name":"validateCartShippingOptionsPriceStep","description":"This step validates shipping options to ensure they have a price.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartShippingOptionsPriceStep/page.mdx","depth":6},{"type":"step","name":"validateAndReturnShippingMethodsDataStep","description":"This step validates shipping options to ensure they can be applied on a cart.\nThe step either returns the validated data or void.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateAndReturnShippingMethodsDataStep/page.mdx","depth":7},{"type":"step","name":"removeShippingMethodFromCartStep","description":"This step removes shipping methods from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodFromCartStep/page.mdx","depth":8},{"type":"step","name":"addShippingMethodToCartStep","description":"This step adds shipping methods to a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.addShippingMethodToCartStep/page.mdx","depth":8},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":8},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":9}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"addShippingMethodToCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":2},{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":3},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":4},{"type":"workflow","name":"listShippingOptionsForCartWithPricingWorkflow","description":"List a cart's shipping options with prices.","link":"../core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx","depth":5},{"type":"step","name":"validateCartShippingOptionsStep","description":"This step validates shipping options to ensure they can be applied on a cart.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartShippingOptionsStep/page.mdx","depth":6},{"type":"step","name":"validateCartShippingOptionsPriceStep","description":"This step validates shipping options to ensure they have a price.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartShippingOptionsPriceStep/page.mdx","depth":7},{"type":"step","name":"validateAndReturnShippingMethodsDataStep","description":"This step validates shipping options to ensure they can be applied on a cart.\nThe step either returns the validated data or void.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateAndReturnShippingMethodsDataStep/page.mdx","depth":8},{"type":"step","name":"removeShippingMethodFromCartStep","description":"This step removes shipping methods from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodFromCartStep/page.mdx","depth":9},{"type":"step","name":"addShippingMethodToCartStep","description":"This step adds shipping methods to a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.addShippingMethodToCartStep/page.mdx","depth":9},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":10},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":11},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":11}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"AddShippingMethodToCartWorkflowInput","type":"[AddShippingMethodToCartWorkflowInput](../../../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to add a shipping method to a cart.","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The ID of the cart to add the shipping method to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"The shipping options to create the shipping methods from and add to the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Custom data useful for the fulfillment provider processing the shipping option or method.\n\nLearn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addShippingMethodToCartWorkflow"/>
|
||||
<TypeList types={[{"name":"AddShippingMethodToCartWorkflowInput & AdditionalData","type":"[AddShippingMethodToCartWorkflowInput](../../../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"AddShippingMethodToCartWorkflowInput","type":"[AddShippingMethodToCartWorkflowInput](../../../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to add a shipping method to a cart.","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The ID of the cart to add the shipping method to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"The shipping options to create the shipping methods from and add to the cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the shipping option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Custom data useful for the fulfillment provider processing the shipping option or method.\n\nLearn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]},{"name":"AdditionalData","type":"[AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="addShippingMethodToCartWorkflow"/>
|
||||
|
||||
## Hooks
|
||||
|
||||
@@ -210,7 +210,7 @@ addShippingMethodToCartWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[AddShippingMethodToCartWorkflowInput](../../../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx)","description":"The data to add a shipping method to a cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The ID of the cart to add the shipping method to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"The shipping options to create the shipping methods from and add to the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[AddShippingMethodToCartWorkflowInput](../../../../interfaces/core_flows.AddShippingMethodToCartWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The ID of the cart to add the shipping method to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"The shipping options to create the shipping methods from and add to the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
|
||||
## Emitted Events
|
||||
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ This workflow adds a product variant to a cart as a line item. It's executed by
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding an item to the cart.
|
||||
For example, you can use this workflow to add a line item to the cart with a custom price.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L117" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L117" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -180,7 +180,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"addToCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":3},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":4},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":5},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"6","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":6},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":6},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":6}]},{"type":"step","name":"validateLineItemPricesStep","description":"This step validates the specified line item objects to ensure they have prices.\nIf an item doesn't have a price, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateLineItemPricesStep/page.mdx","depth":7},{"type":"step","name":"getLineItemActionsStep","description":"This step returns lists of cart line items to create or update based on the\nprovided input.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getLineItemActionsStep/page.mdx","depth":8},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":9},{"type":"step","name":"createLineItemsStep","description":"This step creates line item in a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemsStep/page.mdx","depth":10},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":10},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after Line truncated
|
||||
<WorkflowDiagram workflow={{"name":"addToCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":2},{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":3},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":4},{"type":"hook","name":"setPricingContext","description":"This hook is executed after the order is retrieved and before the line items are created. You can consume this hook to return any custom context useful for the prices retrieval of the variants to be added to the order.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { addOrderLineItemsWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\naddOrderLineItemsWorkflow.hooks.setPricingContext((\n { order, variantIds, region, customerData, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe variants' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":5},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"6","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":6},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":6},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":6}]},{"type":"step","name":"validateLineItemPricesStep","description":"This step validates the specified line item objects to ensure they have prices.\nIf an item doesn't have a price, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateLineItemPricesStep/page.mdx","depth":7},{"type":"step","name":"getLineItemActionsStep","description":"This step returns lists of cart line items to create or update based on the\nprovided input.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getLineItemActionsStep/page.mdx","depth":8},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":9},{"type":"step","name":"createLineItemsStep","description":"This step creates line item in a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemsStep/page.mdx","depth":10},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":10},{"type":"workflow","name":"refreshCartItemsWorkflow","descriptiLine truncated
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ You can use this workflow within your own customizations or custom workflows, al
|
||||
For example, in the [Subscriptions recipe](https://docs.medusajs.com/resources/recipes/subscriptions/examples/standard#create-workflow),
|
||||
this workflow is used within another workflow that creates a subscription order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L94" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L94" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ Learn more about the links between the product variant and sales channels and in
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to check whether a product variant has enough inventory quantity before adding them to the cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/confirm-variant-inventory.ts#L147" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/confirm-variant-inventory.ts#L147" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ This documentation provides a reference to the `createCartCreditLinesWorkflow`.
|
||||
|
||||
This workflow creates one or more credit lines for a cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+3
-3
@@ -14,8 +14,8 @@ tags:
|
||||
- workflow
|
||||
- inventory
|
||||
- remote query
|
||||
- tax
|
||||
- locking
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
- payment
|
||||
@@ -35,7 +35,7 @@ This workflow has a hook that allows you to perform custom actions on the create
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around cart creation.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/create-carts.ts#L118" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/create-carts.ts#L118" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -176,7 +176,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"createCartWorkflow","steps":[{"type":"step","name":"findSalesChannelStep","description":"This step either retrieves a sales channel either using the ID provided as an input, or, if no ID\nis provided, the default sales channel of the first store.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findSalesChannelStep/page.mdx","depth":1},{"type":"step","name":"findOneOrAnyRegionStep","description":"This step retrieves a region either by the provided ID or the first region in the first store.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findOneOrAnyRegionStep/page.mdx","depth":1},{"type":"step","name":"findOrCreateCustomerStep","description":"This step finds or creates a customer based on the provided ID or email. It prioritizes finding the customer by ID, then by email.\n\nThe step creates a new customer either if:\n\n- No customer is found with the provided ID and email;\n- Or if it found the customer by ID but their email does not match the email in the input.\n\nThe step returns the details of the customer found or created, along with their email.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findOrCreateCustomerStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"3","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":3},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":3}]},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":4},{"type":"step","name":"validateLineItemPricesStep","description":"This step validates the specified line item objects to ensure they have prices.\nIf an item doesn't have a price, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateLineItemPricesStep/page.mdx","depth":5},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":6},{"type":"step","name":"createCartsStep","description":"This step creates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createCartsStep/page.mdx","depth":7},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":8},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"Update a cart's applied promotions to add, replace, or remove them.","link":"../core_flows.Cart.Workflows_Cart.updateCartPromotionsWorkflow/page.mdx","depth":9},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection deLine truncated
|
||||
<WorkflowDiagram workflow={{"name":"createCartWorkflow","steps":[{"type":"step","name":"findSalesChannelStep","description":"This step either retrieves a sales channel either using the ID provided as an input, or, if no ID\nis provided, the default sales channel of the first store.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findSalesChannelStep/page.mdx","depth":1},{"type":"step","name":"findOneOrAnyRegionStep","description":"This step retrieves a region either by the provided ID or the first region in the first store.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findOneOrAnyRegionStep/page.mdx","depth":1},{"type":"step","name":"findOrCreateCustomerStep","description":"This step finds or creates a customer based on the provided ID or email. It prioritizes finding the customer by ID, then by email.\n\nThe step creates a new customer either if:\n\n- No customer is found with the provided ID and email;\n- Or if it found the customer by ID but their email does not match the email in the input.\n\nThe step returns the details of the customer found or created, along with their email.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.findOrCreateCustomerStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed after the order is retrieved and before the line items are created. You can consume this hook to return any custom context useful for the prices retrieval of the variants to be added to the order.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { addOrderLineItemsWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\naddOrderLineItemsWorkflow.hooks.setPricingContext((\n { order, variantIds, region, customerData, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe variants' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"3","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":3},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":3}]},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":4},{"type":"step","name":"validateLineItemPricesStep","description":"This step validates the specified line item objects to ensure they have prices.\nIf an item doesn't have a price, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateLineItemPricesStep/page.mdx","depth":5},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":6},{"type":"step","name":"createCartsStep","description":"This step creates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createCartsStep/page.mdx","depth":7},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":8},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"Update a cart's applied promotions to add, replace, or remove them.","link":"../core_flows.Cart.Workflows_Cart.updateCartPromotionsWorkflow/page.mdx","depth":9},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"ReLine truncated
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ This workflow creates a payment collection for a cart. It's executed by the
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around adding creating a payment collection for a cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+5
-5
@@ -14,7 +14,7 @@ This documentation provides a reference to the `deleteCartCreditLinesWorkflow`.
|
||||
|
||||
This workflow deletes one or more credit lines from a cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/delete-cart-credit-lines.ts#L13" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/delete-cart-credit-lines.ts#L13" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -36,7 +36,7 @@ export async function POST(
|
||||
.run({
|
||||
input: {
|
||||
"id": [
|
||||
"id_TWz9HtBLfjp7hFQ"
|
||||
"id_26P1b4d4bTZv"
|
||||
]
|
||||
}
|
||||
})
|
||||
@@ -63,7 +63,7 @@ export default async function handleOrderPlaced({
|
||||
.run({
|
||||
input: {
|
||||
"id": [
|
||||
"id_TWz9HtBLfjp7hFQ"
|
||||
"id_26P1b4d4bTZv"
|
||||
]
|
||||
}
|
||||
})
|
||||
@@ -90,7 +90,7 @@ export default async function myCustomJob(
|
||||
.run({
|
||||
input: {
|
||||
"id": [
|
||||
"id_TWz9HtBLfjp7hFQ"
|
||||
"id_26P1b4d4bTZv"
|
||||
]
|
||||
}
|
||||
})
|
||||
@@ -118,7 +118,7 @@ const myWorkflow = createWorkflow(
|
||||
.runAsStep({
|
||||
input: {
|
||||
"id": [
|
||||
"id_TWz9HtBLfjp7hFQ"
|
||||
"id_26P1b4d4bTZv"
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
+71
-3
@@ -22,7 +22,7 @@ price of the shipping method being added to the cart.
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to retrieve the shipping options of a cart and their prices
|
||||
in your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L76" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L121" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -158,12 +158,80 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"listShippingOptionsForCartWithPricingWorkflow","steps":[{"type":"step","name":"validatePresenceOfStep","description":"This step validates the presence of attributes on an object","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.validatePresenceOfStep/page.mdx","depth":1},{"type":"step","name":"calculateShippingOptionsPricesStep","description":"This step calculates the prices for one or more shipping options.","link":"../../../../Fulfillment/Steps_Fulfillment/functions/core_flows.Fulfillment.Steps_Fulfillment.calculateShippingOptionsPricesStep/page.mdx","depth":2}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"listShippingOptionsForCartWithPricingWorkflow","steps":[{"type":"step","name":"validatePresenceOfStep","description":"This step validates the presence of attributes on an object","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.validatePresenceOfStep/page.mdx","depth":1},{"type":"hook","name":"setShippingOptionsContext","description":"This hook is executed after the cart is retrieved and before the shipping options are queried. You can consume this hook to return any custom context useful for the shipping options retrieval.\n\nFor example, you can consume the hook to add the customer Id to the context:\n\n```ts\nimport { listShippingOptionsForCartWithPricingWorkflow } from \"@medusajs/medusa/core-flows\"\nimport { StepResponse } from \"@medusajs/workflows-sdk\"\n\nlistShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(\n async ({ cart }, { container }) => {\n\n if (cart.customer_id) {\n return new StepResponse({\n customer_id: cart.customer_id,\n })\n }\n\n const query = container.resolve(\"query\")\n\n const { data: carts } = await query.graph({\n entity: \"cart\",\n filters: {\n id: cart.id,\n },\n fields: [\"customer_id\"],\n })\n\n return new StepResponse({\n customer_id: carts[0].customer_id,\n })\n }\n)\n```\n\nThe `customer_id` property will be added to the context along with other properties such as `is_return` and `enabled_in_store`.\n\n:::note\n\nYou should also consume the `setShippingOptionsContext` hook in the listShippingOptionsForCartWorkflow workflow to ensure that the context is consistent when listing shipping options across workflows.\n\n:::","link":"#setShippingOptionsContext","depth":2},{"type":"step","name":"calculateShippingOptionsPricesStep","description":"This step calculates the prices for one or more shipping options.","link":"../../../../Fulfillment/Steps_Fulfillment/functions/core_flows.Fulfillment.Steps_Fulfillment.calculateShippingOptionsPricesStep/page.mdx","depth":3}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"ListShippingOptionsForCartWithPricingWorkflowInput","type":"[ListShippingOptionsForCartWithPricingWorkflowInput](../../../../../types/types/types.ListShippingOptionsForCartWithPricingWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The context for retrieving the shipping options.","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"Specify the shipping options to retrieve their details and prices.\nIf not provided, all applicable shipping options are retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The shipping option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Custom data relevant for the fulfillment provider that processes this shipping option.\nIt can be data relevant to calculate the shipping option's price.\n\nLearn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_return","type":"`boolean`","description":"Whether to retrieve return shipping options.\nBy default, non-return shipping options are retrieved.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"enabled_in_store","type":"`boolean`","description":"Whether to retrieve the shipping option's enabled in the store, which is the default.","optional":true,"defaultValue":"true","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="listShippingOptionsForCartWithPricingWorkflow"/>
|
||||
<TypeList types={[{"name":"ListShippingOptionsForCartWithPricingWorkflowInput & AdditionalData","type":"[ListShippingOptionsForCartWithPricingWorkflowInput](../../../../../types/types/types.ListShippingOptionsForCartWithPricingWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"ListShippingOptionsForCartWithPricingWorkflowInput","type":"[ListShippingOptionsForCartWithPricingWorkflowInput](../../../../../types/types/types.ListShippingOptionsForCartWithPricingWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The context for retrieving the shipping options.","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"`object`[]","description":"Specify the shipping options to retrieve their details and prices.\nIf not provided, all applicable shipping options are retrieved.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The shipping option's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"data","type":"`Record<string, unknown>`","description":"Custom data relevant for the fulfillment provider that processes this shipping option.\nIt can be data relevant to calculate the shipping option's price.\n\nLearn more in [this documentation](https://docs.medusajs.com/resources/commerce-modules/fulfillment/shipping-option#data-property).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"is_return","type":"`boolean`","description":"Whether to retrieve return shipping options.\nBy default, non-return shipping options are retrieved.","optional":true,"defaultValue":"false","expandable":false,"children":[]},{"name":"enabled_in_store","type":"`boolean`","description":"Whether to retrieve the shipping option's enabled in the store, which is the default.","optional":true,"defaultValue":"true","expandable":false,"children":[]}]},{"name":"AdditionalData","type":"[AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="listShippingOptionsForCartWithPricingWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
<TypeList types={[{"name":"any[]","type":"`any`[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"any","type":"`any`","optional":false,"defaultValue":"","description":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="listShippingOptionsForCartWithPricingWorkflow"/>
|
||||
|
||||
## Hooks
|
||||
|
||||
Hooks allow you to inject custom functionalities into the workflow. You'll receive data from the workflow, as well as additional data sent through an HTTP request.
|
||||
|
||||
Learn more about [Hooks](https://docs.medusajs.com/learn/fundamentals/workflows/workflow-hooks) and [Additional Data](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).
|
||||
|
||||
### setShippingOptionsContext
|
||||
|
||||
This hook is executed after the cart is retrieved and before the shipping options are queried. You can consume this hook to return any custom context useful for the shipping options retrieval.
|
||||
|
||||
For example, you can consume the hook to add the customer Id to the context:
|
||||
|
||||
```ts
|
||||
import { listShippingOptionsForCartWithPricingWorkflow } from "@medusajs/medusa/core-flows"
|
||||
import { StepResponse } from "@medusajs/workflows-sdk"
|
||||
|
||||
listShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(
|
||||
async ({ cart }, { container }) => {
|
||||
|
||||
if (cart.customer_id) {
|
||||
return new StepResponse({
|
||||
customer_id: cart.customer_id,
|
||||
})
|
||||
}
|
||||
|
||||
const query = container.resolve("query")
|
||||
|
||||
const { data: carts } = await query.graph({
|
||||
entity: "cart",
|
||||
filters: {
|
||||
id: cart.id,
|
||||
},
|
||||
fields: ["customer_id"],
|
||||
})
|
||||
|
||||
return new StepResponse({
|
||||
customer_id: carts[0].customer_id,
|
||||
})
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
The `customer_id` property will be added to the context along with other properties such as `is_return` and `enabled_in_store`.
|
||||
|
||||
:::note
|
||||
|
||||
You should also consume the `setShippingOptionsContext` hook in the [listShippingOptionsForCartWorkflow](../core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWorkflow/page.mdx) workflow to ensure that the context is consistent when listing shipping options across workflows.
|
||||
|
||||
:::
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { listShippingOptionsForCartWithPricingWorkflow } from "@medusajs/medusa/core-flows"
|
||||
|
||||
listShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(
|
||||
(async ({ cart, fulfillmentSetIds, additional_data }, { container }) => {
|
||||
//TODO
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
#### Input
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-9)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillmentSetIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="setShippingOptionsContext"/>
|
||||
+65
-3
@@ -25,7 +25,7 @@ use the [listShippingOptionsForCartWithPricingWorkflow](../core_flows.Cart.Workf
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around to retrieve the shipping options of a cart
|
||||
in your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L82" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L130" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -138,7 +138,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"listShippingOptionsForCartWorkflow","steps":[{"type":"step","name":"validatePresenceOfStep","description":"This step validates the presence of attributes on an object","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.validatePresenceOfStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"listShippingOptionsForCartWorkflow","steps":[{"type":"step","name":"validatePresenceOfStep","description":"This step validates the presence of attributes on an object","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.validatePresenceOfStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed after the order is retrieved and before the line items are created. You can consume this hook to return any custom context useful for the prices retrieval of the variants to be added to the order.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { addOrderLineItemsWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\naddOrderLineItemsWorkflow.hooks.setPricingContext((\n { order, variantIds, region, customerData, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe variants' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"hook","name":"setShippingOptionsContext","description":"This hook is executed after the cart is retrieved and before the shipping options are queried. You can consume this hook to return any custom context useful for the shipping options retrieval.\n\nFor example, you can consume the hook to add the customer Id to the context:\n\n```ts\nimport { listShippingOptionsForCartWithPricingWorkflow } from \"@medusajs/medusa/core-flows\"\nimport { StepResponse } from \"@medusajs/workflows-sdk\"\n\nlistShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(\n async ({ cart }, { container }) => {\n\n if (cart.customer_id) {\n return new StepResponse({\n customer_id: cart.customer_id,\n })\n }\n\n const query = container.resolve(\"query\")\n\n const { data: carts } = await query.graph({\n entity: \"cart\",\n filters: {\n id: cart.id,\n },\n fields: [\"customer_id\"],\n })\n\n return new StepResponse({\n customer_id: carts[0].customer_id,\n })\n }\n)\n```\n\nThe `customer_id` property will be added to the context along with other properties such as `is_return` and `enabled_in_store`.\n\n:::note\n\nYou should also consume the `setShippingOptionsContext` hook in the listShippingOptionsForCartWorkflow workflow to ensure that the context is consistent when listing shipping options across workflows.\n\n:::","link":"#setShippingOptionsContext","depth":3}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -203,4 +203,66 @@ listShippingOptionsForCartWorkflow.hooks.setPricingContext(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-9)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillmentSetIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="setPricingContext"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-10)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillmentSetIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="setPricingContext"/>
|
||||
|
||||
### setShippingOptionsContext
|
||||
|
||||
This hook is executed after the cart is retrieved and before the shipping options are queried. You can consume this hook to return any custom context useful for the shipping options retrieval.
|
||||
|
||||
For example, you can consume the hook to add the customer Id to the context:
|
||||
|
||||
```ts
|
||||
import { listShippingOptionsForCartWithPricingWorkflow } from "@medusajs/medusa/core-flows"
|
||||
import { StepResponse } from "@medusajs/workflows-sdk"
|
||||
|
||||
listShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(
|
||||
async ({ cart }, { container }) => {
|
||||
|
||||
if (cart.customer_id) {
|
||||
return new StepResponse({
|
||||
customer_id: cart.customer_id,
|
||||
})
|
||||
}
|
||||
|
||||
const query = container.resolve("query")
|
||||
|
||||
const { data: carts } = await query.graph({
|
||||
entity: "cart",
|
||||
filters: {
|
||||
id: cart.id,
|
||||
},
|
||||
fields: ["customer_id"],
|
||||
})
|
||||
|
||||
return new StepResponse({
|
||||
customer_id: carts[0].customer_id,
|
||||
})
|
||||
}
|
||||
)
|
||||
```
|
||||
|
||||
The `customer_id` property will be added to the context along with other properties such as `is_return` and `enabled_in_store`.
|
||||
|
||||
:::note
|
||||
|
||||
You should also consume the `setShippingOptionsContext` hook in the [listShippingOptionsForCartWithPricingWorkflow](../core_flows.Cart.Workflows_Cart.listShippingOptionsForCartWithPricingWorkflow/page.mdx) workflow to ensure that the context is consistent when listing shipping options across workflows.
|
||||
|
||||
:::
|
||||
|
||||
#### Example
|
||||
|
||||
```ts
|
||||
import { listShippingOptionsForCartWorkflow } from "@medusajs/medusa/core-flows"
|
||||
|
||||
listShippingOptionsForCartWorkflow.hooks.setShippingOptionsContext(
|
||||
(async ({ cart, fulfillmentSetIds, additional_data }, { container }) => {
|
||||
//TODO
|
||||
})
|
||||
)
|
||||
```
|
||||
|
||||
#### Input
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-11)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillmentSetIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="setShippingOptionsContext"/>
|
||||
+4
-4
@@ -32,7 +32,7 @@ is added to the cart.
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to refresh the cart after making updates to it in your
|
||||
custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L131" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L120" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -141,7 +141,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"refreshCartItemsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"3","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":3},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":3},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":3}]},{"type":"workflow","name":"refreshCartShippingMethodsWorkflow","description":"Refresh a cart's shipping methods after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartShippingMethodsWorkflow/page.mdx","depth":4},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"5","steps":[{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":5}]},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"Update a cart's applied promotions to add, replace, or remove them.","link":"../core_flows.Cart.Workflows_Cart.updateCartPromotionsWorkflow/page.mdx","depth":7},{"type":"hook","name":"beforeRefreshingPaymentCollection","description":"","link":"#beforeRefreshingPaymentCollection","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection details.","link":"../core_flows.Cart.Workflows_Cart.refreshPaymentCollectionForCartWorkflow/page.mdx","depth":9},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":10}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"refreshCartItemsWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"hook","name":"setPricingContext","description":"This hook is executed after the order is retrieved and before the line items are created. You can consume this hook to return any custom context useful for the prices retrieval of the variants to be added to the order.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { addOrderLineItemsWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\naddOrderLineItemsWorkflow.hooks.setPricingContext((\n { order, variantIds, region, customerData, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe variants' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":2},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"3","steps":[{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"useQueryGraphStep","description":"This step fetches data across modules using the Query.\n\nLearn more in the [Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx","depth":3},{"type":"step","name":"getVariantPriceSetsStep","description":"This step retrieves the calculated price sets of the specified variants.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getVariantPriceSetsStep/page.mdx","depth":3},{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":3},{"type":"step","name":"updateLineItemsStep","description":"This step updates a cart's line items.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateLineItemsStep/page.mdx","depth":3}]},{"type":"workflow","name":"refreshCartShippingMethodsWorkflow","description":"Refresh a cart's shipping methods after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartShippingMethodsWorkflow/page.mdx","depth":4},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"5","steps":[{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":5}]},{"type":"workflow","name":"updateCartPromotionsWorkflow","description":"Update a cart's applied promotions to add, replace, or remove them.","link":"../core_flows.Cart.Workflows_Cart.updateCartPromotionsWorkflow/page.mdx","depth":7},{"type":"hook","name":"beforeRefreshingPaymentCollection","description":"","link":"#beforeRefreshingPaymentCollection","depth":8},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection details.","link":"../core_flows.Cart.Workflows_Cart.refreshPaymentCollectionForCartWorkflow/page.mdx","depth":9},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":10}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -206,7 +206,7 @@ refreshCartItemsWorkflow.hooks.setPricingContext(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-10)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"`undefined` \\| (any[] \\| WorkflowData<any[] \\| undefined>) & any[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="setPricingContext"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-12)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"`undefined` \\| (any[] \\| WorkflowData<any[] \\| undefined>) & any[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="setPricingContext"/>
|
||||
|
||||
### beforeRefreshingPaymentCollection
|
||||
|
||||
@@ -228,4 +228,4 @@ refreshCartItemsWorkflow.hooks.beforeRefreshingPaymentCollection(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-11)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[RefreshCartItemsWorkflowInput](../../../../types/core_flows.RefreshCartItemsWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The promotion codes applied on the cart.\nThese promotion codes will replace previously applied codes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"force_refresh","type":"`boolean`","description":"Force refresh the cart items","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"`any`[]","description":"The items to refresh.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`any`[]","description":"The shipping methods to refresh.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"force_tax_calculation","type":"`boolean`","description":"Whether to force re-calculating tax amounts, which\nmay include sending requests to a third-part tax provider, depending\non the configurations of the cart's tax region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="beforeRefreshingPaymentCollection"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-13)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[RefreshCartItemsWorkflowInput](../../../../types/core_flows.RefreshCartItemsWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The promotion codes applied on the cart.\nThese promotion codes will replace previously applied codes.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"force_refresh","type":"`boolean`","description":"Force refresh the cart items","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"`any`[]","description":"The items to refresh.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_methods","type":"`any`[]","description":"The shipping methods to refresh.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"force_tax_calculation","type":"`boolean`","description":"Whether to force re-calculating tax amounts, which\nmay include sending requests to a third-part tax provider, depending\non the configurations of the cart's tax region.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="beforeRefreshingPaymentCollection"/>
|
||||
+3
-3
@@ -20,7 +20,7 @@ and retrieve their correct pricing after a cart update. This workflow is used by
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to refresh the cart's shipping method after making updates to the cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L53" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -133,7 +133,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"RefreshCartShippingMethodsWorkflowInput","type":"[RefreshCartShippingMethodsWorkflowInput](../../../../types/core_flows.RefreshCartShippingMethodsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the cart to refresh.","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="refreshCartShippingMethodsWorkflow"/>
|
||||
<TypeList types={[{"name":"RefreshCartShippingMethodsWorkflowInput & AdditionalData","type":"[RefreshCartShippingMethodsWorkflowInput](../../../../types/core_flows.RefreshCartShippingMethodsWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"RefreshCartShippingMethodsWorkflowInput","type":"[RefreshCartShippingMethodsWorkflowInput](../../../../types/core_flows.RefreshCartShippingMethodsWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the cart to refresh.","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"AdditionalData","type":"[AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="refreshCartShippingMethodsWorkflow"/>
|
||||
|
||||
## Hooks
|
||||
|
||||
@@ -161,4 +161,4 @@ refreshCartShippingMethodsWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-12)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[RefreshCartShippingMethodsWorkflowInput](../../../../types/core_flows.RefreshCartShippingMethodsWorkflowInput/page.mdx)","description":"The details of the cart to refresh.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-14)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[RefreshCartShippingMethodsWorkflowInput](../../../../types/core_flows.RefreshCartShippingMethodsWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
+2
-2
@@ -26,7 +26,7 @@ payment collection after an update.
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to refresh the cart's payment collection after making updates to it in your
|
||||
custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L57" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -167,4 +167,4 @@ refreshPaymentCollectionForCartWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-13)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[RefreshPaymentCollectionForCartWorklowInput](../../../../types/core_flows.RefreshPaymentCollectionForCartWorklowInput/page.mdx)","description":"The details of the cart to refresh.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-15)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[RefreshPaymentCollectionForCartWorklowInput](../../../../types/core_flows.RefreshPaymentCollectionForCartWorklowInput/page.mdx)","description":"The details of the cart to refresh.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
+5
-5
@@ -18,7 +18,7 @@ This documentation provides a reference to the `refundPaymentAndRecreatePaymentS
|
||||
|
||||
This workflow refunds a payment and creates a new payment session.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L64" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L64" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -43,7 +43,7 @@ export async function POST(
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 47
|
||||
"amount": 39
|
||||
}
|
||||
})
|
||||
|
||||
@@ -72,7 +72,7 @@ export default async function handleOrderPlaced({
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 47
|
||||
"amount": 39
|
||||
}
|
||||
})
|
||||
|
||||
@@ -101,7 +101,7 @@ export default async function myCustomJob(
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 47
|
||||
"amount": 39
|
||||
}
|
||||
})
|
||||
|
||||
@@ -130,7 +130,7 @@ const myWorkflow = createWorkflow(
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 47
|
||||
"amount": 39
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+3
-3
@@ -30,7 +30,7 @@ by the [Set Cart's Customer Store API Route](https://docs.medusajs.com/api/store
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to set the cart's customer within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L53" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -147,7 +147,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"TransferCartCustomerWorkflowInput","type":"[TransferCartCustomerWorkflowInput](../../../../types/core_flows.TransferCartCustomerWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The cart ownership transfer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to transfer the cart to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="transferCartCustomerWorkflow"/>
|
||||
<TypeList types={[{"name":"TransferCartCustomerWorkflowInput & AdditionalData","type":"[TransferCartCustomerWorkflowInput](../../../../types/core_flows.TransferCartCustomerWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"TransferCartCustomerWorkflowInput","type":"[TransferCartCustomerWorkflowInput](../../../../types/core_flows.TransferCartCustomerWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The cart ownership transfer details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to transfer the cart to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"AdditionalData","type":"[AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="transferCartCustomerWorkflow"/>
|
||||
|
||||
## Hooks
|
||||
|
||||
@@ -175,7 +175,7 @@ transferCartCustomerWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-14)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[TransferCartCustomerWorkflowInput](../../../../types/core_flows.TransferCartCustomerWorkflowInput/page.mdx)","description":"The cart ownership transfer details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to transfer the cart to.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-16)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[TransferCartCustomerWorkflowInput](../../../../types/core_flows.TransferCartCustomerWorkflowInput/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer to transfer the cart to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
|
||||
## Emitted Events
|
||||
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ that need to be applied to the cart's line items and shipping methods based on t
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's promotions within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L76" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L76" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -176,4 +176,4 @@ updateCartPromotionsWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-18)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[UpdateCartPromotionsWorkflowInput](../../../../types/core_flows.UpdateCartPromotionsWorkflowInput/page.mdx)","description":"The details of the promotion updates on a cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The promotion codes to add to the cart, remove from the cart,\nor replace all existing promotions in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"[ADD](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#add) \\| [REMOVE](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#remove) \\| [REPLACE](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#replace)","description":"The action to perform with the specified promotion codes.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-20)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[UpdateCartPromotionsWorkflowInput](../../../../types/core_flows.UpdateCartPromotionsWorkflowInput/page.mdx)","description":"The details of the promotion updates on a cart.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The cart's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"cart","type":"`any`","description":"The Cart reference.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The promotion codes to add to the cart, remove from the cart,\nor replace all existing promotions in the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"action","type":"[ADD](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#add) \\| [REMOVE](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#remove) \\| [REPLACE](../../../../../utils/PromotionUtils/enums/utils.PromotionUtils.PromotionActions/page.mdx#replace)","description":"The action to perform with the specified promotion codes.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
+3
-3
@@ -41,7 +41,7 @@ then update any associated details related to the cart in the workflow's hook.
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating a cart.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-cart.ts#L81" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/update-cart.ts#L69" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -234,7 +234,7 @@ updateCartWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-15)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`any`","description":"","optional":false,"defaultValue":"data.region.currency_code","expandable":false,"children":[]},{"name":"region_id","type":"`any`","description":"","optional":false,"defaultValue":"data.region.id","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the cart to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the cart's sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email address of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs of data related to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"`null` \\| [CreateAddressDTO](../../../../../cart/interfaces/cart.CreateAddressDTO/page.mdx) \\| [UpdateAddressDTO](../../../../../cart/interfaces/cart.UpdateAddressDTO/page.mdx)","description":"The cart's shipping address. You can either update the cart's existing shipping address, or create a new one.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [CreateAddressDTO](../../../../../cart/interfaces/cart.CreateAddressDTO/page.mdx) \\| [UpdateAddressDTO](../../../../../cart/interfaces/cart.UpdateAddressDTO/page.mdx)","description":"The cart's billing address. You can either update the cart's existing billing address, or create a new one.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-17)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`any`","description":"","optional":false,"defaultValue":"data.region.currency_code","expandable":false,"children":[]},{"name":"region_id","type":"`any`","description":"","optional":false,"defaultValue":"data.region.id","expandable":false,"children":[]},{"name":"id","type":"`string`","description":"The ID of the cart to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`null` \\| `string`","description":"The ID of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`null` \\| `string`","description":"The ID of the cart's sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email address of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs of data related to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"`null` \\| [CreateAddressDTO](../../../../../cart/interfaces/cart.CreateAddressDTO/page.mdx) \\| [UpdateAddressDTO](../../../../../cart/interfaces/cart.UpdateAddressDTO/page.mdx)","description":"The cart's shipping address. You can either update the cart's existing shipping address, or create a new one.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`null` \\| [CreateAddressDTO](../../../../../cart/interfaces/cart.CreateAddressDTO/page.mdx) \\| [UpdateAddressDTO](../../../../../cart/interfaces/cart.UpdateAddressDTO/page.mdx)","description":"The cart's billing address. You can either update the cart's existing billing address, or create a new one.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
|
||||
### cartUpdated
|
||||
|
||||
@@ -256,7 +256,7 @@ updateCartWorkflow.hooks.cartUpdated(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-17)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cartUpdated"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-19)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="cartUpdated"/>
|
||||
|
||||
## Emitted Events
|
||||
|
||||
|
||||
+8
-7
@@ -7,7 +7,6 @@ tags:
|
||||
- cart
|
||||
- event bus
|
||||
- workflow
|
||||
- inventory
|
||||
- query
|
||||
- pricing
|
||||
- fulfillment
|
||||
@@ -17,6 +16,7 @@ tags:
|
||||
- link
|
||||
- payment
|
||||
- logger
|
||||
- inventory
|
||||
---
|
||||
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
@@ -25,12 +25,13 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `updateLineItemInCartWorkflow`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
This workflow updates a line item's details in a cart. You can update the line item's quantity, unit price, and more. This workflow is executed
|
||||
by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store#carts\_postcartsidlineitemsline\_id).
|
||||
This workflow updates a line item's details in a cart. You can update the line item's quantity, unit price, and more.
|
||||
If the quantity is set to 0, the item will be removed from the cart.
|
||||
This workflow is executed by the [Update Line Item Store API Route](https://docs.medusajs.com/api/store#carts\_postcartsidlineitemsline\_id).
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to update a line item's details in your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L108" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L111" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -155,7 +156,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateLineItemInCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":2},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":3},{"type":"hook","name":"setPricingContext","description":"This hook is executed before the shipping options are retrieved. You can consume this hook to return any custom context useful for the prices retrieval of shipping options.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { listShippingOptionsForCartWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\nlistShippingOptionsForCartWorkflow.hooks.setPricingContext((\n { cart, fulfillmentSetIds, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe shipping options' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":4},{"type":"when","condition":"{\n return !!variantIds.length\n }","depth":"5","steps":[{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":5}]},{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":6},{"type":"step","name":"updateLineItemsStepWithSelector","description":"This step updates line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.updateLineItemsStepWithSelector/page.mdx","depth":7},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":8},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":9},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":9}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateLineItemInCartWorkflow","steps":[{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":1},{"type":"step","name":"validateCartStep","description":"This step validates a cart to ensure it exists and is not completed.\nIf not valid, the step throws an error.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateCartStep/page.mdx","depth":2},{"type":"hook","name":"validate","description":"This hook is executed before all operations. You can consume this hook to perform any custom validation. If validation fails, you can throw an error to stop the workflow execution.","link":"#validate","depth":3},{"type":"hook","name":"setPricingContext","description":"This hook is executed after the order is retrieved and before the line items are created. You can consume this hook to return any custom context useful for the prices retrieval of the variants to be added to the order.\n\nFor example, assuming you have the following custom pricing rule:\n\n```json\n{\n \"attribute\": \"location_id\",\n \"operator\": \"eq\",\n \"value\": \"sloc_123\",\n}\n```\n\nYou can consume the `setPricingContext` hook to add the `location_id` context to the prices calculation:\n\n```ts\nimport { addOrderLineItemsWorkflow } from \"@medusajs/medusa/core-flows\";\nimport { StepResponse } from \"@medusajs/workflows-sdk\";\n\naddOrderLineItemsWorkflow.hooks.setPricingContext((\n { order, variantIds, region, customerData, additional_data }, { container }\n) => {\n return new StepResponse({\n location_id: \"sloc_123\", // Special price for in-store purchases\n });\n});\n```\n\nThe variants' prices will now be retrieved using the context you return.\n\n:::note\n\nLearn more about prices calculation context in the [Prices Calculation](https://docs.medusajs.com/resources/commerce-modules/pricing/price-calculation) documentation.\n\n:::","link":"#setPricingContext","depth":4},{"type":"when","condition":"shouldRemoveItem","depth":"5","steps":[{"type":"workflow","name":"deleteLineItemsWorkflow","description":"Delete line items from a cart.","link":"../../../../Line_Item/Workflows_Line_Item/functions/core_flows.Line_Item.Workflows_Line_Item.deleteLineItemsWorkflow/page.mdx","depth":5}]},{"type":"when","condition":"{\n return !!variantIds.length && !shouldRemoveItem\n }","depth":"6","steps":[{"type":"step","name":"validateVariantPricesStep","description":"This step validates the specified variant objects to ensure they have prices.\nIf not valid, the step throws an error.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateVariantPricesStep/page.mdx","depth":6}]},{"type":"when","condition":"!shouldRemoveItem","depth":"7","steps":[{"type":"workflow","name":"confirmVariantInventoryWorkflow","description":"Validate that a variant is in-stock before adding to the cart.","link":"../core_flows.Cart.Workflows_Cart.confirmVariantInventoryWorkflow/page.mdx","depth":7},{"type":"step","name":"updateLineItemsStepWithSelector","description":"This step updates line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.updateLineItemsStepWithSelector/page.mdx","depth":7},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":7}]},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":8},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":8}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -187,7 +188,7 @@ updateLineItemInCartWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-19)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[UpdateLineItemInCartWorkflowInputDTO](../../../../../types/interfaces/types.UpdateLineItemInCartWorkflowInputDTO/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The ID of the cart that the line item belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string`","description":"The ID of the line item to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"update","type":"Partial<[UpdateLineItemDTO](../../../../../cart/interfaces/cart.UpdateLineItemDTO/page.mdx)>","description":"The details to update in the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-21)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"input","type":"[UpdateLineItemInCartWorkflowInputDTO](../../../../../types/interfaces/types.UpdateLineItemInCartWorkflowInputDTO/page.mdx) & [AdditionalData](../../../../../types/HttpTypes/types/types.HttpTypes.AdditionalData/page.mdx)","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart_id","type":"`string`","description":"The ID of the cart that the line item belongs to.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_id","type":"`string`","description":"The ID of the line item to update.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"update","type":"Partial<[UpdateLineItemDTO](../../../../../cart/interfaces/cart.UpdateLineItemDTO/page.mdx)>","description":"The details to update in the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"additional_data","type":"`Record<string, unknown>`","description":"Additional data that can be passed through the `additional_data` property in HTTP requests.\n\nLearn more in [this documentation](https://docs.medusajs.com/learn/fundamentals/api-routes/additional-data).","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validate"/>
|
||||
|
||||
### setPricingContext
|
||||
|
||||
@@ -242,7 +243,7 @@ updateLineItemInCartWorkflow.hooks.setPricingContext(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-20)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"[CartLineItemDTO](../../../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)","description":"The cart line item details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_original_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_original_subtotal","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_original_tax_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_item_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_item_subtotal","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_item_tax_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_subtotal","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw subtotal of the cart line item.","optional":fLine truncated
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-22)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item","type":"[CartLineItemDTO](../../../../../cart/interfaces/cart.CartLineItemDTO/page.mdx)","description":"The cart line item details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"item_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_original_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw original total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_original_subtotal","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw original subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_original_tax_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw original tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_item_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw item total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_item_subtotal","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw item subtotal of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_item_tax_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw item tax total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_total","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw total of the cart line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"raw_subtotal","type":"[BigNumberRawValue](../../../../../cart/types/cart.BigNumberRawValue/page.mdx)","description":"The raw subtotal of the cart line item.","optional":fLine truncated
|
||||
|
||||
## Emitted Events
|
||||
|
||||
|
||||
+3
-2
@@ -4,6 +4,7 @@ sidebar_label: updateTaxLinesWorkflow
|
||||
sidebar_description: Update a cart's tax lines.
|
||||
tags:
|
||||
- remote query
|
||||
- locking
|
||||
- tax
|
||||
- cart
|
||||
- workflow
|
||||
@@ -20,7 +21,7 @@ by the [Calculate Taxes Store API Route](https://docs.medusajs.com/api/store#car
|
||||
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to update a cart's tax lines in your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L123" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L124" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -129,7 +130,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateTaxLinesWorkflow","steps":[{"type":"when","condition":"{\n return !input.cart\n }","depth":"1","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1}]},{"type":"step","name":"getItemTaxLinesStep","description":"This step retrieves the tax lines for an order or cart's line items and shipping methods.\n\n:::note\n\nYou can retrieve an order, cart, item, shipping method, and address details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../../../../Tax/Steps_Tax/functions/core_flows.Tax.Steps_Tax.getItemTaxLinesStep/page.mdx","depth":2},{"type":"step","name":"setTaxLinesForItemsStep","description":"This step sets the tax lines of shipping methods and line items in a cart.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.setTaxLinesForItemsStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateTaxLinesWorkflow","steps":[{"type":"when","condition":"{\n return !input.cart\n }","depth":"1","steps":[{"type":"step","name":"useRemoteQueryStep","description":"This step fetches data across modules using the remote query.\n\nLearn more in the [Remote Query documentation](https://docs.medusajs.com/learn/fundamentals/module-links/query).\n\n:::note\n\nThis step is deprecated. Use [useQueryGraphStep](../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useQueryGraphStep/page.mdx) instead.\n\n:::","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.useRemoteQueryStep/page.mdx","depth":1}]},{"type":"step","name":"acquireLockStep","description":"This step acquires a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.acquireLockStep/page.mdx","depth":2},{"type":"step","name":"getItemTaxLinesStep","description":"This step retrieves the tax lines for an order or cart's line items and shipping methods.\n\n:::note\n\nYou can retrieve an order, cart, item, shipping method, and address details using [Query](https://docs.medusajs.com/learn/fundamentals/module-links/query),\nor [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-workflows/steps/useQueryGraphStep).\n\n:::","link":"../../../../Tax/Steps_Tax/functions/core_flows.Tax.Steps_Tax.getItemTaxLinesStep/page.mdx","depth":3},{"type":"step","name":"setTaxLinesForItemsStep","description":"This step sets the tax lines of shipping methods and line items in a cart.\n\n:::tip\n\nYou can use the [retrieveCartStep](../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.retrieveCartStep/page.mdx) to retrieve a cart's details.\n\n:::","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.setTaxLinesForItemsStep/page.mdx","depth":4},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. Learn more about locks in the [Locking Module](https://docs.medusajs.com/resources/infrastructure-modules/locking)\nguide.","link":"../../../../Locking/Steps_Locking/functions/core_flows.Locking.Steps_Locking.releaseLockStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ manage links within your custom flows.
|
||||
|
||||
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/common/workflows/batch-links.ts#L67" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/common/workflows/batch-links.ts#L67" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ create links within your custom flows.
|
||||
|
||||
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/common/workflows/create-links.ts#L38" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/common/workflows/create-links.ts#L38" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ dismiss links within your custom flows.
|
||||
|
||||
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/common/workflows/dismiss-links.ts#L38" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/common/workflows/dismiss-links.ts#L38" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ update links within your custom flows.
|
||||
|
||||
Learn more about links in [this documentation](https://docs.medusajs.com/learn/fundamentals/module-links/link).
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ Learn more about basic authentication flows in [this documentation](https://docs
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
register or create customer accounts within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ allows you to create custom data models linked to the addresses.
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customer addresses.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ This workflow has a hook that allows you to perform custom actions on the create
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around creating customers.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/create-customers.ts#L54" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/create-customers.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ relevant to that module.
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
delete customer addresses in your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ This workflow deletes one or more customers. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
delete customers in your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -29,7 +29,7 @@ custom actions after the customers are deleted.
|
||||
|
||||
:::
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ allows you to update custom data models linked to the addresses.
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customer addresses.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ custom data models linked to the customers.
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around updating customers.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createCustomerGroupsStep({
|
||||
"name": "Bradford"
|
||||
"name": "Fay"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ You can use this workflow within your customizations or your own custom workflow
|
||||
create customer groups within your custom flows. For example, you can create customer groups to segregate
|
||||
customers by age group or purchase habits.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer-group/workflows/create-customer-groups.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer-group/workflows/create-customer-groups.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow deletes one or more customer groups. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
delete customer groups within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer-group/workflows/delete-customer-groups.ts#L34" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer-group/workflows/delete-customer-groups.ts#L34" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow manages the customer groups a customer is in. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
manage the customer groups of a customer in your custom flow.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer-group/workflows/link-customer-groups-customer.ts#L37" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer-group/workflows/link-customer-groups-customer.ts#L37" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow manages the customers of a customer group. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
manage the customers of a customer group within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer-group/workflows/link-customers-customer-group.ts#L37" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer-group/workflows/link-customers-customer-group.ts#L37" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow updates one or more customer groups. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
update customer groups within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/customer-group/workflows/update-customer-groups.ts#L57" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/customer-group/workflows/update-customer-groups.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ to create the default data, if not existing, when the application is first start
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
create default data within your custom flows, such as seed scripts.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ This workflow adds items to a draft order. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding items to
|
||||
a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow adds promotions to a draft order. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding promotions to
|
||||
a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ This workflow adds shipping methods to a draft order. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around adding shipping methods to
|
||||
a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L99" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L99" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ The draft order edit can later be requested using [requestDraftOrderEditWorkflow
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
creating a draft order edit request.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow cancels a draft order edit. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
cancelling a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ This workflow confirms a draft order edit. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
confirming a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L59" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = convertDraftOrderStep({
|
||||
"id": "id_Z9SbqVSAUJ"
|
||||
"id": "id_DnlXejaChZ"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow converts a draft order to a pending order. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
converting a draft order to a pending order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ This workflow deletes draft orders. It's used by the [Delete Draft Order API rou
|
||||
|
||||
You can also use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around deleting a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow removes an item that was added or updated in a draft order edit. I
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing an item from a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow removes a shipping method that was added to an edited draft order.
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing a shipping method from an edited draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow removes promotions from a draft order edit. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing promotions from a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow removes an existing shipping method from a draft order edit. It's
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
removing a shipping method from a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L60" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L60" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ This workflow requests a draft order edit. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
requesting a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow updates a new item that was added to a draft order edit. It's used
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating a new item in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow updates a new shipping method that was added to a draft order edit
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating a new shipping method in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow updates an item in a draft order edit. It's used by the
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating an item in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ This workflow updates an existing shipping method in a draft order edit. It's us
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating an existing shipping method in a draft order edit.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ using [requestDraftOrderEditWorkflow](../core_flows.Draft_Order.Workflows_Draft_
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to wrap custom logic around
|
||||
updating a draft order.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ in your application will be used to delete the file from storage.
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
delete files within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -20,7 +20,7 @@ This workflow uploads one or more files using the installed
|
||||
You can use this workflow within your customizations or your own custom workflows, allowing you to
|
||||
upload files within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createFulfillmentSets({
|
||||
"name": "Kraig",
|
||||
"name": "Dewitt",
|
||||
"type": "{value}"
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createServiceZonesStep({
|
||||
"name": "Lilliana",
|
||||
"name": "Dan",
|
||||
"fulfillment_set_id": "{value}"
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ const myWorkflow = createWorkflow(
|
||||
const data = createShippingOptionRulesStep({
|
||||
"data": [{
|
||||
"attribute": "{value}",
|
||||
"operator": "lte",
|
||||
"operator": "eq",
|
||||
"value": "{value}",
|
||||
"shipping_option_id": "{value}"
|
||||
}]
|
||||
|
||||
+3
-3
@@ -29,10 +29,10 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createShippingOptionsPriceSetsStep({
|
||||
"id": "id_wCIcUqWmRY8",
|
||||
"id": "id_Lmq4SLkLihux",
|
||||
"prices": [{
|
||||
"currency_code": "kyd",
|
||||
"amount": 28
|
||||
"currency_code": "jpy",
|
||||
"amount": 11
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createShippingProfilesStep({
|
||||
"name": "Brant",
|
||||
"name": "Chyna",
|
||||
"type": "{value}"
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ const myWorkflow = createWorkflow(
|
||||
() => {
|
||||
const data = deleteShippingOptionRulesStep({
|
||||
"ids": [
|
||||
"id_emQPYK88xAxutjqSJiv"
|
||||
"id_Rf4SedSrdgaAuQ288Gd"
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow manages shipping option rules allowing you to create, update, or d
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
manage shipping option rules within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts#L76" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts#L76" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ This depends on the implementation of the fulfillment provider associated with t
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
calculate the prices of shipping options within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/calculate-shipping-options-prices.ts#L49" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/calculate-shipping-options-prices.ts#L49" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow cancels a fulfillment. It's used by the
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
cancel a fulfillment within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/cancel-fulfillment.ts#L34" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/cancel-fulfillment.ts#L34" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-wor
|
||||
|
||||
:::
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-fulfillment.ts#L64" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/create-fulfillment.ts#L64" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ or [useQueryGraphStep](https://docs.medusajs.com/resources/references/medusa-wor
|
||||
|
||||
:::
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-return-fulfillment.ts#L65" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/create-return-fulfillment.ts#L65" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow creates one or more service zones. It's used by the
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
create service zones within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-service-zones.ts#L45" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/create-service-zones.ts#L45" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow creates shipments for a fulfillment. It's used by the
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
create shipments within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-shipment.ts#L38" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/create-shipment.ts#L38" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ This workflow creates one or more shipping options. It's used by the
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
create shipping options within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-shipping-options.ts#L96" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/create-shipping-options.ts#L96" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ This workflow creates one or more shipping profiles. It's used by the
|
||||
You can use this workflow within your own customizations or custom workflows, allowing you to
|
||||
create shipping profiles within your custom flows.
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/e90dcedcd7627c61ed1a823400f734d624eaee05/packages/core/core-flows/src/fulfillment/workflows/create-shipping-profiles.ts#L35" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/a503bbe5963f95710f599c466dfb2c3956914e06/packages/core/core-flows/src/fulfillment/workflows/create-shipping-profiles.ts#L35" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
Loaded 100 of 528 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user