# draft_order_data

> The draft order about to be created (Draft Orders, server plan): a quote, or a checkout or buy now with a custom price. An error a filter throws shows in the cart or the form.

Status: Ready (Smootify 2.0)  
URL: https://www.smootify.io/docs/reference/api/filters/draft-order-data  
Updated: 2026-10-13

The draft order about to be created (Draft Orders, server plan): a quote, or a checkout or buy now with a custom price. An error a filter throws shows in the cart or the form.

Add it with `Smootify.addFilter`: answer the value changed, nothing to keep it, or `false` to stop.

```ts
draft_order_data: ( data: DraftOrderData, context: DraftOrderContext, ) => FilterAnswer<DraftOrderData> | Promise<FilterAnswer<DraftOrderData>>
```

## Types

### DraftOrderData

```ts
/** A draft order as Smootify creates it (Draft Orders): what `getCartAsDraftOrderData` answers, what `draft_order_data` filters. */
export interface DraftOrderData {
  input: {
    lineItems: Record<string, unknown>[];
    customAttributes?: { key: string; value: string }[];
    note?: string;
    presentmentCurrencyCode?: string;
  };
  customerId?: string;
  email?: string;
}
```

### DraftOrderContext

```ts
export interface DraftOrderContext {
  reason: "quote" | "checkout" | "buy-now";
}
```

### FilterAnswer

```ts
/** What a filter answers: the value changed, nothing (`undefined`) to keep it, `false` to stop. */
export type FilterAnswer<T> = T | false | undefined;
```
