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

# Update order



## OpenAPI

````yaml put /v1/orders/{sourceOrderId}
openapi: 3.0.0
info:
  title: Orders Service
  description: Orders service API
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.production.orderprotection.com
    description: Production server
security: []
tags:
  - name: orders
    description: ''
paths:
  /v1/orders/{sourceOrderId}:
    put:
      tags:
        - Orders
      summary: Update order
      operationId: OrdersApiController_updateOrder
      parameters:
        - name: sourceOrderId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OrderUpdateDto'
      responses:
        '200':
          description: The order has been successfully updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OkStatusResponse'
        '400':
          description: Bad Request.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestExceptionResponse'
        '401':
          description: Unauthorized.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UnauthorizedExceptionResponse'
        '404':
          description: Order not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/NotFoundExceptionResponse'
      security:
        - bearer: []
components:
  schemas:
    OrderUpdateDto:
      type: object
      required:
        - currency
        - sourceOrderNumber
      properties:
        policyCancelledAt:
          format: date-time
          type: string
          nullable: true
          example: '2024-03-20T12:00:00.000Z'
          description: Date when the policy was cancelled
        originalSourceOrderId:
          type: string
          example: '12345'
          description: >-
            If this was a replacement for another Order, you can include the
            original order id here
        sourceOrderNumber:
          type: string
          example: '#634C'
          description: Order Number on your platform
        sourceCreatedAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Creation date of the order on your platform
        sourceUpdatedAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Updated date of the order on your platform
        sourceCancelledAt:
          format: date-time
          type: string
          example: '2000-05-15T21:00:00.000Z'
          description: Cancellation date of the order on your platform
        platformId:
          type: string
          example: api
          enum:
            - shopify
            - woocommerce
            - magento
            - bigcommerce
            - api
          description: Platform identifier
        premiumPaid:
          type: number
          example: 1.5
          description: Premium paid
        currency:
          type: string
          example: USD
          enum:
            - ADP
            - AED
            - AFA
            - AFN
            - ALK
            - ALL
            - AMD
            - ANG
            - AOA
            - AOK
            - AON
            - AOR
            - ARA
            - ARP
            - ARS
            - ARY
            - ATS
            - AUD
            - AWG
            - AYM
            - AZM
            - AZN
            - BAD
            - BAM
            - BBD
            - BDT
            - BEC
            - BEF
            - BEL
            - BGJ
            - BGK
            - BGL
            - BGN
            - BHD
            - BIF
            - BMD
            - BND
            - BOB
            - BOP
            - BOV
            - BRB
            - BRC
            - BRE
            - BRL
            - BRN
            - BRR
            - BSD
            - BTN
            - BUK
            - BWP
            - BYB
            - BYN
            - BYR
            - BZD
            - CAD
            - CDF
            - CHC
            - CHE
            - CHF
            - CHW
            - CLF
            - CLP
            - CNY
            - COP
            - COU
            - CRC
            - CSD
            - CSJ
            - CSK
            - CUC
            - CUP
            - CVE
            - CYP
            - CZK
            - DDM
            - DEM
            - DJF
            - DKK
            - DOP
            - DZD
            - ECS
            - ECV
            - EEK
            - EGP
            - ERN
            - ESA
            - ESB
            - ESP
            - ETB
            - EUR
            - FIM
            - FJD
            - FKP
            - FRF
            - GBP
            - GEK
            - GEL
            - GHC
            - GHP
            - GHS
            - GIP
            - GMD
            - GNE
            - GNF
            - GNS
            - GQE
            - GRD
            - GTQ
            - GWE
            - GWP
            - GYD
            - HKD
            - HNL
            - HRD
            - HRK
            - HTG
            - HUF
            - IDR
            - IEP
            - ILP
            - ILR
            - ILS
            - INR
            - IQD
            - IRR
            - ISJ
            - ISK
            - ITL
            - JMD
            - JOD
            - JPY
            - KES
            - KGS
            - KHR
            - KMF
            - KPW
            - KRW
            - KWD
            - KYD
            - KZT
            - LAJ
            - LAK
            - LBP
            - LKR
            - LRD
            - LSL
            - LSM
            - LTL
            - LTT
            - LUC
            - LUF
            - LUL
            - LVL
            - LVR
            - LYD
            - MAD
            - MDL
            - MGA
            - MGF
            - MKD
            - MLF
            - MMK
            - MNT
            - MOP
            - MRO
            - MRU
            - MTL
            - MTP
            - MUR
            - MVQ
            - MVR
            - MWK
            - MXN
            - MXP
            - MXV
            - MYR
            - MZE
            - MZM
            - MZN
            - NAD
            - NGN
            - NIC
            - NIO
            - NLG
            - NOK
            - NPR
            - NZD
            - OMR
            - PAB
            - PEH
            - PEI
            - PEN
            - PES
            - PGK
            - PHP
            - PKR
            - PLN
            - PLZ
            - PTE
            - PYG
            - QAR
            - RHD
            - ROK
            - ROL
            - RON
            - RSD
            - RUB
            - RUR
            - RWF
            - SAR
            - SBD
            - SCR
            - SDD
            - SDG
            - SDP
            - SEK
            - SGD
            - SHP
            - SIT
            - SKK
            - SLL
            - SOS
            - SRD
            - SRG
            - SSP
            - STD
            - STN
            - SUR
            - SVC
            - SYP
            - SZL
            - THB
            - TJR
            - TJS
            - TMM
            - TMT
            - TND
            - TOP
            - TPE
            - TRL
            - TRY
            - TTD
            - TWD
            - TZS
            - UAH
            - UAK
            - UGS
            - UGW
            - UGX
            - USD
            - USN
            - USS
            - UYI
            - UYN
            - UYP
            - UYU
            - UYW
            - UZS
            - VEB
            - VEF
            - VES
            - VNC
            - VND
            - VUV
            - WST
            - XAF
            - XAG
            - XAU
            - XBA
            - XBB
            - XBC
            - XBD
            - XCD
            - XDR
            - XEU
            - XFO
            - XFU
            - XOF
            - XPD
            - XPF
            - XPT
            - XRE
            - XSU
            - XTS
            - XUA
            - XXX
            - YDD
            - YER
            - YUD
            - YUM
            - YUN
            - ZAL
            - ZAR
            - ZMK
            - ZMW
            - ZRN
            - ZRZ
            - ZWC
            - ZWD
            - ZWL
            - ZWN
            - ZWR
          description: Order currency
        total:
          type: number
          example: 15.4
          description: Order total
        discountTotal:
          type: number
          example: 1.2
          description: Order discount
        shippingCost:
          type: number
          example: 3.5
          description: Order shipping cost
        tax:
          type: number
          example: 0.55
          description: Order tax
        subtotal:
          type: number
          example: 11.3
          description: Order subtotal
        customerEmail:
          type: string
          example: john@doe.com
          description: Customer email
        customerName:
          type: string
          example: John
          description: Customer name
        customerPhone:
          type: string
          example: +1-555-796-3644
          description: Customer phone number
        shippingCostTax:
          type: number
          example: 234
          description: Tax associated with shipping
    OkStatusResponse:
      type: object
      properties:
        status:
          type: string
          readOnly: true
          deprecated: false
          example: ok
      required:
        - status
    BadRequestExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: '''sourceOrderId'' is required'
        statusCode:
          type: number
          readOnly: true
          example: 400
      required:
        - message
        - statusCode
    UnauthorizedExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: Unauthorized
        statusCode:
          type: number
          readOnly: true
          example: 401
      required:
        - message
        - statusCode
    NotFoundExceptionResponse:
      type: object
      properties:
        message:
          type: string
          readOnly: true
          example: Not Found
        error:
          type: string
          readOnly: true
          example: Not Found
        statusCode:
          type: number
          readOnly: true
          example: 404
      required:
        - message
        - error
        - statusCode
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http

````