> ## Documentation Index
> Fetch the complete documentation index at: https://docs.winedirectfulfillment.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Updates an existing order.

> Use the GET /Orders/Details to get the current values of the order to use in this update call.  This will update the Line Items, details and ShipTo address of the order. Address is optional, all other values are required.



## OpenAPI

````yaml /openapi.json patch /api/v1/Orders/{orderNumber}
openapi: 3.0.4
info:
  title: WineDirect Fulfillment API Gateway UAT
  description: >-
    <i>Provides access to the Fulfillment system.</i><h2><a target="_blank"
    href='https://portal.wd-fs.com/administration/api-help'>Detailed
    Documentation</a></h2><h3>From your code:</h3><p> To use any of the
    endpoints, get the <b>Bearer Token</b> from the <b>AccessToken</b> endpoint,
    then pass that as a <b>HttpHeader</b> called <b>Authorization</b> like this
    on all calls.<br><pre>(C#)   request.AddParameter("Authorization", token, 
    ParameterType.HttpHeader);</pre><h3>From a browser:</h3><p>Press the
    <b>Authorize</b> button and enter the <b>Bearer Token</b> from the
    <b>AccessToken</b> endpoint.</p>
  version: '1.0'
servers: []
security:
  - Bearer: []
paths:
  /api/v1/Orders/{orderNumber}:
    patch:
      tags:
        - Orders
      summary: Updates an existing order.
      description: >-
        Use the GET /Orders/Details to get the current values of the order to
        use in this update call.  This will update the Line Items, details and
        ShipTo address of the order. Address is optional, all other values are
        required.
      parameters:
        - name: orderNumber
          in: path
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderEditRequest'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StringIEnumerableServiceResult'
components:
  schemas:
    OrderEditRequest:
      required:
        - isOnSitePurchase
        - isResidentialAddress
        - lineItems
        - orderNumber
        - requestedServiceLevel
        - shipToAddress
      type: object
      properties:
        orderNumber:
          minLength: 1
          type: string
          description: The customer order number
        isOnSitePurchase:
          type: boolean
          description: Is this an On Site purchase
          default: false
        shipFromWarehouseCode:
          type: string
          description: "The From warehouse (Code)  \r\n            \r\n    \"GLW\" - Glenwillow,\r\n    \"WDI\" - Green Island,\r\n    \"PSO\" - Paso Robles,\r\n    \"SMA\" - Santa Maria,\r\n    \"SHW\" - Willamette Valley\r\n    \"DAL\" - Dallas"
          nullable: true
        requestedShipDate:
          type: string
          description: "Future ship date.  Enter the date you want the order to be processed.  We will hold the orders until that date.\r\n            \r\n      eg 2023-12-15"
          format: date-time
          nullable: true
        requestedServiceLevel:
          minLength: 1
          type: string
          description: "The carrier service to use. Examples include:\r\n            \r\n    FEDGROUND\r\n    UPS2DAY\r\n    UPSOVERNIGHT\r\n    UP1\r\n    UP2\r\n    UPO\r\n    UPSGROUND\r\n    WILLCALL"
        notificationEmail:
          maxLength: 240
          type: string
          description: Email
          nullable: true
        notificationPhoneNumber:
          maxLength: 40
          type: string
          description: Phone number
          nullable: true
        notificationTemplateCode:
          type: string
          description: The notification to use
          nullable: true
        orderTypeCode:
          type: string
          description: "The Type of Order (code)\r\n            \r\n    \"CLUB\" - Club Order\r\n    \"STND\" - Daily Order\r\n    \"SPCL\" - Special Order\r\n    \"VC\"   - Visitor Center\r\n    \"DAILY\" - Daily Order\r\n    \"SPECIAL\" - Special Order\r\n    \"CORP\" - Corp Order"
          nullable: true
        giftMessage:
          maxLength: 2000
          type: string
          description: Gift Message
          nullable: true
        shippingInstructions:
          maxLength: 1000
          type: string
          description: Shipping Instructions
          nullable: true
        packingSlipCode:
          maxLength: 80
          type: string
          description: The packing slip code
          nullable: true
        isResidentialAddress:
          type: boolean
          description: Is the address a residential address
          default: true
        shipToAddress:
          $ref: '#/components/schemas/AddressApi'
        vasOrderPersonalizations:
          type: array
          items:
            $ref: '#/components/schemas/VasOrderPersonalization'
          description: Value added service personalizations
          nullable: true
        lineItems:
          type: array
          items:
            $ref: '#/components/schemas/LineItemApi'
          description: The order line items
      additionalProperties: false
    StringIEnumerableServiceResult:
      type: object
      properties:
        isSuccess:
          type: boolean
          description: >-
            Was the request successful. If not, the message will have more
            information.
        message:
          type: string
          description: Any error message
          nullable: true
        payload:
          type: array
          items:
            type: string
          description: The payload object of the response
          nullable: true
      additionalProperties: false
      description: Generic container for all service responses
    AddressApi:
      type: object
      properties:
        firstName:
          maxLength: 80
          type: string
          nullable: true
        middleName:
          maxLength: 80
          type: string
          nullable: true
        lastName:
          maxLength: 80
          type: string
          nullable: true
        companyName:
          maxLength: 80
          type: string
          nullable: true
        address1:
          maxLength: 80
          type: string
          nullable: true
        address2:
          maxLength: 80
          type: string
          nullable: true
        address3:
          maxLength: 80
          type: string
          nullable: true
        city:
          maxLength: 80
          type: string
          nullable: true
        stateOrProvince:
          maxLength: 2
          type: string
          nullable: true
        postalCode:
          maxLength: 10
          type: string
          nullable: true
        countryCode:
          maxLength: 2
          type: string
          default: US
          nullable: true
      additionalProperties: false
      description: A standard Address object
    VasOrderPersonalization:
      required:
        - type
      type: object
      properties:
        lineNumber:
          type: integer
          description: >-
            The line number of the SKU this personalization is assigned to. Not
            required for order header
          format: int32
          nullable: true
        type:
          maxLength: 80
          minLength: 1
          type: string
        message:
          maxLength: 2000
          type: string
          description: Messaging about the set of value added services
          nullable: true
        options:
          type: array
          items:
            $ref: '#/components/schemas/VasOrderPersonalizationOption'
          description: A collection of specific value added services
          nullable: true
      additionalProperties: false
      description: A set of value added services
    LineItemApi:
      required:
        - lineNumber
        - quantity
        - sku
        - unitPrice
      type: object
      properties:
        lineNumber:
          type: integer
          description: "EDITING: The number of the line. 1,2,3,4,5 etc\r\nADDING NEW: Leave Blank"
          format: int32
        componentNumber:
          type: integer
          description: Leave this blank
          format: int32
          nullable: true
        sku:
          minLength: 1
          type: string
          description: The customer Sku
        quantity:
          type: integer
          description: How many
          format: int32
        unitPrice:
          type: number
          description: Price per unit
          format: double
        vasOrderPersonalizations:
          type: array
          items:
            $ref: '#/components/schemas/VasOrderPersonalization'
          description: Value added service personalizations
          nullable: true
      additionalProperties: false
    VasOrderPersonalizationOption:
      required:
        - type
      type: object
      properties:
        type:
          maxLength: 80
          minLength: 1
          type: string
          description: The type of the value added service. Eg a ribbon
        option:
          maxLength: 80
          type: string
          description: An option applied to the type. eg the color of the type's ribbon.
          nullable: true
        message:
          maxLength: 2000
          type: string
          description: Messaging about the value added service
          nullable: true
      additionalProperties: false
  securitySchemes:
    Bearer:
      type: apiKey
      description: 'Enter the Bearer AccessToken;  Example: ''Bearer 12345abcdef'''
      name: Authorization
      in: header

````