UNPKG

@medusajs/core-flows

Version:

Set of workflow definitions for Medusa

44 lines 1.75 kB
import { WorkflowData } from "@medusajs/framework/workflows-sdk"; /** * The data to complete a cart and place an order. */ export type CompleteCartWorkflowInput = { /** * The ID of the cart to complete. */ id: string; }; export type CompleteCartWorkflowOutput = { /** * The ID of the order that was created. */ id: string; }; export declare const completeCartWorkflowId = "complete-cart"; /** * This workflow completes a cart and places an order for the customer. It's executed by the * [Complete Cart Store API Route](https://docs.medusajs.com/api/store#carts_postcartsidcomplete). * * You can use this workflow within your own customizations or custom workflows, allowing you to wrap custom logic around completing a cart. * 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. * * @example * const { result } = await completeCartWorkflow(container) * .run({ * input: { * id: "cart_123" * } * }) * * @summary * * Complete a cart and place an order. * * @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 completeCartWorkflow: import("@medusajs/framework/workflows-sdk").ReturnWorkflow<CompleteCartWorkflowInput, CompleteCartWorkflowOutput, [import("@medusajs/framework/workflows-sdk").Hook<"validate", { input: WorkflowData<CompleteCartWorkflowInput>; cart: any; }, unknown>]>; //# sourceMappingURL=complete-cart.d.ts.map