# List orders

Endpoint: GET /orders/{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.ID` (string)

  - `Items.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.FromUser.ID` (string)

  - `Items.FromUser.CompanyID` (string)

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

  - `Items.FromUser.Password` (string)

  - `Items.FromUser.FirstName` (string)

  - `Items.FromUser.LastName` (string)

  - `Items.FromUser.Email` (string)

  - `Items.FromUser.Phone` (string)

  - `Items.FromUser.TermsAccepted` (string)

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

  - `Items.FromUser.xp` (object)

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

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

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

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

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

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

  - `Items.FromUser.DateCreated` (string)

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

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

  - `Items.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.ToCompanyID` (string)
    ID of the marketplace owner or supplier receiving the order, only writable on create. Mainly useful to the user placing it.

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

  - `Items.BillingAddressID` (string)

  - `Items.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.BillingAddress.ID` (string)

  - `Items.BillingAddress.DateCreated` (string)

  - `Items.BillingAddress.CompanyName` (string)

  - `Items.BillingAddress.FirstName` (string)

  - `Items.BillingAddress.LastName` (string)

  - `Items.BillingAddress.Street1` (string)

  - `Items.BillingAddress.Street2` (string)

  - `Items.BillingAddress.City` (string)

  - `Items.BillingAddress.State` (string)

  - `Items.BillingAddress.Zip` (string)

  - `Items.BillingAddress.Country` (string)

  - `Items.BillingAddress.Phone` (string)

  - `Items.BillingAddress.AddressName` (string)

  - `Items.BillingAddress.xp` (object)

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

  - `Items.Comments` (string)

  - `Items.LineItemCount` (integer)

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

  - `Items.DateCreated` (string)

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

  - `Items.DateApproved` (string)

  - `Items.DateDeclined` (string)

  - `Items.DateCanceled` (string)

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

  - `Items.LastUpdated` (string)

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

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

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

  - `Items.Gratuity` (number)

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

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

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

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

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

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

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

  - `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":""}

