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

# Return order

> Return order



## OpenAPI

````yaml oms_v1 patch /api-order/orders/return
openapi: 3.0.0
info:
  description: Order Management System
  version: 1.0.0
  title: Orders v1 (OMS v1)
  contact:
    email: oms-team@fabric.inc
  license:
    name: fabric API license
    url: https://fabric.inc/api-license
servers:
  - url: https://prod01-apigw.{customer_name}.fabric.zone
    description: Production
    variables:
      customer_name:
        default: yourcompany
        description: Customer name, provided by support team
security: []
tags:
  - name: Cart
    description: >-
      Cart APIs<br /><br />**Note:** These are the legacy Cart APIs. To view
      fabric's new Cart APIs, navigate to *Cart API > Cart* from the left side
      navigation pane.
  - name: Bill To
    description: Bill To APIs [Deprecated]
  - name: Ship To
    description: >-
      Ship To APIs<br /><br />**Note:** These are the legacy Ship To APIs. To
      view fabric's new Shipping APIs, navigate to *Cart API > Shipping* from
      the left side navigation pane.
  - name: Wishlist
    description: Wishlist APIs
  - name: Cart Decoupled
    description: Cart Decoupled APIs
  - name: Warehouse
    description: Warehouse APIs
  - name: Inventory
    description: Inventory APIs
  - name: Attributes
    description: >-
      Attributes APIs<br /><br />**Note:** These are the legacy Attribute APIs.
      To view fabric's new Attribute APIs, navigate to *Cart API > Attribute*
      from the left side navigation pane.
  - name: List
    description: List APIs
  - name: Tax/Address Validate
    description: Tax/Address Validate APIs
  - name: Shipping
    description: Shipping APIs
  - name: Payments
    description: Payments APIs
  - name: Order
    description: Order APIs
paths:
  /api-order/orders/return:
    patch:
      tags:
        - Order
      summary: Return order
      description: Return order
      operationId: returnOrder
      parameters:
        - in: header
          name: x-api-key
          schema:
            type: string
            example: 0LybWR49k95cCwYh3cu0waCYoh4H2Eux2J52wn4k
        - $ref: '#/components/parameters/xSiteContent'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - orderId
                - returnCode
              properties:
                returnCode:
                  type: string
                  example: '2001'
                orderId:
                  type: string
                  minLength: 15
                  maxLength: 15
                  example: 2947-5955-82579
                returnMessage:
                  type: string
                  example: Customer not interested
                sugarRefund:
                  type: boolean
                  example: true
      responses:
        '200':
          description: Returned Order
          content:
            application/json:
              schema:
                allOf:
                  - type: object
                    properties:
                      orderId:
                        type: string
                        example: 1626-4972-66351
                      status:
                        type: string
                        example: Successfully Returned order
                  - type: object
                    properties:
                      order:
                        allOf:
                          - type: object
                            properties:
                              tags:
                                type: array
                              channel:
                                type: integer
                                example: 12
                              orderTotal:
                                type: number
                                example: 124.33
                              taxTotal:
                                type: number
                                example: 5.23
                              orderCurrency:
                                type: string
                                example: USD
                              status:
                                type: string
                                example: ORDER_RETURNED
                              statusLog:
                                type: string
                                example: Order has been Returned
                              customerUserId:
                                type: string
                                example: 5e3598e3007c5e00080d2bb8
                              customerAccountId:
                                type: string
                                example: 5e3598e3007c5e00080d2bb8
                              customerPhone:
                                type: object
                                properties:
                                  number:
                                    type: string
                                    example: 555-555-5555
                                  kind:
                                    type: string
                                    example: mobile
                              orderId:
                                type: string
                                example: 1626-4972-66351
                              revision:
                                type: integer
                                example: 2
                              totalQuantity:
                                type: number
                                example: 10
                              statusDescriptions:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                      example: 614b0e0c6c4e26000906b513
                                    status:
                                      type: string
                                      example: ORDER_RETURNED
                                    code:
                                      type: string
                                      example: '2001'
                                    description:
                                      type: string
                                      example: >-
                                        Customer is no longer interested in
                                        product
                                    date:
                                      type: string
                                      example: '2021-09-22T11:05:48.210Z'
                                    id:
                                      type: string
                                      example: 614b0e0c6c4e26000906b513
                              events:
                                type: array
                              attributes:
                                type: array
                              __v:
                                type: number
                                example: 0
                          - type: object
                            properties:
                              _id:
                                type: string
                                example: 5fee9d59f2f08a1b3cbdea08
                              createdAt:
                                type: string
                                example: '2020-12-31T02:09:53.914Z'
                              updatedAt:
                                type: string
                                example: '2020-12-31T02:09:53.914Z'
                          - type: object
                            properties:
                              shipTo:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    address:
                                      type: object
                                      properties:
                                        name:
                                          type: object
                                          properties:
                                            first:
                                              type: string
                                              example: Mark
                                            middle:
                                              type: string
                                              example: p
                                            last:
                                              type: string
                                              example: styler
                                        phone:
                                          type: object
                                          properties:
                                            number:
                                              type: string
                                              example: 555-555-5555
                                            kind:
                                              type: string
                                              example: mobile
                                        isValidated:
                                          type: boolean
                                          example: false
                                        email:
                                          type: string
                                          example: mark@google.com
                                        street1:
                                          type: string
                                          example: 10400 NE 4th St
                                        street2:
                                          type: string
                                          example: Suite 500
                                        city:
                                          type: string
                                          example: Bellevue
                                        state:
                                          type: string
                                          example: WA
                                        country:
                                          type: string
                                          example: USA
                                        zipCode:
                                          type: string
                                          example: '98004'
                                        kind:
                                          type: string
                                          example: Ship to address
                                    delivery:
                                      type: object
                                      properties:
                                        actual:
                                          type: string
                                    shipping:
                                      type: object
                                      properties:
                                        actual:
                                          type: string
                                    promosApplied:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                            example: test1
                                    _id:
                                      type: string
                                      example: 602c1511fcc5e900078ba4af
                                    shipToId:
                                      type: number
                                      example: 1000001
                                    shipToType:
                                      type: string
                                      example: SHIP_TO_ADDRESS
                                    price:
                                      type: number
                                      example: 24.87
                                    currency:
                                      type: string
                                      example: USD
                                    estimatedTax:
                                      type: number
                                      example: 10
                                    committedTax:
                                      type: number
                                      example: 10
                                    total:
                                      type: number
                                      example: 34.87
                                    taxCode:
                                      type: string
                                      example: FR020000
                                    shipmentCarrier:
                                      type: string
                                      example: Fedex
                                    shipmentMethod:
                                      type: string
                                      example: Express
                                    shipmentMethodId:
                                      type: string
                                      example: '10000001'
                                    promisedDeliveryDate:
                                      type: string
                                      example: '2021-02-14T00:00:00.000Z'
                                    shipmentInstructions:
                                      type: string
                                      example: Leave at back door
                                    shipmentStatus:
                                      type: string
                                      example: Delivered
                                    readyForPickups:
                                      type: array
                                    id:
                                      type: string
                                      example: 602c1511fcc5e900078ba4af
                          - type: object
                            properties:
                              items:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    group:
                                      type: array
                                      items:
                                        type: string
                                        example: Group1
                                    promosApplied:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          name:
                                            type: string
                                            example: test
                                    _id:
                                      type: string
                                      example: 602c1511fcc5e900078ba4b0
                                    lineItemId:
                                      type: number
                                      example: 1
                                    itemId:
                                      type: number
                                      example: 1000000663
                                    sku:
                                      type: string
                                      example: '1538910'
                                    title:
                                      type: string
                                      example: Luminous Cushion Lagoon
                                    quantity:
                                      type: number
                                      example: 10
                                    price:
                                      type: number
                                      example: 4.5
                                    discount:
                                      type: number
                                      example: 1
                                    currency:
                                      type: string
                                      example: USD
                                    shipToId:
                                      type: number
                                      example: 1000001
                                    estimatedTax:
                                      type: number
                                      example: 10.25
                                    total:
                                      type: number
                                      example: 4.54
                                    taxCode:
                                      type: string
                                      example: FR020000
                                    weight:
                                      type: number
                                      example: 10
                                    weightUnit:
                                      type: string
                                      example: lb
                                    attributes:
                                      type: array
                                    reservedLocation:
                                      type: array
                                    id:
                                      type: string
                                      example: 602c1511fcc5e900078ba4b0
                          - type: object
                            properties:
                              shipments:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    _id:
                                      type: string
                                      example: 602c1607128f5e00078ad8ed
                                    shippedDate:
                                      type: string
                                      example: '2021-02-16T18:59:11.480Z'
                                    shipToId:
                                      type: number
                                      example: 1000001
                                    shipmentCarrier:
                                      type: string
                                      example: USPS
                                    shipmentCarrierUrl:
                                      type: string
                                      example: >-
                                        https://tools.usps.com/go/TrackConfirmAction?tRef=fullpage&tLc=2&text28777=&tLabels=65765798989
                                    trackingNumber:
                                      type: string
                                      example: '65765798989'
                                    lineItems:
                                      type: array
                                      items:
                                        type: object
                                        properties:
                                          _id:
                                            type: string
                                            example: 602c1607128f5e00078ad8ee
                                          lineItemId:
                                            type: number
                                            example: 1
                                          quantity:
                                            type: number
                                            example: 10
                                          id:
                                            type: string
                                            example: 602c1607128f5e00078ad8ee
                                    shipmentStatus:
                                      type: string
                                      example: ORDER_SHIPPED
                                    id:
                                      type: string
                                      example: 602c1607128f5e00078ad8ed
                          - type: object
                            properties:
                              payments:
                                type: array
                                items:
                                  type: object
                                  properties:
                                    billToAddress:
                                      type: object
                                      properties:
                                        name:
                                          type: object
                                          properties:
                                            first:
                                              type: string
                                              example: Marl
                                            middle:
                                              type: string
                                              example: p
                                            last:
                                              type: string
                                              example: styler
                                        phone:
                                          type: object
                                          properties:
                                            number:
                                              type: string
                                              example: 555-555-5555
                                            kind:
                                              type: string
                                              example: mobile
                                        isValidated:
                                          type: boolean
                                          example: false
                                        email:
                                          type: string
                                          example: mark@google.com
                                        street1:
                                          type: string
                                          example: 10400 NE 4th St
                                        street2:
                                          type: string
                                          example: Suite 500
                                        city:
                                          type: string
                                          example: Bellevue
                                        state:
                                          type: string
                                          example: WA
                                        country:
                                          type: string
                                          example: USA
                                        zipCode:
                                          type: string
                                          example: '98004'
                                        kind:
                                          type: string
                                          example: Ship to address
                                    shipToId:
                                      type: array
                                      items:
                                        type: number
                                        example: 1000001
                                    _id:
                                      type: string
                                      example: 602c1511fcc5e900078ba4b1
                                    billToId:
                                      type: number
                                      example: 1000001
                                    paymentIdentifier:
                                      type: object
                                      properties:
                                        cardIdentifier:
                                          type: number
                                          example: 4242
                                    paymentMethod:
                                      type: string
                                      example: Visa
                                    paymentToken:
                                      type: object
                                      properties:
                                        token:
                                          type: number
                                          example: 123456789
                                    paymentKind:
                                      type: string
                                      example: Default payment
                                    amount:
                                      type: number
                                      example: 533.33
                                    currency:
                                      type: string
                                      example: USD
                                    conversion:
                                      type: number
                                      example: 1
                                    paymentStatus:
                                      type: string
                                      example: Pending
                                    id:
                                      type: string
                                      example: 602c1511fcc5e900078ba4b1
        '400':
          description: Order return invalid status
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    description: The error code
                    type: string
                    example: ORDER_RETURN_INVALID
                  message:
                    description: The error message
                    type: string
                    example: >-
                      Order status must be ORDER_SHIPPED or ORDER_FULFILLED or
                      ORDER_DELIVERD
        '403':
          $ref: '#/components/responses/MissingXApiKeyHeader'
        '404':
          description: Not Found error while canceling order
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    description: The error code
                    type: string
                  message:
                    description: The error message
                    type: string
              examples:
                Order not found:
                  value:
                    code: ORDER_NOT_FOUND
                    message: Order ID Not Found
                Return Code not found:
                  value:
                    code: ORDER_RETURN_CODE_NOT_FOUND
                    message: Return Code Not Found
        '500':
          $ref: '#/components/responses/GenericServerError'
components:
  parameters:
    xSiteContent:
      name: x-site-context
      in: header
      description: >-
        The `x-site-context` header is a JSON object that contains information
        about the source you wish to pull from. The mandatory `account` is the
        24 character identifier found in Copilot. The `channel` (Sales channel
        ID), `stage` (environment name), and `date` attributes can be used to
        further narrow the scope of your data source.
      required: true
      schema:
        type: string
        example: >-
          {"date": "2023-01-01T00:00:00.000Z", "channel": 12, "account":
          "1234abcd5678efgh9ijklmno","stage":"production"}
  responses:
    MissingXApiKeyHeader:
      description: Missing x-api-key in header
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                description: The error message
                example: Forbidden
                type: string
    GenericServerError:
      description: A generic server error
      content:
        application/json:
          schema:
            type: object
            properties:
              code:
                description: The error code
                type: string
              message:
                description: The error message
                type: string

````