new LineItem()
- Source:
Methods
(static) LineItem#getAlternateName() → {Null|String}
Get the field value
Alternate name of the line item.
- Source:
Returns:
- Type
- Null | String
(static) LineItem#getBinName() → {Null|String}
Get the field value
- Source:
Returns:
- Type
- Null | String
(static) LineItem#getCreatedTime() → {Number}
Get the field value
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getDiscountAmount() → {Null|Number}
Get the field value
Unnamed fixed discount amount in cents. Or, in reporting, this may be the calculated sum of all the line item discounts.
- Source:
Returns:
must be a long integer
- Type
- Null | Number
(static) LineItem#getDiscounts() → {Array.<order.Discount>}
Get the field value
List of discounts applied to the line item. Each line item on an order may have zero or more percentage or amount discounts. Line item discounts are separate from order-level discounts (which are applied to the order subtotal).
- Source:
Returns:
An array of
- Type
- Array.<order.Discount>
(static) LineItem#getExchanged() → {Boolean}
Get the field value
- Source:
Returns:
- Type
- Boolean
(static) LineItem#getExchangedLineItem() → {Null|base.Reference}
Get the field value
- Source:
Returns:
- Type
- Null | base.Reference
(static) LineItem#getId() → {String}
Get the field value
Unique identifier.
- Source:
Returns:
- Type
- String
(static) LineItem#getIsRevenue() → {Boolean}
Get the field value
True if this item should be counted as revenue, for example gift cards and donations would not.
- Source:
Returns:
- Type
- Boolean
(static) LineItem#getItem() → {Null|base.Reference}
Get the field value
A reference to the inventory item that was used to create this line item. Note that since this a reference the item can be changed and deleted any time such that it no longer matches this line item.
- Source:
Returns:
- Type
- Null | base.Reference
(static) LineItem#getItemCode() → {Null|String}
Get the field value
- Source:
Returns:
- Type
- Null | String
(static) LineItem#getModifications() → {Array.<order.Modification>}
Get the field value
List of references to modifications applied to this line item.
- Source:
Returns:
An array of
- Type
- Array.<order.Modification>
(static) LineItem#getName() → {Null|String}
Get the field value
Line item name.
- Source:
Returns:
- Type
- Null | String
(static) LineItem#getNote() → {Null|String}
Get the field value
- Source:
Returns:
- Type
- Null | String
(static) LineItem#getOrderClientCreatedTime() → {Number}
Get the field value
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getOrderLevelDiscountAmount() → {Number}
Get the field value
The calculated sum of order level discounts attributed, approximately to the nearest cent, to this the line item. This is only used in reporting.
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getOrderLevelDiscounts() → {Array.<order.Discount>}
Get the field value
List of order level discounts attributed to this line item. Amounts are rounded to the nearest penny. This is for reporting purposes only. These rounding approximates are not used when calculating the transaction.
- Source:
Returns:
An array of
- Type
- Array.<order.Discount>
(static) LineItem#getOrderRef() → {base.Reference}
Get the field value
Reference to the order with which the line item is associated.
- Source:
Returns:
- Type
- base.Reference
(static) LineItem#getPayments() → {Array.<payments.LineItemPayment>}
Get the field value
Payments that apply to this line item
- Source:
Returns:
An array of
- Type
- Array.<payments.LineItemPayment>
(static) LineItem#getPrice() → {Number}
Get the field value
Price of the item, typically in cents of merchant currency. When unit quantity is not null then this is the price for a single unit and is not the complete price.
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getPriceWithModifiers() → {Number}
Get the field value
Price of item after adding all modifications. This is used only for reporting.
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getPriceWithModifiersAndItemAndOrderDiscounts() → {Number}
Get the field value
Price of item after adding all modifications and subtracting all line item and order level discounts. This is used only for reporting.
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getPrinted() → {Boolean}
Get the field value
True if this line item has been printed out on an order printer at least once already.
- Source:
Returns:
- Type
- Boolean
(static) LineItem#getQuantitySold() → {Number}
Get the field value
Quantity sold for this line item. This field is only used in reporting
- Source:
Returns:
must be a double
- Type
- Number
(static) LineItem#getRefund() → {payments.Refund}
Get the field value
direct item refund
- Source:
Returns:
- Type
- payments.Refund
(static) LineItem#getRefunded() → {Boolean}
Get the field value
True if this line item has been refunded
- Source:
Returns:
- Type
- Boolean
(static) LineItem#getRevenueAmount() → {Number}
Get the field value
Revenue collected for this. This field is only used in reporting.
- Source:
Returns:
must be a long integer
- Type
- Number
(static) LineItem#getTaxRates() → {Array.<inventory.TaxRate>}
Get the field value
Tax rates that apply to this line item
- Source:
Returns:
An array of
- Type
- Array.<inventory.TaxRate>
(static) LineItem#getUnitName() → {Null|String}
Get the field value
Unit name (e.g. oz, lb, etc) if priced by unit, otherwise null.
- Source:
Returns:
- Type
- Null | String
(static) LineItem#getUnitQty() → {Null|Number}
Get the field value
Unit quantity if this line item is priced by quantity, or null if the item is not priced by quantity. The value is a fixed-point integer with scaling factor of 1000 (e.g. if charging by ounces then the value should be set to 2500 for 2.5 ounces). To compute the complete price perform the following calculation: PRICE * (UNIT QTY / 1000).
- Source:
Returns:
must be an integer
- Type
- Null | Number
(static) LineItem#getUserData() → {Null|String}
Get the field value
- Source:
Returns:
- Type
- Null | String
(static) LineItem#setAlternateName(alternateName)
Set the field value
Alternate name of the line item.
Parameters:
Name | Type | Description |
---|---|---|
alternateName |
Null | String |
- Source:
(static) LineItem#setBinName(binName)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
binName |
Null | String |
- Source:
(static) LineItem#setCreatedTime(createdTime)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
createdTime |
Number | must be a long integer |
- Source:
(static) LineItem#setDiscountAmount(discountAmount)
Set the field value
Unnamed fixed discount amount in cents. Or, in reporting, this may be the calculated sum of all the line item discounts.
Parameters:
Name | Type | Description |
---|---|---|
discountAmount |
Null | Number | must be a long integer |
- Source:
(static) LineItem#setDiscounts(discounts)
Set the field value
List of discounts applied to the line item. Each line item on an order may have zero or more percentage or amount discounts. Line item discounts are separate from order-level discounts (which are applied to the order subtotal).
Parameters:
Name | Type | Description |
---|---|---|
discounts |
Array.<order.Discount> | An array of |
- Source:
(static) LineItem#setExchanged(exchanged)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
exchanged |
Boolean |
- Source:
(static) LineItem#setExchangedLineItem(exchangedLineItem)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
exchangedLineItem |
Null | base.Reference |
- Source:
(static) LineItem#setId(id)
Set the field value
Unique identifier.
Parameters:
Name | Type | Description |
---|---|---|
id |
String |
- Source:
(static) LineItem#setIsRevenue(isRevenue)
Set the field value
True if this item should be counted as revenue, for example gift cards and donations would not.
Parameters:
Name | Type | Description |
---|---|---|
isRevenue |
Boolean |
- Source:
(static) LineItem#setItem(item)
Set the field value
A reference to the inventory item that was used to create this line item. Note that since this a reference the item can be changed and deleted any time such that it no longer matches this line item.
Parameters:
Name | Type | Description |
---|---|---|
item |
Null | base.Reference |
- Source:
(static) LineItem#setItemCode(itemCode)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
itemCode |
Null | String |
- Source:
(static) LineItem#setModifications(modifications)
Set the field value
List of references to modifications applied to this line item.
Parameters:
Name | Type | Description |
---|---|---|
modifications |
Array.<order.Modification> | An array of |
- Source:
(static) LineItem#setName(name)
Set the field value
Line item name.
Parameters:
Name | Type | Description |
---|---|---|
name |
Null | String |
- Source:
(static) LineItem#setNote(note)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
note |
Null | String |
- Source:
(static) LineItem#setOrderClientCreatedTime(orderClientCreatedTime)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
orderClientCreatedTime |
Number | must be a long integer |
- Source:
(static) LineItem#setOrderLevelDiscountAmount(orderLevelDiscountAmount)
Set the field value
The calculated sum of order level discounts attributed, approximately to the nearest cent, to this the line item. This is only used in reporting.
Parameters:
Name | Type | Description |
---|---|---|
orderLevelDiscountAmount |
Number | must be a long integer |
- Source:
(static) LineItem#setOrderLevelDiscounts(orderLevelDiscounts)
Set the field value
List of order level discounts attributed to this line item. Amounts are rounded to the nearest penny. This is for reporting purposes only. These rounding approximates are not used when calculating the transaction.
Parameters:
Name | Type | Description |
---|---|---|
orderLevelDiscounts |
Array.<order.Discount> | An array of |
- Source:
(static) LineItem#setOrderRef(orderRef)
Set the field value
Reference to the order with which the line item is associated.
Parameters:
Name | Type | Description |
---|---|---|
orderRef |
base.Reference |
- Source:
(static) LineItem#setPayments(payments)
Set the field value
Payments that apply to this line item
Parameters:
Name | Type | Description |
---|---|---|
payments |
Array.<payments.LineItemPayment> | An array of |
- Source:
(static) LineItem#setPrice(price)
Set the field value
Price of the item, typically in cents of merchant currency. When unit quantity is not null then this is the price for a single unit and is not the complete price.
Parameters:
Name | Type | Description |
---|---|---|
price |
Number | must be a long integer |
- Source:
(static) LineItem#setPriceWithModifiers(priceWithModifiers)
Set the field value
Price of item after adding all modifications. This is used only for reporting.
Parameters:
Name | Type | Description |
---|---|---|
priceWithModifiers |
Number | must be a long integer |
- Source:
(static) LineItem#setPriceWithModifiersAndItemAndOrderDiscounts(priceWithModifiersAndItemAndOrderDiscounts)
Set the field value
Price of item after adding all modifications and subtracting all line item and order level discounts. This is used only for reporting.
Parameters:
Name | Type | Description |
---|---|---|
priceWithModifiersAndItemAndOrderDiscounts |
Number | must be a long integer |
- Source:
(static) LineItem#setPrinted(printed)
Set the field value
True if this line item has been printed out on an order printer at least once already.
Parameters:
Name | Type | Description |
---|---|---|
printed |
Boolean |
- Source:
(static) LineItem#setQuantitySold(quantitySold)
Set the field value
Quantity sold for this line item. This field is only used in reporting
Parameters:
Name | Type | Description |
---|---|---|
quantitySold |
Number | must be a double |
- Source:
(static) LineItem#setRefund(refund)
Set the field value
direct item refund
Parameters:
Name | Type | Description |
---|---|---|
refund |
payments.Refund |
- Source:
(static) LineItem#setRefunded(refunded)
Set the field value
True if this line item has been refunded
Parameters:
Name | Type | Description |
---|---|---|
refunded |
Boolean |
- Source:
(static) LineItem#setRevenueAmount(revenueAmount)
Set the field value
Revenue collected for this. This field is only used in reporting.
Parameters:
Name | Type | Description |
---|---|---|
revenueAmount |
Number | must be a long integer |
- Source:
(static) LineItem#setTaxRates(taxRates)
Set the field value
Tax rates that apply to this line item
Parameters:
Name | Type | Description |
---|---|---|
taxRates |
Array.<inventory.TaxRate> | An array of |
- Source:
(static) LineItem#setUnitName(unitName)
Set the field value
Unit name (e.g. oz, lb, etc) if priced by unit, otherwise null.
Parameters:
Name | Type | Description |
---|---|---|
unitName |
Null | String |
- Source:
(static) LineItem#setUnitQty(unitQty)
Set the field value
Unit quantity if this line item is priced by quantity, or null if the item is not priced by quantity. The value is a fixed-point integer with scaling factor of 1000 (e.g. if charging by ounces then the value should be set to 2500 for 2.5 ounces). To compute the complete price perform the following calculation: PRICE * (UNIT QTY / 1000).
Parameters:
Name | Type | Description |
---|---|---|
unitQty |
Null | Number | must be an integer |
- Source:
(static) LineItem#setUserData(userData)
Set the field value
Parameters:
Name | Type | Description |
---|---|---|
userData |
Null | String |
- Source: