Types: Customer to OrderState
The types of @poltura/theme-sdk/customer, Customer to OrderState.
Ezen az oldalon
import { … } from '@poltura/theme-sdk/customer';Customer
A signed-in shopper.
idrequiredstringThe customer's id.
emailrequiredstringThe sign-in email address.
givenNamerequiredstring | nullThe given name, or null.
familyNamerequiredstring | nullThe family name, or null.
displayNamerequiredstringThe full name in the page language's name order; empty when neither name is set.
phonerequiredstring | nullThe phone number, or null.
companyNamerequiredstring | nullThe company name, or null.
isBusinessrequiredbooleanWhether the shopper buys as a business.
createdAtrequiredstring | nullWhen the account was created, as an ISO 8601 instant, or null.
CustomerState
The signed-in shopper and the way out.
customerrequiredCustomer | nullThe signed-in shopper, or null when nobody is signed in or while it loads.
statusrequired'loading' | 'ready' | 'error'Whether the shopper is loading, ready, or failed to load.
signOutrequired() => Promise<void>Signs the shopper out and goes to the home page.
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.
type EmailCodeKind = 'sign-up' | 'sign-in' | 'password-reset' | 'store-move' | 'outside-account'EmailCodeStepState
The verify page's state: asking for the code, asking for what finishes the step, or a step that is gone.
kindrequiredEmailCodeKind | nullThe step the shopper started, or null when this browser holds none.
phaserequired'code' | 'continue' | 'expired' | 'other-browser'`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.
busyrequiredbooleanWhether a request is running.
asksrequired{ readonly currentPassword: boolean; readonly newPassword: boolean; }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.
valuesrequired{ readonly code: string; readonly currentPassword: string; readonly password: string; readonly confirmPassword: string; }What the shopper typed.
setValuerequired(field: 'code' | 'currentPassword' | 'password' | 'confirmPassword', value: string) => voidChanges one value.
errorrequiredstring | nullWhy the last submit failed, in the page language, or null.
recipientrequiredstring | nullThe masked address an emailed link signs in to, shown before the shopper continues, or null when the step names none.
signInHrefrequiredstringThe storefront path the `expired` phase signs the shopper in at: sign-in returning to a case email's page, or plain sign-in.
submitrequired() => Promise<void>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.
FulfillmentStatus
Where an order's delivery is.
type FulfillmentStatus = 'unfulfilled' | 'partial' | 'shipped' | 'delivered' | 'cancelled'Order
A placed order as its buyer sees it.
idrequiredstringThe order's id.
numberrequiredstringThe order number the shopper quotes.
hrefrequiredstringThe order's page in the account.
placedAtrequiredstringWhen it was placed, as an ISO 8601 instant.
statusrequiredOrderStatusWhere the order is.
statusLabelrequiredstringThe status in the page language.
currencyCoderequiredCurrencyCodeThe order's currency.
totalsrequiredCartTotalsWhat the order adds up to.
amountDuerequiredMoneyWhat the shopper still owes.
linesrequiredreadonly OrderLine[]The ordered lines.
itemCountrequirednumberHow many units were ordered.
shippingAddressrequiredAddress | nullWhere it ships, or null for a digital order.
billingAddressrequiredAddress | nullWhere the invoice goes, or null.
shippingMethodrequiredstring | nullThe delivery method the shopper chose, in the store's words, or null when the order has none.
pickupPointrequiredOrderPickupPoint | nullThe locker or pickup point the parcel goes to, or null for door delivery and older orders.
paymentrequiredOrderPaymentThe payment state.
fulfillmentrequiredOrderFulfillmentThe delivery state.
documentsrequiredreadonly OrderDocument[]Documents to download.
OrderDocument
A downloadable order document.
kindrequiredOrderDocumentKindWhat kind of document it is.
labelrequiredstringIts name in the page language.
hrefrequiredstringWhere it downloads from.
OrderDocumentKind
What kind of document an order has.
type OrderDocumentKind = 'invoice' | 'proForma' | 'creditNote' | 'receipt'OrderFulfillment
An order's delivery state with its label and tracking.
statusrequiredFulfillmentStatusWhere the delivery is.
labelrequiredstringThe status in the page language.
trackingrequiredreadonly OrderTracking[]Tracking per parcel.
OrderLine
One line of a placed order.
idrequiredstringThe line's id.
titlerequiredstringThe product's title.
variantTitlerequiredstring | nullThe variant's title, or null for a single-variant product.
imagerequiredMediaImageRef | nullThe line's image, or null.
quantityrequirednumberHow many units were ordered.
totalrequiredMoneyThe line total.
isDigitalrequiredbooleanWhether the item is delivered digitally.
OrderPage
One page of the shopper's orders, newest first.
itemsrequiredreadonly OrderSummary[]The orders on this page.
totalrequirednumberHow many orders the shopper has over every page.
pagerequirednumberThe page number, from 1.
pageCountrequirednumberHow many pages there are.
OrderPayment
An order's payment state with its label.
statusrequiredPaymentStatusWhere the payment is.
labelrequiredstringThe status in the page language.
OrderPickupPoint
The parcel locker or pickup point an order is delivered to.
namerequiredstringThe point's name, as the carrier lists it.
addressLinesrequiredreadonly string[]The lines of its address, street first.
OrderState
One of the signed-in shopper's orders, as it loads.
orderrequiredOrder | nullThe order, or null while it loads or when the shopper has no such order.
statusrequired'loading' | 'ready' | 'error'Whether the order is loading, ready, or failed to load.