# List line item across orders

Endpoint: GET /lineitems/{direction}
Version: 1.0.457.36910
Security: OAuth2

## Path parameters:

  - `direction` (string, required)
    Direction of the order, from the current user's perspective.
    Enum: "Incoming", "Outgoing", "All"

## Query parameters:

  - `buyerID` (string)
    ID of the buyer.

  - `supplierID` (string)
    ID of the supplier.

  - `from` (string)
    Lower bound of date range that the order was created.

  - `to` (string)
    Upper bound of date range that the order was created.

  - `search` (string)
    Word or phrase to search for.

  - `searchOn` (array)
    Comma-delimited list of fields to search on.
    Enum: "ID", "ProductID"

  - `searchType` (string)
    Type of search to perform.
    Enum: "AnyTerm", "AllTermsAnyField", "AllTermsSameField", "ExactPhrase", "ExactPhrasePrefix"

  - `sortBy` (array)
    Comma-delimited list of fields to sort by.
    Enum: "DateAdded", "ID", "ProductID", "!DateAdded", "!ID", "!ProductID"

  - `page` (integer)
    Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.

  - `pageSize` (integer)
    Number of results to return per page.

  - `filters` (object)
    An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'

## Response 200 fields (application/json):

  - `Items` (array)
    Example: [{"OrderID":"","Order":{"ID":"","FromUser":{"ID":"","CompanyID":"","Username":"","Password":"","FirstName":"","LastName":"","Email":"","Phone":"","TermsAccepted":"2018-01-01T00:00:00-06:00","Active":false,"xp":{},"AvailableRoles":[""],"Locale":{"ID":"","OwnerID":"","Currency":"","Language":""},"DateCreated":"2018-01-01T00:00:00-06:00","LastActive":"2018-01-01T00:00:00-06:00","PasswordLastSetDate":"2018-01-01T00:00:00-06:00"},"FromCompanyID":"","ToCompanyID":"","FromUserID":"","BillingAddressID":"","BillingAddress":{"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}},"ShippingAddressID":"","Comments":"","LineItemCount":0,"Status":"Unsubmitted","DateCreated":"2018-01-01T00:00:00-06:00","DateSubmitted":"2018-01-01T00:00:00-06:00","DateApproved":"2018-01-01T00:00:00-06:00","DateDeclined":"2018-01-01T00:00:00-06:00","DateCanceled":"2018-01-01T00:00:00-06:00","DateCompleted":"2018-01-01T00:00:00-06:00","LastUpdated":"2018-01-01T00:00:00-06:00","Subtotal":0,"ShippingCost":0,"TaxCost":0,"Gratuity":0,"Fees":0,"BaseDiscount":0,"PromotionDiscount":0,"Currency":"","Total":0,"IsSubmitted":false,"SubscriptionID":"","xp":{}},"ID":"","ProductID":"","Quantity":0,"BundleItemID":"","IsBundle":false,"DateAdded":"2018-01-01T00:00:00-06:00","QuantityShipped":0,"UnitPrice":0,"PromotionDiscount":0,"BaseDiscount":0,"DiscountID":"","LineTotal":0,"LineSubtotal":0,"CostCenter":"","DateNeeded":"2018-01-01T00:00:00-06:00","ShippingAccount":"","ShippingAddressID":"","ShipFromAddressID":"","Product":{"ID":"","Name":"","Description":"","Returnable":false,"QuantityMultiplier":0,"ShipWeight":0,"ShipHeight":0,"ShipWidth":0,"ShipLength":0,"DefaultSupplierID":"","ParentID":"","xp":{}},"Variant":{"ID":"","Name":"","Description":"","ShipWeight":0,"ShipHeight":0,"ShipWidth":0,"ShipLength":0,"xp":{}},"ShippingAddress":{"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}},"ShipFromAddress":{"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}},"SupplierID":"","InventoryRecordID":"","PriceScheduleID":"","IsOnSale":false,"PriceOverridden":false,"Specs":[{"SpecID":"","Name":"","OptionID":"","Value":"","PriceMarkupType":"NoMarkup","PriceMarkup":0}],"IncomingOrderID":"","OutgoingOrderID":"","xp":{}}]

  - `Items.OrderID` (string)

  - `Items.Order` (object)
    Currently unused.
    Example: {"ID":"","FromUser":{"ID":"","CompanyID":"","Username":"","Password":"","FirstName":"","LastName":"","Email":"","Phone":"","TermsAccepted":"2018-01-01T00:00:00-06:00","Active":false,"xp":{},"AvailableRoles":[""],"Locale":{"ID":"","OwnerID":"","Currency":"","Language":""},"DateCreated":"2018-01-01T00:00:00-06:00","LastActive":"2018-01-01T00:00:00-06:00","PasswordLastSetDate":"2018-01-01T00:00:00-06:00"},"FromCompanyID":"","ToCompanyID":"","FromUserID":"","BillingAddressID":"","BillingAddress":{"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}},"ShippingAddressID":"","Comments":"","LineItemCount":0,"Status":"Unsubmitted","DateCreated":"2018-01-01T00:00:00-06:00","DateSubmitted":"2018-01-01T00:00:00-06:00","DateApproved":"2018-01-01T00:00:00-06:00","DateDeclined":"2018-01-01T00:00:00-06:00","DateCanceled":"2018-01-01T00:00:00-06:00","DateCompleted":"2018-01-01T00:00:00-06:00","LastUpdated":"2018-01-01T00:00:00-06:00","Subtotal":0,"ShippingCost":0,"TaxCost":0,"Gratuity":0,"Fees":0,"BaseDiscount":0,"PromotionDiscount":0,"Currency":"","Total":0,"IsSubmitted":false,"SubscriptionID":"","xp":{}}

  - `Items.Order.ID` (string)

  - `Items.Order.FromUser` (object)
    User placing the order.
    Example: {"ID":"","CompanyID":"","Username":"","Password":"","FirstName":"","LastName":"","Email":"","Phone":"","TermsAccepted":"2018-01-01T00:00:00-06:00","Active":false,"xp":{},"AvailableRoles":[""],"Locale":{"ID":"","OwnerID":"","Currency":"","Language":""},"DateCreated":"2018-01-01T00:00:00-06:00","LastActive":"2018-01-01T00:00:00-06:00","PasswordLastSetDate":"2018-01-01T00:00:00-06:00"}

  - `Items.Order.FromUser.ID` (string)

  - `Items.Order.FromUser.CompanyID` (string)

  - `Items.Order.FromUser.Username` (string)
    Must be unique across all organizations.

  - `Items.Order.FromUser.Password` (string)

  - `Items.Order.FromUser.FirstName` (string)

  - `Items.Order.FromUser.LastName` (string)

  - `Items.Order.FromUser.Email` (string)

  - `Items.Order.FromUser.Phone` (string)

  - `Items.Order.FromUser.TermsAccepted` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.FromUser.Active` (boolean)
    If false, authentication is prohibited.

  - `Items.Order.FromUser.xp` (object)
    Example: {}

  - `Items.Order.FromUser.AvailableRoles` (array)
    List of roles currently available to the user via all security profile assignments.
    Example: [""]

  - `Items.Order.FromUser.Locale` (object)
    Most specific locale assigned to the user, if any.
    Example: {"ID":"","OwnerID":"","Currency":"","Language":""}

  - `Items.Order.FromUser.Locale.ID` (string)

  - `Items.Order.FromUser.Locale.OwnerID` (string)
    ID of the organization that owns the Locale. Only the marketplace owner can override the OwnerID on create.

  - `Items.Order.FromUser.Locale.Currency` (string)
    We recommend using ISO-4217 currency codes for compatibility with tax and payment processors.

  - `Items.Order.FromUser.Locale.Language` (string)
    We recommend using ISO-639 language code - ISO-3166 Country code (e.g. en-US).

  - `Items.Order.FromUser.DateCreated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.FromUser.LastActive` (string)
    Accurate within a few minutes. Includes impersonation activity.
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.FromUser.PasswordLastSetDate` (string)
    Can be used in conjunction with SecurityProfile.PasswordConfig to enforce password reset schedules.
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.FromCompanyID` (string)
    ID of the Buyer placing the order, or the marketplace owner when an order is being forwarded. Mainly useful to the marketplace owner or supplier receiving it.

  - `Items.Order.ToCompanyID` (string)
    ID of the marketplace owner or supplier receiving the order, only writable on create. Mainly useful to the user placing it.

  - `Items.Order.FromUserID` (string)
    This property is only writable when creating an order on behalf of a buyer user.

  - `Items.Order.BillingAddressID` (string)

  - `Items.Order.BillingAddress` (object)
    Example: {"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}}

  - `Items.Order.BillingAddress.ID` (string)

  - `Items.Order.BillingAddress.DateCreated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.BillingAddress.CompanyName` (string)

  - `Items.Order.BillingAddress.FirstName` (string)

  - `Items.Order.BillingAddress.LastName` (string)

  - `Items.Order.BillingAddress.Street1` (string)

  - `Items.Order.BillingAddress.Street2` (string)

  - `Items.Order.BillingAddress.City` (string)

  - `Items.Order.BillingAddress.State` (string)

  - `Items.Order.BillingAddress.Zip` (string)

  - `Items.Order.BillingAddress.Country` (string)

  - `Items.Order.BillingAddress.Phone` (string)

  - `Items.Order.BillingAddress.AddressName` (string)

  - `Items.Order.BillingAddress.xp` (object)
    Example: {}

  - `Items.Order.ShippingAddressID` (string)
    ID of the ShippingAddress for all line items on the order. Null when there are multiple shipping addresses defined.

  - `Items.Order.Comments` (string)

  - `Items.Order.LineItemCount` (integer)

  - `Items.Order.Status` (string)
    Enum: "Unsubmitted", "AwaitingApproval", "Declined", "Open", "Completed", "Canceled"

  - `Items.Order.DateCreated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.DateSubmitted` (string)
    Null until the order passes from the buyer to the marketplace owner, including when Status is PendingApproval.
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.DateApproved` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.DateDeclined` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.DateCanceled` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.DateCompleted` (string)
    Populated when all items on an order have shipped, or the order is explicitly completed.
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.LastUpdated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.Order.Subtotal` (number)
    Sum of all LineItem.LineSubtotals.

  - `Items.Order.ShippingCost` (number)
    Modifying requires OverrideShipping role.

  - `Items.Order.TaxCost` (number)
    Modifying requires TaxOverride role.

  - `Items.Order.Gratuity` (number)

  - `Items.Order.Fees` (number)
    Fees associated with order or line items

  - `Items.Order.BaseDiscount` (number)
    Sum of all discount amounts from discount assignments applied to line items on this order.

  - `Items.Order.PromotionDiscount` (number)
    Sum of all promotion amounts applied to the order.

  - `Items.Order.Currency` (string)
    Inherited from the user placing the order.

  - `Items.Order.Total` (number)
    Subtotal - BaseDiscount - PromotionDiscount + TaxCost + ShippingCost + Gratuity + Fees

  - `Items.Order.IsSubmitted` (boolean)
    True if this order has been passed from the Buyer to the marketplace owner or supplier.

  - `Items.Order.SubscriptionID` (string)
    ID of the subscription used to create an order in an automated process.

  - `Items.Order.xp` (object)
    Example: {}

  - `Items.ID` (string)

  - `Items.ProductID` (string)

  - `Items.Quantity` (integer)

  - `Items.BundleItemID` (string)
    The ID of the line item that represents the bundle. Signifies that the product is being purchased as part of a bundle.

  - `Items.IsBundle` (boolean)
    When true, this item represents a bundle being purchased.

  - `Items.DateAdded` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.QuantityShipped` (integer)
    Sum of QuantityShipped from all shipment items.

  - `Items.UnitPrice` (number)
    Auto calculated price per quantity. Modification requires OverrideUnitPrice role.

  - `Items.PromotionDiscount` (number)
    Sum of all line item level promotion discount amounts applied.

  - `Items.BaseDiscount` (number)
    Discount amount from discount assignments applied to this line item.

  - `Items.DiscountID` (string)
    ID of the discount applied to this line item.

  - `Items.LineTotal` (number)
    LineSubtotal - BaseDiscount - PromotionDiscount

  - `Items.LineSubtotal` (number)
    UnitPrice x Quantity

  - `Items.CostCenter` (string)
    For reference only, does not influence any OrderCloud behavior.

  - `Items.DateNeeded` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.ShippingAccount` (string)
    For reference only, does not influence any OrderCloud behavior.

  - `Items.ShippingAddressID` (string)

  - `Items.ShipFromAddressID` (string)
    Marketplace owner or supplier AddressID where the product will be shipped from. Can be used to calculate shipping costs.

  - `Items.Product` (object)
    Example: {"ID":"","Name":"","Description":"","Returnable":false,"QuantityMultiplier":0,"ShipWeight":0,"ShipHeight":0,"ShipWidth":0,"ShipLength":0,"DefaultSupplierID":"","ParentID":"","xp":{}}

  - `Items.Product.ID` (string)

  - `Items.Product.Name` (string)

  - `Items.Product.Description` (string)

  - `Items.Product.Returnable` (boolean)

  - `Items.Product.QuantityMultiplier` (integer)

  - `Items.Product.ShipWeight` (number)

  - `Items.Product.ShipHeight` (number)

  - `Items.Product.ShipWidth` (number)

  - `Items.Product.ShipLength` (number)

  - `Items.Product.DefaultSupplierID` (string)

  - `Items.Product.ParentID` (string)

  - `Items.Product.xp` (object)
    Example: {}

  - `Items.Variant` (object)
    Example: {"ID":"","Name":"","Description":"","ShipWeight":0,"ShipHeight":0,"ShipWidth":0,"ShipLength":0,"xp":{}}

  - `Items.Variant.ID` (string)

  - `Items.Variant.Name` (string)

  - `Items.Variant.Description` (string)

  - `Items.Variant.ShipWeight` (number)

  - `Items.Variant.ShipHeight` (number)

  - `Items.Variant.ShipWidth` (number)

  - `Items.Variant.ShipLength` (number)

  - `Items.Variant.xp` (object)
    Example: {}

  - `Items.ShippingAddress` (object)
    Example: {"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}}

  - `Items.ShippingAddress.ID` (string)

  - `Items.ShippingAddress.DateCreated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.ShippingAddress.CompanyName` (string)

  - `Items.ShippingAddress.FirstName` (string)

  - `Items.ShippingAddress.LastName` (string)

  - `Items.ShippingAddress.Street1` (string)

  - `Items.ShippingAddress.Street2` (string)

  - `Items.ShippingAddress.City` (string)

  - `Items.ShippingAddress.State` (string)

  - `Items.ShippingAddress.Zip` (string)

  - `Items.ShippingAddress.Country` (string)

  - `Items.ShippingAddress.Phone` (string)

  - `Items.ShippingAddress.AddressName` (string)

  - `Items.ShippingAddress.xp` (object)
    Example: {}

  - `Items.ShipFromAddress` (object)
    Example: {"ID":"","DateCreated":"2018-01-01T00:00:00-06:00","CompanyName":"","FirstName":"","LastName":"","Street1":"","Street2":"","City":"","State":"","Zip":"","Country":"","Phone":"","AddressName":"","xp":{}}

  - `Items.ShipFromAddress.ID` (string)

  - `Items.ShipFromAddress.DateCreated` (string)
    Example: "2018-01-01T00:00:00-06:00"

  - `Items.ShipFromAddress.CompanyName` (string)

  - `Items.ShipFromAddress.FirstName` (string)

  - `Items.ShipFromAddress.LastName` (string)

  - `Items.ShipFromAddress.Street1` (string)

  - `Items.ShipFromAddress.Street2` (string)

  - `Items.ShipFromAddress.City` (string)

  - `Items.ShipFromAddress.State` (string)

  - `Items.ShipFromAddress.Zip` (string)

  - `Items.ShipFromAddress.Country` (string)

  - `Items.ShipFromAddress.Phone` (string)

  - `Items.ShipFromAddress.AddressName` (string)

  - `Items.ShipFromAddress.xp` (object)
    Example: {}

  - `Items.SupplierID` (string)

  - `Items.InventoryRecordID` (string)
    InventoryRecordID of which product inventory location to use. Cannot be modified once an order is submitted.

  - `Items.PriceScheduleID` (string)
    PriceScheduleID used to determine unit price.

  - `Items.IsOnSale` (boolean)
    True when the price schedule and price break has an active SalePrice.

  - `Items.PriceOverridden` (boolean)
    If true, UnitPrice was overridden.

  - `Items.Specs` (array)
    Example: [{"SpecID":"","Name":"","OptionID":"","Value":"","PriceMarkupType":"NoMarkup","PriceMarkup":0}]

  - `Items.Specs.SpecID` (string)

  - `Items.Specs.Name` (string)

  - `Items.Specs.OptionID` (string)

  - `Items.Specs.Value` (string)

  - `Items.Specs.PriceMarkupType` (string)
    Enum: "NoMarkup", "AmountPerQuantity", "AmountTotal", "Percentage"

  - `Items.Specs.PriceMarkup` (number)

  - `Items.IncomingOrderID` (string)
    ID of the original order. Only returns a value for the marketplace owner.

  - `Items.OutgoingOrderID` (string)
    ID of the split or forwarded order. Only returns a value for the marketplace owner.

  - `Items.InvitationID` (string)

  - `Items.xp` (object)
    Example: {}

  - `Meta` (object)

  - `Meta.Page` (integer)

  - `Meta.PageSize` (integer)

  - `Meta.TotalCount` (integer)

  - `Meta.TotalPages` (integer)

  - `Meta.ItemRange` (array)

  - `Meta.NextPageKey` (string)

## Response 4XX fields (application/json):

  - `StatusCode` (integer)
    Example: "404"

  - `ErrorCode` (string)
    Example: "NotFoundError"

  - `Message` (string)
    Example: "Object not found"

  - `Data` (object)
    Example: {"ObjectType":"","ObjectID":""}


