import { WorkflowData } from "@medusajs/framework/workflows-sdk"; import { AdditionalData, ListShippingOptionsForCartWithPricingWorkflowInput } from "@medusajs/framework/types"; export declare const listShippingOptionsForCartWithPricingWorkflowId = "list-shipping-options-for-cart-with-pricing"; /** * This workflow lists shipping options that can be used during checkout for a cart. It also retrieves the prices * of these shipping options, including calculated prices that may be retrieved from third-party providers. * * This workflow is executed in other cart-related workflows, such as {@link addShippingMethodToCartWorkflow} to retrieve the * 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. * * @example * const { result } = await listShippingOptionsForCartWithPricingWorkflow(container) * .run({ * input: { * cart_id: "cart_123", * options: [ * { * id: "so_123", * data: { * carrier_code: "fedex" * } * } * ] * } * }) * * @summary * * List a cart's shipping options with prices. * * @property hooks.setShippingOptionsContext - This hook is executed after the cart is retrieved and before the shipping options are queried. You can consume this hook to return any custom context useful for the shipping options retrieval. * * For example, you can consume the hook to add the customer Id to the context: * * ```ts * import { listShippingOptionsForCartWithPricingWorkflow } from "@medusajs/medusa/core-flows" * import { StepResponse } from "@medusajs/workflows-sdk" * * listShippingOptionsForCartWithPricingWorkflow.hooks.setShippingOptionsContext( * async ({ cart }, { container }) => { * * if (cart.customer_id) { * return new StepResponse({ * customer_id: cart.customer_id, * }) * } * * const query = container.resolve("query") * * const { data: carts } = await query.graph({ * entity: "cart", * filters: { * id: cart.id, * }, * fields: ["customer_id"], * }) * * return new StepResponse({ * customer_id: carts[0].customer_id, * }) * } * ) * ``` * * The `customer_id` property will be added to the context along with other properties such as `is_return` and `enabled_in_store`. * * :::note * * You should also consume the `setShippingOptionsContext` hook in the {@link listShippingOptionsForCartWorkflow} workflow to ensure that the context is consistent when listing shipping options across workflows. * * ::: */ export declare const listShippingOptionsForCartWithPricingWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow) & string[]; additional_data: ((Record | WorkflowData | undefined>) & Record) | undefined; }, Record | undefined>]>; //# sourceMappingURL=list-shipping-options-for-cart-with-pricing.d.ts.map