# Set a shipping address

Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the order's ShippingAddressID property instead. The address used will be populated on the ShippingAddress property of each LineItem.

Endpoint: PUT /cart/shipto
Version: 1.0.457.36910
Security: OAuth2

## Security:

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

## Request fields (application/json):

  - `ID` (string)

  - `CompanyName` (string)

  - `FirstName` (string)

  - `LastName` (string)

  - `Street1` (string)

  - `Street2` (string)

  - `City` (string)

  - `State` (string)

  - `Zip` (string)

  - `Country` (string)

  - `Phone` (string)

  - `AddressName` (string)

  - `xp` (object)

## Response 200:

  - `200` (unknown)
    Use only when the address is not to be saved/reused. To use a saved address (i.e. from the Addresses resource), PATCH the order's ShippingAddressID property instead. The address used will be populated on the ShippingAddress property of each LineItem.

## Response 200 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.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)

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

  - `FromUser.xp` (object)

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

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

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

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

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

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

  - `LineItemCount` (integer)

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

  - `DateCreated` (string)

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

  - `DateApproved` (string)

  - `DateDeclined` (string)

  - `DateCanceled` (string)

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

  - `LastUpdated` (string)

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

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

