# Types: Customer to OrderState (/themes/sdk/reference/customer/types-2)

```ts
import { … } from '@poltura/theme-sdk/customer';
```

## `Customer` [#customer]

A signed-in shopper.

<TypeTable type={{"id":{"description":"The customer's id.","type":"string","required":true},"email":{"description":"The sign-in email address.","type":"string","required":true},"givenName":{"description":"The given name, or null.","type":"string | null","required":true},"familyName":{"description":"The family name, or null.","type":"string | null","required":true},"displayName":{"description":"The full name in the page language's name order; empty when neither name is set.","type":"string","required":true},"phone":{"description":"The phone number, or null.","type":"string | null","required":true},"companyName":{"description":"The company name, or null.","type":"string | null","required":true},"isBusiness":{"description":"Whether the shopper buys as a business.","type":"boolean","required":true},"createdAt":{"description":"When the account was created, as an ISO 8601 instant, or null.","type":"string | null","required":true}}} />

## `CustomerState` [#customerstate]

The signed-in shopper and the way out.

<TypeTable type={{"customer":{"description":"The signed-in shopper, or null when nobody is signed in or while it loads.","type":"Customer | null","required":true},"status":{"description":"Whether the shopper is loading, ready, or failed to load.","type":"'loading' | 'ready' | 'error'","required":true},"signOut":{"description":"Signs the shopper out and goes to the home page.","type":"() => Promise<void>","required":true}}} />

## `EmailCodeKind` [#emailcodekind]

The emailed step a shopper finishes on the verify page: a new account, a sign-in, a new password, a moved store account, or an outside account's sign-in.

```ts
type EmailCodeKind = 'sign-up' | 'sign-in' | 'password-reset' | 'store-move' | 'outside-account'
```

## `EmailCodeStepState` [#emailcodestepstate]

The verify page's state: asking for the code, asking for what finishes the step, or a step that is gone.

<TypeTable type={{"kind":{"description":"The step the shopper started, or null when this browser holds none.","type":"EmailCodeKind | null","required":true},"phase":{"description":"`code` until the code is typed, `continue` once held, `expired` when no step is left, `other-browser` when the link needs the browser that began it.","type":"'code' | 'continue' | 'expired' | 'other-browser'","required":true},"busy":{"description":"Whether a request is running.","type":"boolean","required":true},"asks":{"description":"What the `continue` phase asks besides the button: the earlier password of a moved store account, a new password for a sign-up or a too-weak moved one.","type":"{ readonly currentPassword: boolean; readonly newPassword: boolean; }","required":true},"values":{"description":"What the shopper typed.","type":"{ readonly code: string; readonly currentPassword: string; readonly password: string; readonly confirmPassword: string; }","required":true},"setValue":{"description":"Changes one value.","type":"(field: 'code' | 'currentPassword' | 'password' | 'confirmPassword', value: string) => void","required":true},"error":{"description":"Why the last submit failed, in the page language, or null.","type":"string | null","required":true},"recipient":{"description":"The masked address an emailed link signs in to, shown before the shopper continues, or null when the step names none.","type":"string | null","required":true},"signInHref":{"description":"The storefront path the `expired` phase signs the shopper in at: sign-in returning to a case email's page, or plain sign-in.","type":"string","required":true},"submit":{"description":"Sends the code in the `code` phase, finishes the step in the `continue` phase; finishing signs the shopper in and moves on to the page they came from.","type":"() => Promise<void>","required":true}}} />

## `FulfillmentStatus` [#fulfillmentstatus]

Where an order's delivery is.

```ts
type FulfillmentStatus = 'unfulfilled' | 'partial' | 'shipped' | 'delivered' | 'cancelled'
```

## `Order` [#order]

A placed order as its buyer sees it.

<TypeTable type={{"id":{"description":"The order's id.","type":"string","required":true},"number":{"description":"The order number the shopper quotes.","type":"string","required":true},"href":{"description":"The order's page in the account.","type":"string","required":true},"placedAt":{"description":"When it was placed, as an ISO 8601 instant.","type":"string","required":true},"status":{"description":"Where the order is.","type":"OrderStatus","required":true},"statusLabel":{"description":"The status in the page language.","type":"string","required":true},"currencyCode":{"description":"The order's currency.","type":"CurrencyCode","required":true},"totals":{"description":"What the order adds up to.","type":"CartTotals","required":true},"amountDue":{"description":"What the shopper still owes.","type":"Money","required":true},"lines":{"description":"The ordered lines.","type":"readonly OrderLine[]","required":true},"itemCount":{"description":"How many units were ordered.","type":"number","required":true},"shippingAddress":{"description":"Where it ships, or null for a digital order.","type":"Address | null","required":true},"billingAddress":{"description":"Where the invoice goes, or null.","type":"Address | null","required":true},"shippingMethod":{"description":"The delivery method the shopper chose, in the store's words, or null when the order has none.","type":"string | null","required":true},"pickupPoint":{"description":"The locker or pickup point the parcel goes to, or null for door delivery and older orders.","type":"OrderPickupPoint | null","required":true},"payment":{"description":"The payment state.","type":"OrderPayment","required":true},"fulfillment":{"description":"The delivery state.","type":"OrderFulfillment","required":true},"documents":{"description":"Documents to download.","type":"readonly OrderDocument[]","required":true}}} />

## `OrderDocument` [#orderdocument]

A downloadable order document.

<TypeTable type={{"kind":{"description":"What kind of document it is.","type":"OrderDocumentKind","required":true},"label":{"description":"Its name in the page language.","type":"string","required":true},"href":{"description":"Where it downloads from.","type":"string","required":true}}} />

## `OrderDocumentKind` [#orderdocumentkind]

What kind of document an order has.

```ts
type OrderDocumentKind = 'invoice' | 'proForma' | 'creditNote' | 'receipt'
```

## `OrderFulfillment` [#orderfulfillment]

An order's delivery state with its label and tracking.

<TypeTable type={{"status":{"description":"Where the delivery is.","type":"FulfillmentStatus","required":true},"label":{"description":"The status in the page language.","type":"string","required":true},"tracking":{"description":"Tracking per parcel.","type":"readonly OrderTracking[]","required":true}}} />

## `OrderLine` [#orderline]

One line of a placed order.

<TypeTable type={{"id":{"description":"The line's id.","type":"string","required":true},"title":{"description":"The product's title.","type":"string","required":true},"variantTitle":{"description":"The variant's title, or null for a single-variant product.","type":"string | null","required":true},"image":{"description":"The line's image, or null.","type":"MediaImageRef | null","required":true},"quantity":{"description":"How many units were ordered.","type":"number","required":true},"total":{"description":"The line total.","type":"Money","required":true},"isDigital":{"description":"Whether the item is delivered digitally.","type":"boolean","required":true}}} />

## `OrderPage` [#orderpage]

One page of the shopper's orders, newest first.

<TypeTable type={{"items":{"description":"The orders on this page.","type":"readonly OrderSummary[]","required":true},"total":{"description":"How many orders the shopper has over every page.","type":"number","required":true},"page":{"description":"The page number, from 1.","type":"number","required":true},"pageCount":{"description":"How many pages there are.","type":"number","required":true}}} />

## `OrderPayment` [#orderpayment]

An order's payment state with its label.

<TypeTable type={{"status":{"description":"Where the payment is.","type":"PaymentStatus","required":true},"label":{"description":"The status in the page language.","type":"string","required":true}}} />

## `OrderPickupPoint` [#orderpickuppoint]

The parcel locker or pickup point an order is delivered to.

<TypeTable type={{"name":{"description":"The point's name, as the carrier lists it.","type":"string","required":true},"addressLines":{"description":"The lines of its address, street first.","type":"readonly string[]","required":true}}} />

## `OrderState` [#orderstate]

One of the signed-in shopper's orders, as it loads.

<TypeTable type={{"order":{"description":"The order, or null while it loads or when the shopper has no such order.","type":"Order | null","required":true},"status":{"description":"Whether the order is loading, ready, or failed to load.","type":"'loading' | 'ready' | 'error'","required":true}}} />
