chore(docs): Generated References (automated) (#13921)
* chore(docs): Generated References (automated) * fix error + generate references --------- Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
This commit is contained in:
887 files changed
+441941
-433106
No files matched your search
File diff suppressed because it is too large.
Load diff
@@ -12971,6 +12971,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batch/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batch"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batchImageVariants/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batchImageVariants"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batchVariantImages/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batchVariantImages"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batchVariantInventoryItems/page.mdx",
|
||||
"pathname": "/references/js_sdk/admin/Product/methods/js_sdk.admin.Product.batchVariantInventoryItems"
|
||||
@@ -16875,6 +16883,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/product/IModuleService/methods/product.IModuleService.__joinerConfig/page.mdx",
|
||||
"pathname": "/references/product/IModuleService/methods/product.IModuleService.__joinerConfig"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.addImageToVariant/page.mdx",
|
||||
"pathname": "/references/product/IProductModuleService/methods/product.IProductModuleService.addImageToVariant"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.createProductCategories/page.mdx",
|
||||
"pathname": "/references/product/IProductModuleService/methods/product.IProductModuleService.createProductCategories"
|
||||
@@ -17003,6 +17015,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.listProducts/page.mdx",
|
||||
"pathname": "/references/product/IProductModuleService/methods/product.IProductModuleService.listProducts"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.removeImageFromVariant/page.mdx",
|
||||
"pathname": "/references/product/IProductModuleService/methods/product.IProductModuleService.removeImageFromVariant"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.restoreProductCategories/page.mdx",
|
||||
"pathname": "/references/product/IProductModuleService/methods/product.IProductModuleService.restoreProductCategories"
|
||||
@@ -17503,6 +17519,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/product_models/variables/product_models.ProductVariant/page.mdx",
|
||||
"pathname": "/references/product_models/variables/product_models.ProductVariant"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/product_models/variables/product_models.ProductVariantProductImage/page.mdx",
|
||||
"pathname": "/references/product_models/variables/product_models.ProductVariantProductImage"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/promotion/IBigNumber/methods/promotion.IBigNumber.toJSON/page.mdx",
|
||||
"pathname": "/references/promotion/IBigNumber/methods/promotion.IBigNumber.toJSON"
|
||||
@@ -19343,6 +19363,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.HttpCompressionOptions/page.mdx",
|
||||
"pathname": "/references/types/CommonTypes/interfaces/types.CommonTypes.HttpCompressionOptions"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.MedusaCloudOptions/page.mdx",
|
||||
"pathname": "/references/types/CommonTypes/interfaces/types.CommonTypes.MedusaCloudOptions"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/CommonTypes/interfaces/types.CommonTypes.ModuleImplementations/page.mdx",
|
||||
"pathname": "/references/types/CommonTypes/interfaces/types.CommonTypes.ModuleImplementations"
|
||||
@@ -19851,6 +19875,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchCreateInventoryItemsLocationLevels/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchCreateInventoryItemsLocationLevels"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchImageVariantRequest/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchImageVariantRequest"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchImageVariantResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchImageVariantResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchInventoryItemLocationLevels/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchInventoryItemLocationLevels"
|
||||
@@ -19911,6 +19943,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchUpdateProductVariant/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchUpdateProductVariant"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchVariantImagesRequest/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchVariantImagesRequest"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchVariantImagesResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminBatchVariantImagesResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCampaign/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCampaign"
|
||||
@@ -19939,6 +19979,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminClaim/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminClaim"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminClaimActionsParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminClaimActionsParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminClaimAddInboundShipping/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminClaimAddInboundShipping"
|
||||
@@ -20099,6 +20143,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateInventoryItem/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateInventoryItem"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateOrderCreditLine/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateOrderCreditLine"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateOrderFulfillment/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateOrderFulfillment"
|
||||
@@ -20215,6 +20263,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateTaxRate/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateTaxRate"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateTaxRateRule/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateTaxRateRule"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateTaxRegion/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminCreateTaxRegion"
|
||||
@@ -20407,10 +20459,6 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProvider/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProvider"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProviderListParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProviderListParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProviderListResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentProviderListResponse"
|
||||
@@ -20435,6 +20483,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentSetDeleteResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentSetDeleteResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentSetListParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentSetListParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentSetResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminFulfillmentSetResponse"
|
||||
@@ -20471,6 +20523,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetInvitesParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetInvitesParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderDetailsParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderDetailsParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderShippingOptionList/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminGetOrderShippingOptionList"
|
||||
@@ -20535,6 +20595,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductsResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminImportProductsResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminIndexDetailsResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminIndexDetailsResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminIndexSyncPayload/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminIndexSyncPayload"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInitiateOrderEditRequest/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInitiateOrderEditRequest"
|
||||
@@ -20551,14 +20619,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItem"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItemParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItemParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItemResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItemResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItemsParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryItemsParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminInventoryLevel"
|
||||
@@ -20639,6 +20707,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderEditResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderExchangeListParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderExchangeListParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderFilters/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminOrderFilters"
|
||||
@@ -20823,6 +20895,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminProductDeleteResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminProductExportParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminProductExportParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.AdminProductImage"
|
||||
@@ -21979,6 +22055,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.StoreProductVariantParams/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.StoreProductVariantParams"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.StoreProductVariantResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.StoreProductVariantResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/interfaces/types.HttpTypes.StorePromotion/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/interfaces/types.HttpTypes.StorePromotion"
|
||||
@@ -22379,6 +22459,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/types/types.HttpTypes.StoreProductStatus/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/types/types.HttpTypes.StoreProductStatus"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/types/types.HttpTypes.StoreProductVariantListResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/types/types.HttpTypes.StoreProductVariantListResponse"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/HttpTypes/types/types.HttpTypes.StoreRegionListResponse/page.mdx",
|
||||
"pathname": "/references/types/HttpTypes/types/types.HttpTypes.StoreRegionListResponse"
|
||||
@@ -22407,6 +22491,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/IndexTypes/interfaces/types.IndexTypes.IIndexService/page.mdx",
|
||||
"pathname": "/references/types/IndexTypes/interfaces/types.IndexTypes.IIndexService"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/IndexTypes/interfaces/types.IndexTypes.IndexInfo/page.mdx",
|
||||
"pathname": "/references/types/IndexTypes/interfaces/types.IndexTypes.IndexInfo"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/IndexTypes/interfaces/types.IndexTypes.IndexModuleOptions/page.mdx",
|
||||
"pathname": "/references/types/IndexTypes/interfaces/types.IndexTypes.IndexModuleOptions"
|
||||
@@ -23503,10 +23591,6 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/enums/types.ClaimReason/page.mdx",
|
||||
"pathname": "/references/types/enums/types.ClaimReason"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/enums/types.ExchangeReason/page.mdx",
|
||||
"pathname": "/references/types/enums/types.ExchangeReason"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.AddToCartWorkflowInputDTO/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.AddToCartWorkflowInputDTO"
|
||||
@@ -23551,18 +23635,10 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.AdminCreateShippingOptionBase/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.AdminCreateShippingOptionBase"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.AdminCreateTaxRateRule/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.AdminCreateTaxRateRule"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.AdminDeleteProductVariantInventoryItem/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.AdminDeleteProductVariantInventoryItem"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.AdminExchangeAddItems/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.AdminExchangeAddItems"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.AdminExchangeAddShippingMethod/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.AdminExchangeAddShippingMethod"
|
||||
@@ -24347,6 +24423,14 @@ export const filesMap = [
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.RemoteNestedExpands/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.RemoteNestedExpands"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.RetrieveAccountHolderInput/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.RetrieveAccountHolderInput"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.RetrieveAccountHolderOutput/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.RetrieveAccountHolderOutput"
|
||||
},
|
||||
{
|
||||
"filePath": "/www/apps/resources/references/types/interfaces/types.RetrievePaymentInput/page.mdx",
|
||||
"pathname": "/references/types/interfaces/types.RetrievePaymentInput"
|
||||
|
||||
@@ -12687,6 +12687,15 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
|
||||
"title": "Methods",
|
||||
"autogenerate_path": "/references/product/IProductModuleService/methods",
|
||||
"children": [
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"type": "link",
|
||||
"path": "/references/product/addImageToVariant",
|
||||
"title": "addImageToVariant",
|
||||
"description": "",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
@@ -12975,6 +12984,15 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
|
||||
"description": "",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"type": "link",
|
||||
"path": "/references/product/removeImageFromVariant",
|
||||
"title": "removeImageFromVariant",
|
||||
"description": "",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
@@ -13437,6 +13455,15 @@ const generatedgeneratedCommerceModulesSidebarSidebar = {
|
||||
"title": "ProductVariant",
|
||||
"description": "",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"loaded": true,
|
||||
"isPathHref": true,
|
||||
"type": "link",
|
||||
"path": "/references/product/models/ProductVariantProductImage",
|
||||
"title": "ProductVariantProductImage",
|
||||
"description": "",
|
||||
"children": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -6519,6 +6519,11 @@ export const slugChanges = [
|
||||
"newSlug": "/references/pricing/models/PriceSet",
|
||||
"filePath": "/www/apps/resources/references/pricing_models/variables/pricing_models.PriceSet/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/product/IProductModuleService/methods/product.IProductModuleService.addImageToVariant",
|
||||
"newSlug": "/references/product/addImageToVariant",
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.addImageToVariant/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/product/IProductModuleService/methods/product.IProductModuleService.createProductCategories",
|
||||
"newSlug": "/references/product/createProductCategories",
|
||||
@@ -6679,6 +6684,11 @@ export const slugChanges = [
|
||||
"newSlug": "/references/product/listProducts",
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.listProducts/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/product/IProductModuleService/methods/product.IProductModuleService.removeImageFromVariant",
|
||||
"newSlug": "/references/product/removeImageFromVariant",
|
||||
"filePath": "/www/apps/resources/references/product/IProductModuleService/methods/product.IProductModuleService.removeImageFromVariant/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/product/IProductModuleService/methods/product.IProductModuleService.restoreProductCategories",
|
||||
"newSlug": "/references/product/restoreProductCategories",
|
||||
@@ -6924,6 +6934,11 @@ export const slugChanges = [
|
||||
"newSlug": "/references/product/models/ProductVariant",
|
||||
"filePath": "/www/apps/resources/references/product_models/variables/product_models.ProductVariant/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/product_models/variables/product_models.ProductVariantProductImage",
|
||||
"newSlug": "/references/product/models/ProductVariantProductImage",
|
||||
"filePath": "/www/apps/resources/references/product_models/variables/product_models.ProductVariantProductImage/page.mdx"
|
||||
},
|
||||
{
|
||||
"origSlug": "/references/promotion/IPromotionModuleService/methods/promotion.IPromotionModuleService.addPromotionBuyRules",
|
||||
"newSlug": "/references/promotion/addPromotionBuyRules",
|
||||
|
||||
+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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/api-key/src/models/api-key.ts#L3" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/auth/src/models/auth-identity.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/auth/src/models/provider-identity.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/address.ts#L3" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/cart.ts#L7" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/credit-line.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/line-item.ts#L6" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/line-item-adjustment.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/line-item-tax-line.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/shipping-method.ts#L6" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/shipping-method-adjustment.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/bafd0060946049bc2cd1490ef26b7ed2650c561f/packages/modules/cart/src/models/shipping-method-tax-line.ts#L4" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/api-key/workflows/create-api-keys.ts#L51" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/api-key/workflows/delete-api-keys.ts#L36" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/api-key/workflows/link-sales-channels-to-publishable-key.ts#L39" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/api-key/workflows/revoke-api-keys.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/api-key/workflows/update-api-keys.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+2
-6
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/auth/workflows/generate-reset-password-token.ts#L43" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -148,7 +148,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"generateResetPasswordTokenWorkflow","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":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":2}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"generateResetPasswordTokenWorkflow","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":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":2}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -162,12 +162,8 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createCartsStep({
|
||||
"currency_code": "dzd"
|
||||
"currency_code": "cve"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
-6
@@ -2,8 +2,6 @@
|
||||
slug: /references/medusa-workflows/steps/findOneOrAnyRegionStep
|
||||
sidebar_label: findOneOrAnyRegionStep
|
||||
tags:
|
||||
- region
|
||||
- store
|
||||
- step
|
||||
---
|
||||
|
||||
@@ -31,7 +29,3 @@ const myWorkflow = createWorkflow(
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"FindOneOrAnyRegionStepInput","type":"[FindOneOrAnyRegionStepInput](../../../../types/core_flows.FindOneOrAnyRegionStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the region to find.","expandable":false,"children":[{"name":"regionId","type":"`string`","description":"The ID of the region to find.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="findOneOrAnyRegionStep"/>
|
||||
|
||||
## Output
|
||||
|
||||
<TypeList types={[{"name":"RegionDTO","type":"[RegionDTO](../../../../../region/interfaces/region.RegionDTO/page.mdx)","optional":false,"defaultValue":"","description":"The region details.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Setting to indicate whether taxes need to be applied automatically","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[RegionCountryDTO](../../../../../region/interfaces/region.RegionCountryDTO/page.mdx)[]","description":"The countries of the region.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"iso_2","type":"`string`","description":"The ISO 2 code of the country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"iso_3","type":"`string`","description":"The ISO 3 code of the country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"num_code","type":"`string`","description":"The country's code number.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the country.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"display_name","type":"`string`","description":"The display name of the country.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"payment_providers","type":"[PaymentProviderDTO](../../../../../region/interfaces/region.PaymentProviderDTO/page.mdx)[]","description":"Payment providers available in the region","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the payment provider.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_enabled","type":"`boolean`","description":"Whether the payment provider is enabled.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, any>`","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" openedLevel={1} sectionTitle="findOneOrAnyRegionStep"/>
|
||||
-2
@@ -2,8 +2,6 @@
|
||||
slug: /references/medusa-workflows/steps/findSalesChannelStep
|
||||
sidebar_label: findSalesChannelStep
|
||||
tags:
|
||||
- sales channel
|
||||
- store
|
||||
- step
|
||||
---
|
||||
|
||||
|
||||
-1
@@ -2,7 +2,6 @@
|
||||
slug: /references/medusa-workflows/steps/getPromotionCodesToApply
|
||||
sidebar_label: getPromotionCodesToApply
|
||||
tags:
|
||||
- promotion
|
||||
- step
|
||||
---
|
||||
|
||||
|
||||
-4
@@ -1,10 +1,6 @@
|
||||
---
|
||||
slug: /references/medusa-workflows/steps/getVariantPriceSetsStep
|
||||
sidebar_label: getVariantPriceSetsStep
|
||||
tags:
|
||||
- pricing
|
||||
- query
|
||||
- step
|
||||
---
|
||||
|
||||
import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
+1
-1
@@ -27,4 +27,4 @@ const data = getVariantsStep({
|
||||
|
||||
## Output
|
||||
|
||||
<TypeList types={[{"name":"ProductVariantDTO[]","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","optional":false,"defaultValue":"","expandable":true,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option was created.","optional":false,"defaultVLine truncated
|
||||
<TypeList types={[{"name":"ProductVariantDTO[]","type":"[ProductVariantDTO](../../../../../product/interfaces/product.ProductVariantDTO/page.mdx)[]","optional":false,"defaultValue":"","description":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The tile of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"sku","type":"`null` \\| `string`","description":"The SKU of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"barcode","type":"`null` \\| `string`","description":"The barcode of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"ean","type":"`null` \\| `string`","description":"The EAN of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"upc","type":"`null` \\| `string`","description":"The UPC of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"allow_backorder","type":"`boolean`","description":"Whether the product variant can be ordered when it's out of stock.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"manage_inventory","type":"`boolean`","description":"Whether the product variant's inventory should be managed by the core system.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`null` \\| `string`","description":"The thumbnail of the product variant form the product images.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the product variant's requires shipping.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"hs_code","type":"`null` \\| `string`","description":"The HS Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"origin_country","type":"`null` \\| `string`","description":"The origin country of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mid_code","type":"`null` \\| `string`","description":"The MID Code of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"material","type":"`null` \\| `string`","description":"The material of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"weight","type":"`null` \\| `number`","description":"The weight of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"length","type":"`null` \\| `number`","description":"The length of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"height","type":"`null` \\| `number`","description":"The height of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"width","type":"`null` \\| `number`","description":"The width of the product variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"options","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product options.","optional":false,"defaultValue":"","expandable":true,"children":[{"name":"id","type":"`string`","description":"The ID of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"value","type":"`string`","description":"The value of the product option value.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"When the product option value was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"When the product option value was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option","type":"`null` \\| [ProductOptionDTO](../../../../../product/interfaces/product.ProductOptionDTO/page.mdx)","description":"The associated product option. It may only be available if the `option` relation is expanded.","optional":true,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the product option.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"values","type":"[ProductOptionValueDTO](../../../../../product/interfaces/product.ProductOptionValueDTO/page.mdx)[]","description":"The associated product option values.","Line truncated
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
slug: /references/medusa-workflows/steps/prepareAdjustmentsFromPromotionActionsStep
|
||||
sidebar_label: prepareAdjustmentsFromPromotionActionsStep
|
||||
tags:
|
||||
- promotion
|
||||
- query
|
||||
- step
|
||||
---
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = retrieveCartStep({
|
||||
"id": "id_wm73qa502E9os"
|
||||
"id": "id_6yfdwvd7Ql5VCMXKbx"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-2
@@ -4,7 +4,6 @@ sidebar_label: updateCartPromotionsStep
|
||||
tags:
|
||||
- link
|
||||
- remote query
|
||||
- promotion
|
||||
- step
|
||||
---
|
||||
|
||||
@@ -24,7 +23,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = updateCartPromotionsStep({
|
||||
"id": "id_6YN7cmJWHDhP"
|
||||
"id": "id_rjYDM9OtxDGnbG1FBd"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+1
-1
@@ -70,7 +70,7 @@ const data = validateAndReturnShippingMethodsDataStep({
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"ValidateShippingMethodsDataInput","type":"[ValidateShippingMethodsDataInput](../../../../types/core_flows.ValidateShippingMethodsDataInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping methods to validate.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The shipping method's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The fulfillment provider ID that associated with the shipping option\nthat the method was created from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option_data","type":"`Record<string, unknown>`","description":"The `data` property of the shipping option that the shipping method was \ncreated from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"method_data","type":"`Record<string, unknown>`","description":"The `data` property of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[ValidateFulfillmentDataContext](../../../../../types/types/types.ValidateFulfillmentDataContext/page.mdx)","description":"The context to validate the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"[CartDTO](../../../../../fulfillment/interfaces/fulfillment.CartDTO/page.mdx)[`\"id\"`]","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[CartDTO](../../../../../fulfillment/interfaces/fulfillment.CartDTO/page.mdx)[`\"shipping_address\"`]","description":"The cart's shipping address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CartDTO](../../../../../fulfillment/interfaces/fulfillment.CartDTO/page.mdx)[`\"items\"`] & `object`","description":"The cart's items","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant","type":"`object`","description":"The item's variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`object`","description":"The item's product.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"from_location","type":"[StockLocationDTO](../../../../../types/StockLocationTypes/types/types.StockLocationTypes.StockLocationDTO/page.mdx)","description":"Details about the location that items are being shipped from.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_id","type":"`string`","description":"The associated address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_sets","type":"[FulfillmentSetDTO](../../../../../fulfillment/interfaces/fulfillment.FulfillmentSetDTO/page.mdx)[]","description":"Fulfillment sets for the location","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date` \\| `null`","description":"The deletion date of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address","type":"[StockLocationAddressDTO](../../../../../types/StockLocationTypes/types/types.StockLocationTypes.StockLocationAddressDTO/page.mdx)","description":"The address of the stock location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validateAndReturnShippingMethodsDataStep"/>
|
||||
<TypeList types={[{"name":"ValidateShippingMethodsDataInput","type":"[ValidateShippingMethodsDataInput](../../../../types/core_flows.ValidateShippingMethodsDataInput/page.mdx)","optional":false,"defaultValue":"","description":"The details of the shipping methods to validate.","expandable":false,"children":[{"name":"id","type":"`string`","description":"The shipping method's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"provider_id","type":"`string`","description":"The fulfillment provider ID that associated with the shipping option\nthat the method was created from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"option_data","type":"`Record<string, unknown>`","description":"The `data` property of the shipping option that the shipping method was\ncreated from.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"method_data","type":"`Record<string, unknown>`","description":"The `data` property of the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"context","type":"[ValidateFulfillmentDataContext](../../../../../types/types/types.ValidateFulfillmentDataContext/page.mdx)","description":"The context to validate the shipping method.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"[CartDTO](../../../../../fulfillment/interfaces/fulfillment.CartDTO/page.mdx)[`\"id\"`]","description":"The cart's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"[CartDTO](../../../../../fulfillment/interfaces/fulfillment.CartDTO/page.mdx)[`\"shipping_address\"`]","description":"The cart's shipping address.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CartDTO](../../../../../fulfillment/interfaces/fulfillment.CartDTO/page.mdx)[`\"items\"`] & `object`","description":"The cart's items","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"variant","type":"`object`","description":"The item's variant.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"product","type":"`object`","description":"The item's product.","optional":false,"defaultValue":"","expandable":false,"children":[]}]},{"name":"from_location","type":"[StockLocationDTO](../../../../../types/StockLocationTypes/types/types.StockLocationTypes.StockLocationDTO/page.mdx)","description":"Details about the location that items are being shipped from.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>` \\| `null`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address_id","type":"`string`","description":"The associated address's ID.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"fulfillment_sets","type":"[FulfillmentSetDTO](../../../../../fulfillment/interfaces/fulfillment.FulfillmentSetDTO/page.mdx)[]","description":"Fulfillment sets for the location","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string` \\| `Date`","description":"The creation date of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string` \\| `Date`","description":"The update date of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"deleted_at","type":"`string` \\| `Date` \\| `null`","description":"The deletion date of the stock location.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"address","type":"[StockLocationAddressDTO](../../../../../types/StockLocationTypes/types/types.StockLocationTypes.StockLocationAddressDTO/page.mdx)","description":"The address of the stock location.","optional":true,"defaultValue":"","expandable":false,"children":[]}]}]}]}]} expandUrl="https://docs.medusajs.com/learn/fundamentals/data-models/manage-relationships#retrieve-records-of-relation" openedLevel={1} sectionTitle="validateAndReturnShippingMethodsDataStep"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+2
-7
@@ -10,7 +10,6 @@ tags:
|
||||
- event bus
|
||||
- workflow
|
||||
- query
|
||||
- pricing
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
@@ -29,7 +28,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L83" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/add-shipping-method-to-cart.ts#L83" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -178,7 +177,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<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}]}} />
|
||||
<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":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","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
|
||||
|
||||
@@ -216,12 +215,8 @@ Handlers consuming this hook accept the following input.
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+5
-10
@@ -4,17 +4,16 @@ sidebar_label: addToCartWorkflow
|
||||
sidebar_description: Add a line item to a cart.
|
||||
tags:
|
||||
- locking
|
||||
- query
|
||||
- pricing
|
||||
- cart
|
||||
- event bus
|
||||
- workflow
|
||||
- inventory
|
||||
- query
|
||||
- fulfillment
|
||||
- remote query
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
- remote query
|
||||
- payment
|
||||
- logger
|
||||
---
|
||||
@@ -31,7 +30,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L117" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/add-to-cart.ts#L114" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -180,7 +179,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 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
|
||||
<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":"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":"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 an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":11},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":12},{"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":12}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -267,18 +266,14 @@ addToCartWorkflow.hooks.setPricingContext(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-2)","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":"variantIds","type":"(`undefined` \\| `string`)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CreateCartCreateLineItemDTO](../../../../../types/interfaces/types.CreateCartCreateLineItemDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant to be added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`string`","description":"The subtitle of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`string`","description":"The thumbnail URL of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the product whose variant is being added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"`string`","description":"The title of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"`string`","description":"The description of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"`string`","description":"The subtitle of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"`string`","description":"The ID of the associated product's type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_collection","type":"`string`","description":"The ID of the associated product's collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_handle","type":"`string`","description":"The handle of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_sku","type":"`string`","description":"The SKU of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_barcode","type":"`string`","description":"The barcode of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_title","type":"`string`","description":"The title of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_option_values","type":"`Record<string, unknown>`","description":"The associated variant's values for the product's options.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the line item requires shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`boolean`","description":"Whether the line item is discountable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`boolean`","description":"Whether the line item's price is tax inclusive. Learn more in\n[this documentation](https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing)","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the line item is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compare_at_unit_price","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The original price of the item before a promotion or sale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The price of a single quantity of the item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs related to the item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefLine truncated
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-2)","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":"variantIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CreateCartCreateLineItemDTO](../../../../../types/interfaces/types.CreateCartCreateLineItemDTO/page.mdx)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"quantity","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The quantity of the line item.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_id","type":"`string`","description":"The ID of the variant to be added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"title","type":"`string`","description":"The title of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"subtitle","type":"`string`","description":"The subtitle of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"thumbnail","type":"`string`","description":"The thumbnail URL of the line item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_id","type":"`string`","description":"The ID of the product whose variant is being added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_title","type":"`string`","description":"The title of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_description","type":"`string`","description":"The description of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_subtitle","type":"`string`","description":"The subtitle of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_type","type":"`string`","description":"The ID of the associated product's type.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_collection","type":"`string`","description":"The ID of the associated product's collection.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"product_handle","type":"`string`","description":"The handle of the associated product.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_sku","type":"`string`","description":"The SKU of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_barcode","type":"`string`","description":"The barcode of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_title","type":"`string`","description":"The title of the associated variant.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"variant_option_values","type":"`Record<string, unknown>`","description":"The associated variant's values for the product's options.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"requires_shipping","type":"`boolean`","description":"Whether the line item requires shipping.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_discountable","type":"`boolean`","description":"Whether the line item is discountable.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_tax_inclusive","type":"`boolean`","description":"Whether the line item's price is tax inclusive. Learn more in\n[this documentation](https://docs.medusajs.com/resources/commerce-modules/pricing/tax-inclusive-pricing)","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"is_giftcard","type":"`boolean`","description":"Whether the line item is a gift card.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"compare_at_unit_price","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The original price of the item before a promotion or sale.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"unit_price","type":"[BigNumberInput](../../../../../types/types/types.BigNumberInput/page.mdx)","description":"The price of a single quantity of the item.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Custom key-value pairs related to the item.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"additional_data","type":"`Record<string, unknown> | undefined`","descriptioLine truncated
|
||||
|
||||
## Emitted Events
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+2
-6
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L94" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/complete-cart.ts#L93" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -137,7 +137,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","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":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`. If 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.validateCartPaymentsStep/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":"when","condition":"{\n return !orderId\n }","depth":"5","steps":[{"type":"step","name":"validateShippingStep","description":"This step validates shipping data when cart is completed.\n\nIt ensures that a shipping method is selected if there is an item in the cart that requires shipping.\nIt also ensures that product's shipping profile mathes the selected shipping options. If the\nconditions are not met, an error is thrown.\n\n:::note\n\nYou can retrieve cart or shipping option's 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":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateShippingStep/page.mdx","depth":5},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrdersStep/page.mdx","depth":5},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/fundamentals/module-links/remote-link#create-link).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.createRemoteLinkStep/page.mdx","depth":5},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":5},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":5},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.","link":"../../../../Payment/Steps_Payment/functions/core_flows.Payment.Steps_Payment.authorizePaymentSessionStep/page.mdx","depth":5},{"type":"step","name":"addOrderTransactionStep","description":"This step creates order transactions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.addOrderTransactionStep/page.mdx","depth":5}]},{"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":6}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"completeCartWorkflow","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":"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":"validateCartPaymentsStep","description":"This step validates a cart's payment sessions. Their status must\nbe `pending` or `requires_more`. If 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.validateCartPaymentsStep/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":"when","condition":"{\n return !orderId\n }","depth":"5","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":5},{"type":"step","name":"validateShippingStep","description":"This step validates shipping data when cart is completed.\n\nIt ensures that a shipping method is selected if there is an item in the cart that requires shipping.\nIt also ensures that product's shipping profile mathes the selected shipping options. If the\nconditions are not met, an error is thrown.\n\n:::note\n\nYou can retrieve cart or shipping option's 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":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.validateShippingStep/page.mdx","depth":5},{"type":"step","name":"createOrdersStep","description":"This step creates one or more orders.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrdersStep/page.mdx","depth":5},{"type":"step","name":"createRemoteLinkStep","description":"This step creates remote links between two records of linked data models.\n\nLearn more in the [Remote Link documentation.](https://docs.medusajs.com/learn/fundamentals/module-links/remote-link#create-link).","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.createRemoteLinkStep/page.mdx","depth":5},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":5},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":5},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"authorizePaymentSessionStep","description":"This step authorizes a payment session.","link":"../../../../Payment/Steps_Payment/functions/core_flows.Payment.Steps_Payment.authorizePaymentSessionStep/page.mdx","depth":5},{"type":"step","name":"addOrderTransactionStep","description":Line truncated
|
||||
|
||||
## Input
|
||||
|
||||
@@ -179,12 +179,8 @@ Handlers consuming this hook accept the following input.
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/confirm-variant-inventory.ts#L147" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/create-cart-credit-lines.ts#L31" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+7
-15
@@ -3,21 +3,17 @@ slug: /references/medusa-workflows/createCartWorkflow
|
||||
sidebar_label: createCartWorkflow
|
||||
sidebar_description: Create a cart specifying region, items, and more.
|
||||
tags:
|
||||
- sales channel
|
||||
- store
|
||||
- region
|
||||
- customer
|
||||
- query
|
||||
- pricing
|
||||
- cart
|
||||
- event bus
|
||||
- workflow
|
||||
- inventory
|
||||
- remote query
|
||||
- locking
|
||||
- tax
|
||||
- promotion
|
||||
- query
|
||||
- link
|
||||
- remote query
|
||||
- payment
|
||||
- logger
|
||||
---
|
||||
@@ -35,7 +31,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/create-carts.ts#L118" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/create-carts.ts#L111" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -176,7 +172,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 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
|
||||
<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":"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":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":"step","name":"createCartsStep","description":"This step creates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createCartsStep/page.mdx","depth":5},{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":6},{"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":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection details.","link":"../core_flows.Cart.Workflows_Cart.refreshPaymentCollectionForCartWorkflow/page.mdx","depth":8},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":8},{"type":"hook","name":"cartCreated","description":"","link":"#cartCreated","depth":9}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -246,7 +242,7 @@ createCartWorkflow.hooks.setPricingContext(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-8)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"region","type":"[RegionDTO](../../../../../region/interfaces/region.RegionDTO/page.mdx)","description":"The region details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"currency_code","type":"`string`","description":"The currency code of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"automatic_taxes","type":"`boolean`","description":"Setting to indicate whether taxes need to be applied automatically","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"countries","type":"[RegionCountryDTO](../../../../../region/interfaces/region.RegionCountryDTO/page.mdx)[]","description":"The countries of the region.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"payment_providers","type":"[PaymentProviderDTO](../../../../../region/interfaces/region.PaymentProviderDTO/page.mdx)[]","description":"Payment providers available in the region","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"created_at","type":"`string`","description":"The date the region was created.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"updated_at","type":"`string`","description":"The date the region was updated.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, any>`","description":"Holds custom data in key-value pairs.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"variantIds","type":"(`undefined` \\| `string`)[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"salesChannel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The sales channel details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customerData","type":"[FindOrCreateCustomerOutputStepOutput](../../../../interfaces/core_flows.FindOrCreateCustomerOutputStepOutput/page.mdx)","description":"The details of the customer found or created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer","type":"`null` \\| [CustomerDTO](../../../../../customer/interfaces/customer.CustomerDTO/page.mdx)","description":"The customer found or created, if any.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer found or created, if any.","optional":true,"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-7)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"region","type":"`any`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"variantIds","type":"`string`[]","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"salesChannel","type":"[SalesChannelDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelDTO/page.mdx)","description":"The sales channel details.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"id","type":"`string`","description":"The ID of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"name","type":"`string`","description":"The name of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"description","type":"`null` \\| `string`","description":"The description of the sales channel.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"is_disabled","type":"`boolean`","description":"Whether the sales channel is disabled.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`null` \\| `Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"locations","type":"[SalesChannelLocationDTO](../../../../../sales_channel/interfaces/sales_channel.SalesChannelLocationDTO/page.mdx)[]","description":"The locations of the sales channel.","optional":true,"defaultValue":"","expandable":false,"children":[]}]},{"name":"customerData","type":"[FindOrCreateCustomerOutputStepOutput](../../../../interfaces/core_flows.FindOrCreateCustomerOutputStepOutput/page.mdx)","description":"The details of the customer found or created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"customer","type":"`null` \\| [CustomerDTO](../../../../../customer/interfaces/customer.CustomerDTO/page.mdx)","description":"The customer found or created, if any.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`null` \\| `string`","description":"The email of the customer found or created, if any.","optional":true,"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"/>
|
||||
|
||||
### validate
|
||||
|
||||
@@ -268,7 +264,7 @@ createCartWorkflow.hooks.validate(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-4)","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":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"","optional":false,"defaultValue":"data.region.id","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer associated with the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string`","description":"The ID of the sales channel through which the cart is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email address of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address_id","type":"`string`","description":"The ID of the associated shipping address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"`string`","description":"The ID of the associated billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"`string` \\| [CreateCartAddressDTO](../../../../../types/interfaces/types.CreateCartAddressDTO/page.mdx)","description":"The ID of an existing shipping address, or the details of a shipping address to create.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`string` \\| [CreateCartAddressDTO](../../../../../types/interfaces/types.CreateCartAddressDTO/page.mdx)","description":"The ID of an existing billing address, or the details of a billing address to create.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Custom key-value pairs related to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CreateCartCreateLineItemDTO](../../../../../types/interfaces/types.CreateCartCreateLineItemDTO/page.mdx)[]","description":"The items to be added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The promotional codes applied on the cart.","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":"`object`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"","optional":false,"defaultValue":"data.region.id","expandable":false,"children":[]},{"name":"items","type":"`any`[]","description":"","optional":false,"defaultValue":"data.lineItems","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer associated with the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string`","description":"The ID of the sales channel through which the cart is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email address of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address_id","type":"`string`","description":"The ID of the associated shipping address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"`string`","description":"The ID of the associated billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"`string` \\| [CreateCartAddressDTO](../../../../../types/interfaces/types.CreateCartAddressDTO/page.mdx)","description":"The ID of an existing shipping address, or the details of a shipping address to create.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`string` \\| [CreateCartAddressDTO](../../../../../types/interfaces/types.CreateCartAddressDTO/page.mdx)","description":"The ID of an existing billing address, or the details of a billing address to create.","oLine truncated
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-4)","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":"","expandable":false,"children":[]},{"name":"region_id","type":"`any`","description":"","optional":false,"defaultValue":"data.region.id","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The ID of the customer associated with the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string`","description":"The ID of the sales channel through which the cart is created.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email address of the cart's customer.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address_id","type":"`string`","description":"The ID of the associated shipping address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"`string`","description":"The ID of the associated billing address.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"`string` \\| [CreateCartAddressDTO](../../../../../types/interfaces/types.CreateCartAddressDTO/page.mdx)","description":"The ID of an existing shipping address, or the details of a shipping address to create.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`string` \\| [CreateCartAddressDTO](../../../../../types/interfaces/types.CreateCartAddressDTO/page.mdx)","description":"The ID of an existing billing address, or the details of a billing address to create.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Custom key-value pairs related to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"items","type":"[CreateCartCreateLineItemDTO](../../../../../types/interfaces/types.CreateCartCreateLineItemDTO/page.mdx)[]","description":"The items to be added to the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"promo_codes","type":"`string`[]","description":"The promotional codes applied on the cart.","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":"[CreateCartDTO](../../../../../cart/interfaces/cart.CreateCartDTO/page.mdx)","description":"The cart to be created.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"currency_code","type":"`string`","description":"The currency code of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"region_id","type":"`string`","description":"The associated region's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"customer_id","type":"`string`","description":"The associated customer's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"sales_channel_id","type":"`string`","description":"The associated sales channel's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"email","type":"`string`","description":"The email of the customer that owns the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address_id","type":"`string`","description":"The associated shipping address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address_id","type":"`string`","description":"The associated billing address's ID.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_address","type":"`string` \\| [CreateAddressDTO](../../../../../cart/interfaces/cart.CreateAddressDTO/page.mdx)","description":"The shipping address of the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"billing_address","type":"`string` \\| [CreateAddressDTO](../../../../../cart/interfaces/cart.CreateAddressDTO/page.mdx)","description":"The billing address of the cart.","optional":true,"defaultValue":"","expandable":false,"children":[]},{"name":"metadata","type":"`Record<string, unknown>`","description":"Holds custom data in key-value pairs.","optional":trLine truncated
|
||||
|
||||
### cartCreated
|
||||
|
||||
@@ -290,18 +286,14 @@ createCartWorkflow.hooks.cartCreated(
|
||||
|
||||
Handlers consuming this hook accept the following input.
|
||||
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-7)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"The cart details.","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":"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":"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":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"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":"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":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart.","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.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The subtotal of the cart. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount total of the cart.","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.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"Line truncated
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-6)","description":"The input data for the hook.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"cart","type":"[CartDTO](../../../../../cart/interfaces/cart.CartDTO/page.mdx)","description":"The cart details.","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":"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":"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":"item_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The item total of the cart.","optional":false,"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":"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":"original_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"original_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The original subtotal of the cart.","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.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The subtotal of the cart. (Excluding taxes)","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"discount_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The discount total of the cart.","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.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"gift_card_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The gift card tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping total of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_subtotal","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping subtotal of the cart.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"shipping_tax_total","type":"[BigNumberValue](../../../../../cart/types/cart.BigNumberValue/page.mdx)","description":"The shipping tax total of the cart.","optional":false,"defaultValue":"","expandable":false,"Line truncated
|
||||
|
||||
## Emitted Events
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/create-payment-collection-for-cart.ts#L84" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/delete-cart-credit-lines.ts#L13" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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_U0PK0ogdIQd2NJb"
|
||||
"id_gAPA9szKeYhiObNji4"
|
||||
]
|
||||
}
|
||||
})
|
||||
@@ -63,7 +63,7 @@ export default async function handleOrderPlaced({
|
||||
.run({
|
||||
input: {
|
||||
"id": [
|
||||
"id_U0PK0ogdIQd2NJb"
|
||||
"id_gAPA9szKeYhiObNji4"
|
||||
]
|
||||
}
|
||||
})
|
||||
@@ -90,7 +90,7 @@ export default async function myCustomJob(
|
||||
.run({
|
||||
input: {
|
||||
"id": [
|
||||
"id_U0PK0ogdIQd2NJb"
|
||||
"id_gAPA9szKeYhiObNji4"
|
||||
]
|
||||
}
|
||||
})
|
||||
@@ -118,7 +118,7 @@ const myWorkflow = createWorkflow(
|
||||
.runAsStep({
|
||||
input: {
|
||||
"id": [
|
||||
"id_U0PK0ogdIQd2NJb"
|
||||
"id_gAPA9szKeYhiObNji4"
|
||||
]
|
||||
}
|
||||
})
|
||||
|
||||
+2
-2
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L121" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart-with-pricing.ts#L126" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -234,4 +234,4 @@ listShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext(
|
||||
|
||||
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"/>
|
||||
<TypeList types={[{"name":"input","type":"[input](../../../core_flows.Cart.Workflows_Cart/page.mdx#__type-8)","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"/>
|
||||
+3
-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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L130" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/list-shipping-options-for-cart.ts#L134" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -203,7 +203,7 @@ 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-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"/>
|
||||
<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"/>
|
||||
|
||||
### setShippingOptionsContext
|
||||
|
||||
@@ -265,4 +265,4 @@ listShippingOptionsForCartWorkflow.hooks.setShippingOptionsContext(
|
||||
|
||||
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"/>
|
||||
<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="setShippingOptionsContext"/>
|
||||
+5
-6
@@ -5,14 +5,13 @@ sidebar_description: Refresh a cart's details after an update.
|
||||
tags:
|
||||
- locking
|
||||
- query
|
||||
- pricing
|
||||
- cart
|
||||
- workflow
|
||||
- fulfillment
|
||||
- remote query
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
- remote query
|
||||
- payment
|
||||
- logger
|
||||
---
|
||||
@@ -32,7 +31,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L120" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/refresh-cart-items.ts#L118" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -141,7 +140,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 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}]}} />
|
||||
<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":"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":"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":4},{"type":"workflow","name":"refreshCartShippingMethodsWorkflow","description":"Refresh a cart's shipping methods after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartShippingMethodsWorkflow/page.mdx","depth":5},{"type":"when","condition":"{\n return !!input.force_refresh\n }","depth":"6","steps":[{"type":"workflow","name":"updateTaxLinesWorkflow","description":"Update a cart's tax lines.","link":"../core_flows.Cart.Workflows_Cart.updateTaxLinesWorkflow/page.mdx","depth":6}]},{"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":8},{"type":"hook","name":"beforeRefreshingPaymentCollection","description":"","link":"#beforeRefreshingPaymentCollection","depth":9},{"type":"workflow","name":"refreshPaymentCollectionForCartWorkflow","description":"Refresh a cart's payment collection details.","link":"../core_flows.Cart.Workflows_Cart.refreshPaymentCollectionForCartWorkflow/page.mdx","depth":10},{"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
|
||||
|
||||
@@ -206,7 +205,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-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"/>
|
||||
<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_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 +227,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-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"/>
|
||||
<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":"[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"/>
|
||||
+2
-2
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L54" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/refresh-cart-shipping-methods.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -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-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"/>
|
||||
<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":"[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"/>
|
||||
+3
-4
@@ -3,7 +3,6 @@ slug: /references/medusa-workflows/refreshPaymentCollectionForCartWorkflow
|
||||
sidebar_label: refreshPaymentCollectionForCartWorkflow
|
||||
sidebar_description: Refresh a cart's payment collection details.
|
||||
tags:
|
||||
- remote query
|
||||
- locking
|
||||
- payment
|
||||
- workflow
|
||||
@@ -26,7 +25,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L57" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/refresh-payment-collection.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -135,7 +134,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"refreshPaymentCollectionForCartWorkflow","steps":[{"type":"when","condition":"{\n return shouldExecute\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":"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":"when","condition":"{\n const valueIsEqual = MathBN.eq(\n cart.payment_collection?.raw_amount ?? -1,\n cart.raw_total\n )\n\n if (valueIsEqual) {\n return cart.payment_collection.currency_code !== cart.currency_code\n }\n\n return shouldExecute\n }","depth":"4","steps":[{"type":"workflow","name":"deletePaymentSessionsWorkflow","description":"Delete payment sessions.","link":"../../../../Payment_Collection/Workflows_Payment_Collection/functions/core_flows.Payment_Collection.Workflows_Payment_Collection.deletePaymentSessionsWorkflow/page.mdx","depth":4},{"type":"step","name":"updatePaymentCollectionStep","description":"This step updates payment collections matching the specified filters.","link":"../../../../Payment_Collection/Steps_Payment_Collection/functions/core_flows.Payment_Collection.Steps_Payment_Collection.updatePaymentCollectionStep/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}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"refreshPaymentCollectionForCartWorkflow","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":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":"when","condition":"{\n const valueIsEqual = MathBN.eq(\n cart.payment_collection?.raw_amount ?? -1,\n cart.raw_total\n )\n\n if (valueIsEqual) {\n return cart.payment_collection.currency_code !== cart.currency_code\n }\n\n return shouldExecute\n }","depth":"4","steps":[{"type":"workflow","name":"deletePaymentSessionsWorkflow","description":"Delete payment sessions.","link":"../../../../Payment_Collection/Workflows_Payment_Collection/functions/core_flows.Payment_Collection.Workflows_Payment_Collection.deletePaymentSessionsWorkflow/page.mdx","depth":4},{"type":"step","name":"updatePaymentCollectionStep","description":"This step updates payment collections matching the specified filters.","link":"../../../../Payment_Collection/Steps_Payment_Collection/functions/core_flows.Payment_Collection.Steps_Payment_Collection.updatePaymentCollectionStep/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
|
||||
|
||||
@@ -167,4 +166,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-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"/>
|
||||
<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":"[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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L64" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/refund-payment-recreate-payment-session.ts#L67" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -43,7 +43,7 @@ export async function POST(
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 31
|
||||
"amount": 45
|
||||
}
|
||||
})
|
||||
|
||||
@@ -72,7 +72,7 @@ export default async function handleOrderPlaced({
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 31
|
||||
"amount": 45
|
||||
}
|
||||
})
|
||||
|
||||
@@ -101,7 +101,7 @@ export default async function myCustomJob(
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 31
|
||||
"amount": 45
|
||||
}
|
||||
})
|
||||
|
||||
@@ -130,7 +130,7 @@ const myWorkflow = createWorkflow(
|
||||
"payment_collection_id": "{value}",
|
||||
"provider_id": "{value}",
|
||||
"payment_id": "{value}",
|
||||
"amount": 31
|
||||
"amount": 45
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
+4
-9
@@ -8,12 +8,11 @@ tags:
|
||||
- event bus
|
||||
- workflow
|
||||
- query
|
||||
- pricing
|
||||
- fulfillment
|
||||
- remote query
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
- remote query
|
||||
- payment
|
||||
- logger
|
||||
---
|
||||
@@ -30,7 +29,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L54" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/transfer-cart-customer.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -143,7 +142,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"transferCartCustomerWorkflow","steps":[{"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":1},{"type":"when","condition":"shouldTransfer","depth":"2","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":2},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":2},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":2},{"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":2}]}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"transferCartCustomerWorkflow","steps":[{"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":1},{"type":"when","condition":"shouldTransfer","depth":"2","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":2},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":2},{"type":"workflow","name":"refreshCartItemsWorkflow","description":"Refresh a cart's details after an update.","link":"../core_flows.Cart.Workflows_Cart.refreshCartItemsWorkflow/page.mdx","depth":2},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":2},{"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":2}]}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -175,18 +174,14 @@ 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-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"/>
|
||||
<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":"[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
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+5
-4
@@ -3,11 +3,12 @@ slug: /references/medusa-workflows/updateCartPromotionsWorkflow
|
||||
sidebar_label: updateCartPromotionsWorkflow
|
||||
sidebar_description: Update a cart's applied promotions to add, replace, or remove them.
|
||||
tags:
|
||||
- remote query
|
||||
- locking
|
||||
- promotion
|
||||
- query
|
||||
- cart
|
||||
- link
|
||||
- remote query
|
||||
- workflow
|
||||
---
|
||||
|
||||
@@ -23,7 +24,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L76" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/update-cart-promotions.ts#L76" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -144,7 +145,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","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":"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":"getPromotionCodesToApply","description":"This step retrieves the promotion codes to apply on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getPromotionCodesToApply/page.mdx","depth":4},{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on 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.getActionsToComputeFromPromotionsStep/page.mdx","depth":5},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.prepareAdjustmentsFromPromotionActionsStep/page.mdx","depth":6},{"type":"step","name":"removeLineItemAdjustmentsStep","description":"This step removes line item adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeLineItemAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"removeShippingMethodAdjustmentsStep","description":"This step removes shipping method adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"createLineItemAdjustmentsStep","description":"This step creates line item adjustments in a cart, such as when a promotion is applied.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"createShippingMethodAdjustmentsStep","description":"This step creates shipping method adjustments for a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createShippingMethodAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"updateCartPromotionsStep","description":"This step updates the promotions applied on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartPromotionsStep/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}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateCartPromotionsWorkflow","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":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":"getPromotionCodesToApply","description":"This step retrieves the promotion codes to apply on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.getPromotionCodesToApply/page.mdx","depth":4},{"type":"step","name":"getActionsToComputeFromPromotionsStep","description":"This step retrieves the actions to compute based on the promotions\napplied on 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.getActionsToComputeFromPromotionsStep/page.mdx","depth":5},{"type":"step","name":"prepareAdjustmentsFromPromotionActionsStep","description":"This step prepares the line item or shipping method adjustments using\nactions computed by the Promotion Module.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.prepareAdjustmentsFromPromotionActionsStep/page.mdx","depth":6},{"type":"step","name":"removeLineItemAdjustmentsStep","description":"This step removes line item adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeLineItemAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"removeShippingMethodAdjustmentsStep","description":"This step removes shipping method adjustments from a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.removeShippingMethodAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"createLineItemAdjustmentsStep","description":"This step creates line item adjustments in a cart, such as when a promotion is applied.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createLineItemAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"createShippingMethodAdjustmentsStep","description":"This step creates shipping method adjustments for a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.createShippingMethodAdjustmentsStep/page.mdx","depth":7},{"type":"step","name":"updateCartPromotionsStep","description":"This step updates the promotions applied on a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartPromotionsStep/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}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -176,4 +177,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-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"/>
|
||||
<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":"[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"/>
|
||||
+5
-12
@@ -5,18 +5,15 @@ sidebar_description: Update a cart's details, such as region, address, and more.
|
||||
tags:
|
||||
- locking
|
||||
- query
|
||||
- sales channel
|
||||
- store
|
||||
- customer
|
||||
- event bus
|
||||
- cart
|
||||
- workflow
|
||||
- pricing
|
||||
- fulfillment
|
||||
- remote query
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
- remote query
|
||||
- payment
|
||||
- logger
|
||||
---
|
||||
@@ -41,7 +38,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/update-cart.ts#L69" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/update-cart.ts#L81" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -202,7 +199,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateCartWorkflow","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":"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":3},{"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":3},{"type":"when","condition":"{\n return !!data.input.region_id\n }","depth":"4","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":4}]},{"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":5},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"6","steps":[{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":6}]},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":7},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":7},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"8","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":8},{"type":"step","name":"deleteLineItemsStep","description":"This step deletes line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.deleteLineItemsStep/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},{"type":"hook","name":"cartUpdated","description":"","link":"#cartUpdated","depth":10},{"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}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateCartWorkflow","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":"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":3},{"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":3},{"type":"when","condition":"{\n return !!data.input.region_id\n }","depth":"4","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":4}]},{"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":5},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"6","steps":[{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":6}]},{"type":"step","name":"updateCartsStep","description":"This step updates a cart.","link":"../../../Steps_Cart/functions/core_flows.Cart.Steps_Cart.updateCartsStep/page.mdx","depth":7},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":7},{"type":"when","condition":"{\n return !!regionUpdated\n }","depth":"8","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":8},{"type":"step","name":"deleteLineItemsStep","description":"This step deletes line items.","link":"../../../../Line_Item/Steps_Line_Item/functions/core_flows.Line_Item.Steps_Line_Item.deleteLineItemsStep/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},{"type":"hook","name":"cartUpdated","description":"","link":"#cartUpdated","depth":10},{"type":"step","name":"releaseLockStep","description":"This step releases a lock for a given key. LLine truncated
|
||||
|
||||
## Input
|
||||
|
||||
@@ -234,7 +231,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-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"/>
|
||||
<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":"`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,18 +253,14 @@ 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-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"/>
|
||||
<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":"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
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+5
-10
@@ -8,12 +8,11 @@ tags:
|
||||
- event bus
|
||||
- workflow
|
||||
- query
|
||||
- pricing
|
||||
- fulfillment
|
||||
- remote query
|
||||
- tax
|
||||
- promotion
|
||||
- link
|
||||
- remote query
|
||||
- payment
|
||||
- logger
|
||||
- inventory
|
||||
@@ -31,7 +30,7 @@ This workflow is executed by the [Update Line Item Store API Route](https://docs
|
||||
|
||||
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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L111" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/update-line-item-in-cart.ts#L111" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -156,7 +155,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 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}]}} />
|
||||
<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":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":8}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -188,7 +187,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-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"/>
|
||||
<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":"[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
|
||||
|
||||
@@ -243,18 +242,14 @@ 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-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
|
||||
<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":"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
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+2
-3
@@ -3,7 +3,6 @@ slug: /references/medusa-workflows/updateTaxLinesWorkflow
|
||||
sidebar_label: updateTaxLinesWorkflow
|
||||
sidebar_description: Update a cart's tax lines.
|
||||
tags:
|
||||
- remote query
|
||||
- locking
|
||||
- tax
|
||||
- cart
|
||||
@@ -21,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L124" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/cart/workflows/update-tax-lines.ts#L124" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -130,7 +129,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":"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}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateTaxLinesWorkflow","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":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
|
||||
|
||||
|
||||
+5
-1
@@ -12,7 +12,11 @@ import { TypeList, WorkflowDiagram } from "docs-ui"
|
||||
|
||||
This documentation provides a reference to the `emitEventStep`. It belongs to the `@medusajs/medusa/core-flows` package.
|
||||
|
||||
Emit an event.
|
||||
This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the
|
||||
subscriber by including it in the `data` property.
|
||||
|
||||
The event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully.
|
||||
If the workflow fails, it won't emit the event at all.
|
||||
|
||||
## Example
|
||||
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/common/workflows/batch-links.ts#L67" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/common/workflows/batch-links.ts#L70" />
|
||||
|
||||
## 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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/common/workflows/create-links.ts#L38" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/common/workflows/dismiss-links.ts#L38" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/common/workflows/update-links.ts#L43" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+2
-6
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/create-customer-account.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -153,7 +153,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"createCustomerAccountWorkflow","steps":[{"type":"step","name":"validateCustomerAccountCreation","description":"This step validates the input data for creating a customer account.\nThe step throws an error if:\n\n- The email is missing\n- A customer with the email already exists and has an account\n- A guest customer with the email already exists","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.validateCustomerAccountCreation/page.mdx","depth":1},{"type":"workflow","name":"createCustomersWorkflow","description":"Create one or more customers.","link":"../core_flows.Customer.Workflows_Customer.createCustomersWorkflow/page.mdx","depth":2},{"type":"step","name":"setAuthAppMetadataStep","description":"This step sets the `app_metadata` property of an auth identity. This is useful to\nassociate a user (whether it's an admin user or customer) with an auth identity\nthat allows them to authenticate into Medusa.\n\nYou can learn more about auth identites in \n[this documentation](https://docs.medusajs.com/resources/commerce-modules/auth/auth-identity-and-actor-types).\n\nTo use this for a custom actor type, check out [this guide](https://docs.medusajs.com/resources/commerce-modules/auth/create-actor-type)\nthat explains how to create a custom `manager` actor type and manage its users.","link":"../../../../Auth/Steps_Auth/functions/core_flows.Auth.Steps_Auth.setAuthAppMetadataStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"createCustomerAccountWorkflow","steps":[{"type":"step","name":"validateCustomerAccountCreation","description":"This step validates the input data for creating a customer account.\nThe step throws an error if:\n\n- The email is missing\n- A customer with the email already exists and has an account\n- A guest customer with the email already exists","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.validateCustomerAccountCreation/page.mdx","depth":1},{"type":"workflow","name":"createCustomersWorkflow","description":"Create one or more customers.","link":"../core_flows.Customer.Workflows_Customer.createCustomersWorkflow/page.mdx","depth":2},{"type":"step","name":"setAuthAppMetadataStep","description":"This step sets the `app_metadata` property of an auth identity. This is useful to\nassociate a user (whether it's an admin user or customer) with an auth identity\nthat allows them to authenticate into Medusa.\n\nYou can learn more about auth identites in\n[this documentation](https://docs.medusajs.com/resources/commerce-modules/auth/auth-identity-and-actor-types).\n\nTo use this for a custom actor type, check out [this guide](https://docs.medusajs.com/resources/commerce-modules/auth/create-actor-type)\nthat explains how to create a custom `manager` actor type and manage its users.","link":"../../../../Auth/Steps_Auth/functions/core_flows.Auth.Steps_Auth.setAuthAppMetadataStep/page.mdx","depth":3}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -167,12 +167,8 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/create-addresses.ts#L75" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+2
-6
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/create-customers.ts#L54" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/create-customers.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -157,7 +157,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"createCustomersWorkflow","steps":[{"type":"step","name":"createCustomersStep","description":"This step creates one or more customers.","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.createCustomersStep/page.mdx","depth":1},{"type":"hook","name":"customersCreated","description":"This hook is executed after the customers are created. You can consume this hook to perform custom actions on the created customers.","link":"#customersCreated","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"createCustomersWorkflow","steps":[{"type":"step","name":"createCustomersStep","description":"This step creates one or more customers.","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.createCustomersStep/page.mdx","depth":1},{"type":"hook","name":"customersCreated","description":"This hook is executed after the customers are created. You can consume this hook to perform custom actions on the created customers.","link":"#customersCreated","depth":2},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -199,12 +199,8 @@ Handlers consuming this hook accept the following input.
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/delete-addresses.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+2
-6
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/delete-customers.ts#L46" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -137,7 +137,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"deleteCustomersWorkflow","steps":[{"type":"step","name":"deleteCustomersStep","description":"This step deletes one or more customers.","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.deleteCustomersStep/page.mdx","depth":1},{"type":"hook","name":"customersDeleted","description":"This hook is executed after the customers are deleted. You can consume this hook to perform custom actions.","link":"#customersDeleted","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"deleteCustomersWorkflow","steps":[{"type":"step","name":"deleteCustomersStep","description":"This step deletes one or more customers.","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.deleteCustomersStep/page.mdx","depth":1},{"type":"hook","name":"customersDeleted","description":"This hook is executed after the customers are deleted. You can consume this hook to perform custom actions.","link":"#customersDeleted","depth":2},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -175,12 +175,8 @@ Handlers consuming this hook accept the following input.
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+2
-6
@@ -29,7 +29,7 @@ custom actions after the customers are deleted.
|
||||
|
||||
:::
|
||||
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/remove-customer-account.ts#L43" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -138,7 +138,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"removeCustomerAccountWorkflow","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":"workflow","name":"deleteCustomersWorkflow","description":"Delete one or more customers.","link":"../core_flows.Customer.Workflows_Customer.deleteCustomersWorkflow/page.mdx","depth":2},{"type":"when","condition":"{\n return !!customers[0]?.has_account\n }","depth":"3","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":3},{"type":"step","name":"setAuthAppMetadataStep","description":"This step sets the `app_metadata` property of an auth identity. This is useful to\nassociate a user (whether it's an admin user or customer) with an auth identity\nthat allows them to authenticate into Medusa.\n\nYou can learn more about auth identites in \n[this documentation](https://docs.medusajs.com/resources/commerce-modules/auth/auth-identity-and-actor-types).\n\nTo use this for a custom actor type, check out [this guide](https://docs.medusajs.com/resources/commerce-modules/auth/create-actor-type)\nthat explains how to create a custom `manager` actor type and manage its users.","link":"../../../../Auth/Steps_Auth/functions/core_flows.Auth.Steps_Auth.setAuthAppMetadataStep/page.mdx","depth":3}]}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"removeCustomerAccountWorkflow","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":"workflow","name":"deleteCustomersWorkflow","description":"Delete one or more customers.","link":"../core_flows.Customer.Workflows_Customer.deleteCustomersWorkflow/page.mdx","depth":2},{"type":"when","condition":"{\n return !!customers[0]?.has_account\n }","depth":"3","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":3},{"type":"step","name":"setAuthAppMetadataStep","description":"This step sets the `app_metadata` property of an auth identity. This is useful to\nassociate a user (whether it's an admin user or customer) with an auth identity\nthat allows them to authenticate into Medusa.\n\nYou can learn more about auth identites in\n[this documentation](https://docs.medusajs.com/resources/commerce-modules/auth/auth-identity-and-actor-types).\n\nTo use this for a custom actor type, check out [this guide](https://docs.medusajs.com/resources/commerce-modules/auth/create-actor-type)\nthat explains how to create a custom `manager` actor type and manage its users.","link":"../../../../Auth/Steps_Auth/functions/core_flows.Auth.Steps_Auth.setAuthAppMetadataStep/page.mdx","depth":3}]}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -152,12 +152,8 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/update-addresses.ts#L66" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+2
-6
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/customer/workflows/update-customers.ts#L60" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -151,7 +151,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateCustomersWorkflow","steps":[{"type":"step","name":"updateCustomersStep","description":"This step updates one or more customers.","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.updateCustomersStep/page.mdx","depth":1},{"type":"hook","name":"customersUpdated","description":"This hook is executed after the customers are updated. You can consume this hook to perform custom actions on the updated customers.","link":"#customersUpdated","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateCustomersWorkflow","steps":[{"type":"step","name":"updateCustomersStep","description":"This step updates one or more customers.","link":"../../../Steps_Customer/functions/core_flows.Customer.Steps_Customer.updateCustomersStep/page.mdx","depth":1},{"type":"hook","name":"customersUpdated","description":"This hook is executed after the customers are updated. You can consume this hook to perform custom actions on the updated customers.","link":"#customersUpdated","depth":2},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -193,12 +193,8 @@ Handlers consuming this hook accept the following input.
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createCustomerGroupsStep({
|
||||
"name": "Loren"
|
||||
"name": "Lurline"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer-group/workflows/create-customer-groups.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer-group/workflows/delete-customer-groups.ts#L34" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer-group/workflows/link-customer-groups-customer.ts#L37" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer-group/workflows/link-customers-customer-group.ts#L37" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/customer-group/workflows/update-customer-groups.ts#L57" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/defaults/workflows/create-defaults.ts#L25" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+3
-8
@@ -3,16 +3,11 @@ slug: /references/medusa-workflows/addDraftOrderItemsWorkflow
|
||||
sidebar_label: addDraftOrderItemsWorkflow
|
||||
sidebar_description: Add items to a draft order.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
- sales channel
|
||||
- store
|
||||
- region
|
||||
- customer
|
||||
- query
|
||||
- pricing
|
||||
- inventory
|
||||
- remote query
|
||||
- tax
|
||||
---
|
||||
|
||||
@@ -28,7 +23,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L50" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/add-draft-order-items.ts#L55" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -153,7 +148,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"addDraftOrderItemsWorkflow","steps":[{"type":"workflow","name":"addOrderLineItemsWorkflow","description":"Add line items to an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.addOrderLineItemsWorkflow/page.mdx","depth":1},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"addDraftOrderItemsWorkflow","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":"workflow","name":"addOrderLineItemsWorkflow","description":"Add line items to an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.addOrderLineItemsWorkflow/page.mdx","depth":2},{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":3},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":5},{"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":6},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":7}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/addDraftOrderPromotionWorkflow
|
||||
sidebar_label: addDraftOrderPromotionWorkflow
|
||||
sidebar_description: Add promotions to a draft order.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/add-draft-order-promotions.ts#L64" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -132,7 +133,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"addDraftOrderPromotionWorkflow","steps":[{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":1},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":2}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"addDraftOrderPromotionWorkflow","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":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"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":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ slug: /references/medusa-workflows/addDraftOrderShippingMethodsWorkflow
|
||||
sidebar_label: addDraftOrderShippingMethodsWorkflow
|
||||
sidebar_description: Add shipping methods to a draft order.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
- remote query
|
||||
- tax
|
||||
---
|
||||
|
||||
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L99" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/add-draft-order-shipping-methods.ts#L100" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -138,7 +138,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"addDraftOrderShippingMethodsWorkflow","steps":[{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"addDraftOrderShippingMethodsWorkflow","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":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/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},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":6}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/beginDraftOrderEditWorkflow
|
||||
sidebar_label: beginDraftOrderEditWorkflow
|
||||
sidebar_description: Create a draft order edit request.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -21,7 +22,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L35" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/begin-draft-order-edit.ts#L36" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -130,7 +131,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"beginDraftOrderEditWorkflow","steps":[{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's 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":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":1},{"type":"step","name":"createOrderChangeStep","description":"This step creates an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrderChangeStep/page.mdx","depth":2},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"beginDraftOrderEditWorkflow","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":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's 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":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"createOrderChangeStep","description":"This step creates an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.createOrderChangeStep/page.mdx","depth":3},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/cancelDraftOrderEditWorkflow
|
||||
sidebar_label: cancelDraftOrderEditWorkflow
|
||||
sidebar_description: Cancel a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/cancel-draft-order-edit.ts#L53" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -128,7 +129,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"cancelDraftOrderEditWorkflow","steps":[{"type":"step","name":"deleteOrderChangesStep","description":"This step deletes order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangesStep/page.mdx","depth":1},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":1}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"cancelDraftOrderEditWorkflow","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":"deleteOrderChangesStep","description":"This step deletes order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangesStep/page.mdx","depth":2},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":2},{"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":4}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+4
-4
@@ -3,11 +3,11 @@ slug: /references/medusa-workflows/confirmDraftOrderEditWorkflow
|
||||
sidebar_label: confirmDraftOrderEditWorkflow
|
||||
sidebar_description: Confirm a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- inventory
|
||||
- locking
|
||||
- workflow
|
||||
- remote query
|
||||
- query
|
||||
- payment
|
||||
---
|
||||
|
||||
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/confirm-draft-order-edit.ts#L49" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -136,7 +136,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"confirmDraftOrderEditWorkflow","steps":[{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":1},{"type":"step","name":"deleteReservationsByLineItemsStep","description":"This step deletes reservations by their associated line items.","link":"../../../../Reservation/Steps_Reservation/functions/core_flows.Reservation.Steps_Reservation.deleteReservationsByLineItemsStep/page.mdx","depth":2},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":3},{"type":"workflow","name":"createOrUpdateOrderPaymentCollectionWorkflow","description":"Create or update payment collection for an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrUpdateOrderPaymentCollectionWorkflow/page.mdx","depth":4}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"confirmDraftOrderEditWorkflow","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":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":2},{"type":"step","name":"deleteReservationsByLineItemsStep","description":"This step deletes reservations by their associated line items.","link":"../../../../Reservation/Steps_Reservation/functions/core_flows.Reservation.Steps_Reservation.deleteReservationsByLineItemsStep/page.mdx","depth":3},{"type":"step","name":"reserveInventoryStep","description":"This step reserves the quantity of line items from the associated\nvariant's inventory.","link":"../../../../Cart/Steps_Cart/functions/core_flows.Cart.Steps_Cart.reserveInventoryStep/page.mdx","depth":4},{"type":"workflow","name":"createOrUpdateOrderPaymentCollectionWorkflow","description":"Create or update payment collection for an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrUpdateOrderPaymentCollectionWorkflow/page.mdx","depth":5},{"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":6}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = convertDraftOrderStep({
|
||||
"id": "id_oBvkcot59aLyI8wEuwxU"
|
||||
"id": "id_VOj1WBZhvs6"
|
||||
})
|
||||
}
|
||||
)
|
||||
|
||||
+3
-6
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/convertDraftOrderWorkflow
|
||||
sidebar_label: convertDraftOrderWorkflow
|
||||
sidebar_description: Convert a draft order to a pending order.
|
||||
tags:
|
||||
- locking
|
||||
- event bus
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L97" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/convert-draft-order.ts#L99" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -128,7 +129,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"convertDraftOrderWorkflow","steps":[{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's 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":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":1},{"type":"step","name":"convertDraftOrderStep","description":"This step converts a draft order to a pending order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"convertDraftOrderWorkflow","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":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's 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":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"convertDraftOrderStep","description":"This step converts a draft order to a pending order.","link":"../core_flows.Draft_Order.Workflows_Draft_Order.convertDraftOrderStep/page.mdx","depth":3},{"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":4},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":4}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -142,12 +143,8 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/delete-draft-order.ts#L59" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/removeDraftOrderActionItemWorkflow
|
||||
sidebar_label: removeDraftOrderActionItemWorkflow
|
||||
sidebar_description: Remove an item from a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L48" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-item.ts#L49" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -132,7 +133,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderActionItemWorkflow","steps":[{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":1},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderActionItemWorkflow","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":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/removeDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_label: removeDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_description: Remove a shipping method from an edited draft order.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L52" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-action-shipping-method.ts#L53" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -135,7 +136,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderActionShippingMethodWorkflow","steps":[{"type":"step","name":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":1},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":1},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderActionShippingMethodWorkflow","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":"deleteOrderChangeActionsStep","description":"This step deletes order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderChangeActionsStep/page.mdx","depth":2},{"type":"step","name":"deleteOrderShippingMethods","description":"This step deletes order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.deleteOrderShippingMethods/page.mdx","depth":2},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/removeDraftOrderPromotionsWorkflow
|
||||
sidebar_label: removeDraftOrderPromotionsWorkflow
|
||||
sidebar_description: Remove promotions from a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L60" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-promotions.ts#L65" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -132,7 +133,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderPromotionsWorkflow","steps":[{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":1},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":2}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderPromotionsWorkflow","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":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"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":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/removeDraftOrderShippingMethodWorkflow
|
||||
sidebar_label: removeDraftOrderShippingMethodWorkflow
|
||||
sidebar_description: Remove an existing shipping method from a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L60" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/remove-draft-order-shipping-method.ts#L61" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -132,7 +133,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderShippingMethodWorkflow","steps":[{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"removeDraftOrderShippingMethodWorkflow","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":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+4
-3
@@ -3,9 +3,10 @@ slug: /references/medusa-workflows/requestDraftOrderEditWorkflow
|
||||
sidebar_label: requestDraftOrderEditWorkflow
|
||||
sidebar_description: Request a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
- remote query
|
||||
- query
|
||||
- payment
|
||||
---
|
||||
|
||||
@@ -21,7 +22,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L71" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/request-draft-order-edit.ts#L72" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -134,7 +135,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"requestDraftOrderEditWorkflow","steps":[{"type":"step","name":"updateOrderChangesStep","description":"This step updates order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangesStep/page.mdx","depth":1},{"type":"workflow","name":"createOrUpdateOrderPaymentCollectionWorkflow","description":"Create or update payment collection for an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrUpdateOrderPaymentCollectionWorkflow/page.mdx","depth":2},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"requestDraftOrderEditWorkflow","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":"updateOrderChangesStep","description":"This step updates order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangesStep/page.mdx","depth":2},{"type":"workflow","name":"createOrUpdateOrderPaymentCollectionWorkflow","description":"Create or update payment collection for an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrUpdateOrderPaymentCollectionWorkflow/page.mdx","depth":3},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/updateDraftOrderActionItemWorkflow
|
||||
sidebar_label: updateDraftOrderActionItemWorkflow
|
||||
sidebar_description: Update a new item in a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L51" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-item.ts#L52" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -144,7 +145,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionItemWorkflow","steps":[{"type":"step","name":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":1},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionItemWorkflow","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":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":2},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/updateDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_label: updateDraftOrderActionShippingMethodWorkflow
|
||||
sidebar_description: Update a new shipping method in a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L56" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/update-draft-order-action-shipping-method.ts#L57" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -147,7 +148,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionShippingMethodWorkflow","steps":[{"type":"step","name":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":2},{"type":"step","name":"updateOrderShippingMethodsStep","description":"This step updates order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderShippingMethodsStep/page.mdx","depth":2},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderActionShippingMethodWorkflow","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":"updateOrderChangeActionsStep","description":"This step updates order change actions.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderChangeActionsStep/page.mdx","depth":3},{"type":"step","name":"updateOrderShippingMethodsStep","description":"This step updates order shipping methods.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.updateOrderShippingMethodsStep/page.mdx","depth":3},{"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},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":6}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-2
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/updateDraftOrderItemWorkflow
|
||||
sidebar_label: updateDraftOrderItemWorkflow
|
||||
sidebar_description: Update an item in a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
---
|
||||
@@ -19,7 +20,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L53" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/update-draft-order-item.ts#L54" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -132,7 +133,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderItemWorkflow","steps":[{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":1},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":3}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderItemWorkflow","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":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":2},{"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":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-3
@@ -3,9 +3,9 @@ slug: /references/medusa-workflows/updateDraftOrderShippingMethodWorkflow
|
||||
sidebar_label: updateDraftOrderShippingMethodWorkflow
|
||||
sidebar_description: Update an existing shipping method in a draft order edit.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- workflow
|
||||
- remote query
|
||||
- tax
|
||||
---
|
||||
|
||||
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L79" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/update-draft-order-shipping-method.ts#L84" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -146,7 +146,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderShippingMethodWorkflow","steps":[{"type":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":1},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/page.mdx","depth":3},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":4}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderShippingMethodWorkflow","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":"workflow","name":"updateOrderTaxLinesWorkflow","description":"Update the tax lines of items and shipping methods in an order.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.updateOrderTaxLinesWorkflow/page.mdx","depth":2},{"type":"workflow","name":"createOrderChangeActionsWorkflow","description":"Create an order change action.","link":"../../../../Order/Workflows_Order/functions/core_flows.Order.Workflows_Order.createOrderChangeActionsWorkflow/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},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":6}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
|
||||
+3
-6
@@ -3,6 +3,7 @@ slug: /references/medusa-workflows/updateDraftOrderWorkflow
|
||||
sidebar_label: updateDraftOrderWorkflow
|
||||
sidebar_description: Update a draft order's details.
|
||||
tags:
|
||||
- locking
|
||||
- order
|
||||
- event bus
|
||||
- workflow
|
||||
@@ -25,7 +26,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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L149" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/draft-order/workflows/update-draft-order.ts#L150" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -142,7 +143,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Steps
|
||||
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderWorkflow","steps":[{"type":"step","name":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's 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":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":1},{"type":"step","name":"updateDraftOrderStep","description":"This step updates a draft order's details.\n\n:::note\n\nYou can retrieve a draft order's 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":"../core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"registerOrderChangesStep","description":"This step registers an order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderChangesStep/page.mdx","depth":3},{"type":"step","name":"emitEventStep","description":"Emit an event.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":4},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":5}]}} />
|
||||
<WorkflowDiagram workflow={{"name":"updateDraftOrderWorkflow","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":"validateDraftOrderStep","description":"This step validates that an order is a draft order. It throws an error otherwise.\n\n:::note\n\nYou can retrieve a draft order's 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":"../../../Steps_Draft_Order/functions/core_flows.Draft_Order.Steps_Draft_Order.validateDraftOrderStep/page.mdx","depth":2},{"type":"step","name":"updateDraftOrderStep","description":"This step updates a draft order's details.\n\n:::note\n\nYou can retrieve a draft order's 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":"../core_flows.Draft_Order.Workflows_Draft_Order.updateDraftOrderStep/page.mdx","depth":3},{"type":"step","name":"registerOrderChangesStep","description":"This step registers an order changes.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.registerOrderChangesStep/page.mdx","depth":4},{"type":"step","name":"emitEventStep","description":"This step emits an event, which you can listen to in a [subscriber](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers). You can pass data to the\nsubscriber by including it in the `data` property.\n\nThe event is only emitted after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. \nIf the workflow fails, it won't emit the event at all.","link":"../../../../Common/Steps_Common/functions/core_flows.Common.Steps_Common.emitEventStep/page.mdx","depth":5},{"type":"step","name":"previewOrderChangeStep","description":"This step retrieves a preview of an order change.","link":"../../../../Order/Steps_Order/functions/core_flows.Order.Steps_Order.previewOrderChangeStep/page.mdx","depth":6},{"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":7}]}} />
|
||||
|
||||
## Input
|
||||
|
||||
@@ -156,12 +157,8 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
This section lists the events that are either triggered by the `emitEventStep` in the workflow, or by another workflow executed within this workflow.
|
||||
|
||||
:::note
|
||||
|
||||
The `emitEventStep` only emits the event after the workflow has finished successfully. So, even if it's executed in the middle of the workflow, it won't actually emit the event until the workflow has completed successfully. If the workflow fails, it won't emit the event at all.
|
||||
|
||||
:::
|
||||
|
||||
You can listen to these events in a subscriber, as explained in the [Subscribers](https://docs.medusajs.com/learn/fundamentals/events-and-subscribers) documentation.
|
||||
|
||||
<Table>
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ const data = uploadFilesStep({
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"UploadFilesStepInput","type":"[UploadFilesStepInput](../../../../types/core_flows.UploadFilesStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example, \nuse binary string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport 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="uploadFilesStep"/>
|
||||
<TypeList types={[{"name":"UploadFilesStepInput","type":"[UploadFilesStepInput](../../../../types/core_flows.UploadFilesStepInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example,\nuse binary string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport 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="uploadFilesStep"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/file/workflows/delete-files.ts#L29" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
+2
-2
@@ -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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/file/workflows/upload-files.ts#L72" />
|
||||
|
||||
## Examples
|
||||
|
||||
@@ -153,7 +153,7 @@ const myWorkflow = createWorkflow(
|
||||
|
||||
## Input
|
||||
|
||||
<TypeList types={[{"name":"UploadFilesWorkflowInput","type":"[UploadFilesWorkflowInput](../../../../types/core_flows.UploadFilesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example, \nuse binary string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to \nimport 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="uploadFilesWorkflow"/>
|
||||
<TypeList types={[{"name":"UploadFilesWorkflowInput","type":"[UploadFilesWorkflowInput](../../../../types/core_flows.UploadFilesWorkflowInput/page.mdx)","optional":false,"defaultValue":"","description":"The data to upload files.","expandable":false,"children":[{"name":"files","type":"`object`[]","description":"The files to upload.","optional":false,"defaultValue":"","expandable":false,"children":[{"name":"filename","type":"`string`","description":"The name of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"mimeType","type":"`string`","description":"The MIME type of the file.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"content","type":"`string`","description":"The content of the file. For images, for example,\nuse binary string. For CSV files, use the CSV content.","optional":false,"defaultValue":"","expandable":false,"children":[]},{"name":"access","type":"`\"public\"` \\| `\"private\"`","description":"The access level of the file. Use `public` for the file that\ncan be accessed by anyone. For example, for images that are displayed\non the storefront. Use `private` for files that are only accessible\nby authenticated users. For example, for CSV files used to\nimport 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="uploadFilesWorkflow"/>
|
||||
|
||||
## Output
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createFulfillmentSets({
|
||||
"name": "Randall",
|
||||
"name": "Georgette",
|
||||
"type": "{value}"
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createServiceZonesStep({
|
||||
"name": "Syble",
|
||||
"name": "Frederik",
|
||||
"fulfillment_set_id": "{value}"
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,7 +24,7 @@ const myWorkflow = createWorkflow(
|
||||
const data = createShippingOptionRulesStep({
|
||||
"data": [{
|
||||
"attribute": "{value}",
|
||||
"operator": "gt",
|
||||
"operator": "lt",
|
||||
"value": "{value}",
|
||||
"shipping_option_id": "{value}"
|
||||
}]
|
||||
|
||||
+3
-3
@@ -29,10 +29,10 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createShippingOptionsPriceSetsStep({
|
||||
"id": "id_XU1jAyQA0PU8BHzkcw",
|
||||
"id": "id_igIfRnKlKVxul",
|
||||
"prices": [{
|
||||
"currency_code": "usd",
|
||||
"amount": 45
|
||||
"currency_code": "kpw",
|
||||
"amount": 7
|
||||
}]
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ const myWorkflow = createWorkflow(
|
||||
"my-workflow",
|
||||
() => {
|
||||
const data = createShippingProfilesStep({
|
||||
"name": "Nicklaus",
|
||||
"name": "Hipolito",
|
||||
"type": "{value}"
|
||||
})
|
||||
}
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ const myWorkflow = createWorkflow(
|
||||
() => {
|
||||
const data = deleteShippingOptionRulesStep({
|
||||
"ids": [
|
||||
"id_3OcqHJC1ZD72nB4"
|
||||
"id_iGJwjksg6XRrH"
|
||||
]
|
||||
})
|
||||
}
|
||||
|
||||
+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/675091b4a5ad30101bf69d3459c3673d80c9f46f/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts#L76" />
|
||||
<SourceCodeLink link="https://github.com/medusajs/medusa/blob/96b2df170752a0d66628a84c46397a24ca9502da/packages/core/core-flows/src/fulfillment/workflows/batch-shipping-option-rules.ts#L76" />
|
||||
|
||||
## Examples
|
||||
|
||||
|
||||
Loaded 100 of 887 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user