Order
Order
An Order is created whenever a Customer adds an item to the cart. It contains all the information required to fulfill an order: which ProductVariants in what quantities; the shipping address and price; any applicable promotions; payments etc.
An Order exists in a well-defined state according to the OrderState type. A state machine is used to govern the transition from one state to another.
Signature
class Order extends VendureEntity implements ChannelAware, HasCustomFields {
constructor(input?: DeepPartial<Order>)
@Column() code: string;
@Column('varchar') state: OrderState;
@Column({ default: true })
active: boolean;
@Column({ nullable: true })
orderPlacedAt?: Date;
@ManyToOne(type => Customer)
customer?: Customer;
@OneToMany(type => OrderLine, line => line.order)
lines: OrderLine[];
@OneToMany(type => Surcharge, surcharge => surcharge.order)
surcharges: Surcharge[];
@Column('simple-array')
couponCodes: string[];
@ManyToMany(type => Promotion)
@JoinTable()
promotions: Promotion[];
@Column('simple-json') shippingAddress: OrderAddress;
@Column('simple-json') billingAddress: OrderAddress;
@OneToMany(type => Payment, payment => payment.order)
payments: Payment[];
@Column('varchar')
currencyCode: CurrencyCode;
@Column(type => CustomOrderFields)
customFields: CustomOrderFields;
@EntityId({ nullable: true })
taxZoneId?: ID;
@ManyToMany(type => Channel)
@JoinTable()
channels: Channel[];
@OneToMany(type => OrderModification, modification => modification.order)
modifications: OrderModification[];
@Column()
subTotal: number;
@Column()
subTotalWithTax: number;
@OneToMany(type => ShippingLine, shippingLine => shippingLine.order)
shippingLines: ShippingLine[];
@Column({ default: 0 })
shipping: number;
@Column({ default: 0 })
shippingWithTax: number;
discounts: Discount[]
total: number
totalWithTax: number
totalQuantity: number
taxSummary: OrderTaxSummary[]
getOrderItems() => OrderItem[];
}
Extends
Implements
- ChannelAware
- HasCustomFields
Members
constructor
(input?: DeepPartial<Order>) => Order
code
string
state
OrderState
active
boolean
orderPlacedAt
Date
customer
Customer
lines
OrderLine[]
surcharges
Surcharge[]
couponCodes
string[]
promotions
Promotion[]
shippingAddress
OrderAddress
billingAddress
OrderAddress
payments
Payment[]
currencyCode
CurrencyCode
customFields
CustomOrderFields
taxZoneId
ID
channels
Channel[]
modifications
OrderModification[]
subTotal
number
discountedLinePrice
values.
subTotalWithTax
number
shippingLines
ShippingLine[]
shipping
number
shippingLines
.
shippingWithTax
number
discounts
Discount[]
total
number
subTotal
plus shipping
totalWithTax
number
subTotalWithTax
plus shippingWithTax
.
totalQuantity
number
taxSummary
OrderTaxSummary[]
getOrderItems
() => OrderItem[]