# Repeat an order

Creates a new unsubmitted order from a previously submitted order, copying available line items with recalculated prices.

Endpoint: POST /orders/{direction}/{orderID}/repeat
Version: 1.0.457.36910
Security: OAuth2

## Security:

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

## Path parameters:

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

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

## Request 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"…

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

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

  - `FromUser.xp` (object)

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

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

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

  - `Comments` (string)

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

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

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

  - `Gratuity` (number)

  - `xp` (object)

## Response 200:

  - `200` (unknown)
    Creates a new unsubmitted order from a previously submitted order, copying available line items with recalculated prices.

## Response 200 fields (application/json):

  - `Order` (object)
    The new unsubmitted order created from the original.
    Example: {"ID":"","FromUser":{"ID":"","CompanyID":"","Username":"","Password":"","FirstName":"","LastName":"","Email":"","Phone":"","TermsAccepted":"2018-01-01T00:00:00-06:00","Active":false,"xp":{},"Available…

  - `Order.ID` (string)

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

  - `Order.FromUser.ID` (string)

  - `Order.FromUser.CompanyID` (string)

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

  - `Order.FromUser.Password` (string)

  - `Order.FromUser.FirstName` (string)

  - `Order.FromUser.LastName` (string)

  - `Order.FromUser.Email` (string)

  - `Order.FromUser.Phone` (string)

  - `Order.FromUser.TermsAccepted` (string)

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

  - `Order.FromUser.xp` (object)

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

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

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

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

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

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

  - `Order.FromUser.DateCreated` (string)

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

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

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

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

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

  - `Order.BillingAddressID` (string)

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

  - `Order.BillingAddress.ID` (string)

  - `Order.BillingAddress.DateCreated` (string)

  - `Order.BillingAddress.CompanyName` (string)

  - `Order.BillingAddress.FirstName` (string)

  - `Order.BillingAddress.LastName` (string)

  - `Order.BillingAddress.Street1` (string)

  - `Order.BillingAddress.Street2` (string)

  - `Order.BillingAddress.City` (string)

  - `Order.BillingAddress.State` (string)

  - `Order.BillingAddress.Zip` (string)

  - `Order.BillingAddress.Country` (string)

  - `Order.BillingAddress.Phone` (string)

  - `Order.BillingAddress.AddressName` (string)

  - `Order.BillingAddress.xp` (object)

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

  - `Order.Comments` (string)

  - `Order.LineItemCount` (integer)

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

  - `Order.DateCreated` (string)

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

  - `Order.DateApproved` (string)

  - `Order.DateDeclined` (string)

  - `Order.DateCanceled` (string)

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

  - `Order.LastUpdated` (string)

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

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

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

  - `Order.Gratuity` (number)

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

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

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

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

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

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

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

  - `Order.xp` (object)

  - `UnavailableItems` (array)
    Products from the original order that could not be added to the new order.

  - `UnavailableItems.ProductID` (string)
    ID of the product or bundle that could not be added to the new order.

  - `UnavailableItems.Error` (object)
    The error indicating why the item could not be added.
    Example: {"ErrorCode":"","Message":"","Data":{}}

  - `UnavailableItems.Error.ErrorCode` (string)

  - `UnavailableItems.Error.Message` (string)

  - `UnavailableItems.Error.Data` (object)

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

