@medusajs/core-flows
Version:
Set of workflow definitions for Medusa
40 lines • 1.64 kB
TypeScript
import { WorkflowData } from "@medusajs/framework/workflows-sdk";
/**
* The details of the cart to refresh.
*/
export type RefreshCartShippingMethodsWorkflowInput = {
/**
* The cart's ID.
*/
cart_id?: string;
/**
* The Cart reference.
*/
cart?: any;
};
export declare const refreshCartShippingMethodsWorkflowId = "refresh-cart-shipping-methods";
/**
* This workflow refreshes a cart's shipping methods, ensuring that their associated shipping options can still be used on the cart,
* and retrieve their correct pricing after a cart update. This workflow is used by the {@link refreshCartItemsWorkflow}.
*
* 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.
*
* @example
* const { result } = await refreshCartShippingMethodsWorkflow(container)
* .run({
* input: {
* cart_id: "cart_123",
* }
* })
*
* @summary
*
* Refresh a cart's shipping methods after an update.
*
* @property hooks.validate - 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.
*/
export declare const refreshCartShippingMethodsWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<RefreshCartShippingMethodsWorkflowInput, undefined, [import("@medusajs/framework/workflows-sdk").Hook<"validate", {
input: WorkflowData<RefreshCartShippingMethodsWorkflowInput>;
cart: any;
}, unknown>]>;
//# sourceMappingURL=refresh-cart-shipping-methods.d.ts.map