# List line item across orders

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

## Security:

  - `OAuth2` (unknown)
    oauth2 scopes: FullAccess, OrderAdmin, OrderReader

## Path parameters:

  - `direction` (string, required)
    Direction of the order, from the current user's perspective.

## 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.

  - `searchType` (string)
    Type of search to perform.

  - `sortBy` (array)
    Comma-delimited list of fields to sort by.

  - `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)

  - `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":{},"Available…

  - `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"…

  - `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)

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

  - `Items.Order.FromUser.xp` (object)

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

  - `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)

  - `Items.Order.FromUser.LastActive` (string)
    Accurate within a few minutes. Includes impersonation activity.

  - `Items.Order.FromUser.PasswordLastSetDate` (string)
    Can be used in conjunction with SecurityProfile.PasswordConfig to enforce password reset schedules.

  - `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)

  - `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)

  - `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)

  - `Items.Order.DateSubmitted` (string)
    Null until the order passes from the buyer to the marketplace owner, including when Status is PendingApproval.

  - `Items.Order.DateApproved` (string)

  - `Items.Order.DateDeclined` (string)

  - `Items.Order.DateCanceled` (string)

  - `Items.Order.DateCompleted` (string)
    Populated when all items on an order have shipped, or the order is explicitly completed.

  - `Items.Order.LastUpdated` (string)

  - `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)

  - `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)

  - `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)

  - `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)

  - `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)

  - `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.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.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)

  - `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)

  - `Meta` (object)

  - `Meta.Page` (integer)

  - `Meta.PageSize` (integer)

  - `Meta.TotalCount` (integer)

  - `Meta.TotalPages` (integer)

  - `Meta.ItemRange` (array)

  - `Meta.NextPageKey` (string)

## Response 4XX:

  - `4XX` (unknown)
    Expected errors range from 400-409. Anything in the 5XX range indicates a server issue and should be reported to support.

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

  - `StatusCode` (integer)
    Example: 404

  - `ErrorCode` (string)
    Example: NotFoundError

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

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

