OrderItems
Returns Items ordered for every order.
Table Specific Information
Inserting an Existing Product
To insert an existing product to the OrderItems for a specified Order, order options for that table must be specified. For this reason, before inserting an existing product to the OrderItems, you need to populate a temporary OrderItemOptionValues table with the desired options for the selected product and use this table as a value for the LinkedOrderOptions Pseudo-Column during insertion:
INSERT INTO OrderItemOptionValues#TEMP (Id,Value) Values (117,177); INSERT INTO OrderItemOptionValues#TEMP (Id,Value) Values (116,176); INSERT INTO OrderItems (OrderId,ProductId,QuantityOrdered, LinkedOrderOptions) VALUES (1104,960,3, OrderItemOptionValues#TEMP)");
Note: The OrderItemOptionValue inserted to the temporary table must belong to the product that is being inserted into OrderItems. To verify this, check the ProductOptionValues table.
Inserting a New Product
New, custom products, can be added to the OrderItems table as follows:
INSERT INTO OrderItems (OrderId,Name,CustomSKU,PriceIncTax,PriceExTax,QuantityOrdered) VALUES (1107,'TSS Phone Case','PHC-232453',6.55,5.75,1);
Note: OrderItems does not allow for Updates or Deletes. Once items have been added to an order, they cannot be removed or modified.
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | Integer | True |
Numeric ID of this product within this order. |
ProductId | Integer | False |
Numeric ID of the product. |
CustomSKU | String | False |
User defined product code/stock keeping unit (SKU). |
OrderId | Integer | False |
Numeric ID of the associated order. |
Name | String | False |
The product name. |
PriceExTax | Decimal | False |
The price of the product, excluding tax. |
PriceIncTax | Decimal | False |
The price of the product, including tax. |
QuantityOrdered | Integer | False |
Quantity of the product ordered. |
QuantityShipped | Integer | True |
Quantity of the product shipped. |
TotalExtax | Decimal | True |
Total base price, excluding tax. |
TotalIncTax | Decimal | True |
Total base price, including tax. |
IsRefunded | Boolean | True |
Whether the product has been refunded. |
ExternalId | Integer | False |
ID of the order in another system. |
AppliedDiscounts | String | True |
Array of objects containing discounts applied to the product. |
Pseudo-Columns
Pseudo column fields are used to enable the user to INSERT Fields that are non-readable but required during creation of new records.
Name | Type | Description |
LinkedOrderOptions | String |
Column for the aggregate table name holding option values. |