# Submit an order

Endpoint: POST /orders/{direction}/{orderID}/submit
Version: 1.0.445.36017
Security: OAuth2

## Path parameters:

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

  - `orderID` (string, required)
    ID of the order.

## Response 201 fields (application/json):

  - `ID` (string)

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

  - `FromUser.ID` (string)

  - `FromUser.CompanyID` (string)

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

  - `FromUser.Password` (string)

  - `FromUser.FirstName` (string)

  - `FromUser.LastName` (string)

  - `FromUser.Email` (string)

  - `FromUser.Phone` (string)

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

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

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

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

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

  - `FromUser.Locale.ID` (string)

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

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

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

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

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

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

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

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

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

  - `BillingAddressID` (string)

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

  - `BillingAddress.ID` (string)

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

  - `BillingAddress.CompanyName` (string)

  - `BillingAddress.FirstName` (string)

  - `BillingAddress.LastName` (string)

  - `BillingAddress.Street1` (string)

  - `BillingAddress.Street2` (string)

  - `BillingAddress.City` (string)

  - `BillingAddress.State` (string)

  - `BillingAddress.Zip` (string)

  - `BillingAddress.Country` (string)

  - `BillingAddress.Phone` (string)

  - `BillingAddress.AddressName` (string)

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

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

  - `Comments` (string)

  - `LineItemCount` (integer)

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

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

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

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

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

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

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

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

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

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

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

  - `Gratuity` (number)

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

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

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

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

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

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

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

  - `xp` (object)
    Example: {}

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

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

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

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

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


