OrderItem

OrderItem

OrderItem

An individual item of an OrderLine.

Signature

class OrderItem extends VendureEntity {
  constructor(input?: DeepPartial<OrderItem>)
  @ManyToOne(type => OrderLine, line => line.items, { onDelete: 'CASCADE' })
    line: OrderLine;
  @Column()
    listPrice: number;
  @Column()
    listPriceIncludesTax: boolean;
  @Column('simple-json')
    adjustments: Adjustment[];
  @Column('simple-json')
    taxLines: TaxLine[];
  @ManyToMany(type => Fulfillment, fulfillment => fulfillment.orderItems)
    @JoinTable()
    fulfillments: Fulfillment[];
  @ManyToOne(type => Refund)
    refund: Refund;
  @EntityId({ nullable: true })
    refundId: ID | null;
  @OneToOne(type => Cancellation, cancellation => cancellation.orderItem)
    cancellation: Cancellation;
  @Column({ default: false })
    cancelled: boolean;
  fulfillment: Fulfillment | undefined
  unitPrice: number
  unitPriceWithTax: number
  taxRate: number
  unitTax: number
  discountedUnitPrice: number
  discountedUnitPriceWithTax: number
  proratedUnitPrice: number
  proratedUnitPriceWithTax: number
  proratedUnitTax: number
  addAdjustment(adjustment: Adjustment) => ;
  clearAdjustments(type?: AdjustmentType) => ;
}

Extends

Members

constructor

method
type:
(input?: DeepPartial<OrderItem>) => OrderItem

line

property
type:
OrderLine

listPrice

property
type:
number
This is the price as listed by the ProductVariant, which, depending on the current Channel, may or may not include tax.

listPriceIncludesTax

property
type:
boolean
Whether or not the listPrice includes tax, which depends on the settings of the current Channel.

adjustments

property
type:
Adjustment[]

taxLines

property
type:
TaxLine[]

fulfillments

property
type:
Fulfillment[]

refund

property
type:
Refund

refundId

property
type:
ID | null

cancellation

property
type:
Cancellation

cancelled

property
type:
boolean

fulfillment

property
type:
Fulfillment | undefined

unitPrice

property
type:
number

unitPriceWithTax

property
type:
number

taxRate

property
type:
number
The total applicable tax rate, which is the sum of all taxLines on this OrderItem.

unitTax

property
type:
number

discountedUnitPrice

property
type:
number

discountedUnitPriceWithTax

property
type:
number

proratedUnitPrice

property
type:
number

proratedUnitPriceWithTax

property
type:
number

proratedUnitTax

property
type:
number

addAdjustment

method
type:
(adjustment: Adjustment) =>

clearAdjustments

method
type:
(type?: AdjustmentType) =>