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

# Get order cancellation eligibility by order number

> Either customer may initiate cancellation due to an incorrect order placement or as a merchant, you may initiate cancellation due to product unavailability, pricing errors, payment failure, or shipping restrictions. Before processing cancellation, its crucial to determine the eligibility of the cancellation request. <p> This endpoint gets the eligibility of the cancellation request by order number. You can additionally specify `lineItemIds` to get the eligibility of specific line items.</p> <p> **Note**: If you do not have order number, use the corresponding order ID-based endpoint - `/orders/{orderId}/actions/check-cancel-eligibility`.</p>



## OpenAPI

````yaml orders.openapi post /orders/order-number/{orderNumber}/actions/check-cancel-eligibility
openapi: 3.0.1
info:
  contact:
    email: support@fabric.inc
    name: fabric Support Team
  description: >-
    fabric **Orders** API is a scalable multi-tenant service designed to
    streamline your order management process. Orders API is a REST and JSON
    driven interface enabling retailers to create orders directly from online
    Storefronts and Point-of-Sale systems, and serve as records of purchase
    transactions to permit retailers to operate against a standard schema with
    varied purchase channels. <p> fabric Orders API creates orders real time in
    the orders database, unifying the order data for users to streamline order
    lifecycle orchestration and customer service operations. It offers a range
    of features including the ability to create orders, get orders, update
    pickup details, and track orders, as well as search for existing orders.
    Also, the Orders API makes it easy to check eligibility of return, cancel,
    and exchange requests as well process them, if eligible. In addition, you
    can flag fraudulent orders based on due diligence, and either release them
    from hold or cancel them altogether. The appeasement feature helps you
    resolve any issues that may arise with an order and keep your customers
    happy. </p>
  license:
    name: fabric API License
    url: https://fabric.inc/api-license
  termsOfService: https://fabric.inc/terms-of-use
  title: fabric Orders API
  version: 3.0.0
  x-audience: external-public
servers:
  - description: Production
    url: https://api.fabric.inc/v3
security:
  - authorization: []
tags:
  - description: These endpoints authorize order payments.
    name: Payments
  - description: These endpoints help create appeasement requests.
    name: Appeasements
  - description: >-
      Credits are refunds to customers, often in the form of gift cards or
      credit notes, when customers have made payments with cash or a card that
      has subsequently expired. Credits are provided during order returns and
      appeasements. Use these endpoints to create and manage credits.
    name: Credits
  - description: >-
      These endpoints check eligibility of order cancellation requests and if
      eligible, processes order cancellation.
    name: Cancellations
  - description: These endpoints track orders.
    name: Tracking
  - description: >-
      These endpoints create orders, update pickup details (for BOPIS scenarios)
      and get order details.
    name: Orders
  - description: >-
      These endpoints check eligibility of order return or exchanges requests
      and, if eligible, processes order return or exchanges.
    name: Returns
  - description: These endpoints deal with potential fraud orders.
    name: Frauds
externalDocs:
  description: Find out more about fabric Orders (also called OMS)
  url: https://developer.fabric.inc/v3/docs/orders-overview
paths:
  /orders/order-number/{orderNumber}/actions/check-cancel-eligibility:
    post:
      tags:
        - Cancellations
      summary: Get order cancellation eligibility by order number
      description: >-
        Either customer may initiate cancellation due to an incorrect order
        placement or as a merchant, you may initiate cancellation due to product
        unavailability, pricing errors, payment failure, or shipping
        restrictions. Before processing cancellation, its crucial to determine
        the eligibility of the cancellation request. <p> This endpoint gets the
        eligibility of the cancellation request by order number. You can
        additionally specify `lineItemIds` to get the eligibility of specific
        line items.</p> <p> **Note**: If you do not have order number, use the
        corresponding order ID-based endpoint -
        `/orders/{orderId}/actions/check-cancel-eligibility`.</p>
      operationId: getCancelOrderEligibilityByOrderNumber
      parameters:
        - description: The merchant-defined order identifier.
          example: 123k4h123k
          in: path
          name: orderNumber
          required: true
          schema:
            type: string
        - description: >-
            The merchant-defined cancellation policy. When omitted, the default
            policy is used.
          in: query
          name: policyName
          required: false
          schema:
            type: string
        - description: >-
            The line item IDs. If specified, you'll get cancellation eligibility
            of the given line items. If omitted, you'll get cancellation
            eligibility of each item in the order.
          in: query
          name: lineItemIds
          required: false
          schema:
            items:
              type: string
            type: array
        - $ref: '#/components/parameters/xFabricTenantId'
        - $ref: '#/components/parameters/xFabricChannelId'
        - $ref: '#/components/parameters/xFabricRequestId'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/eligibilityResponse'
          description: OK
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        '400':
          content:
            application/json:
              example:
                errors:
                  - message: Invalid request
                    type: CLIENT_ERROR
                message: Bad request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Bad request
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        '401':
          content:
            application/json:
              example:
                message: Unauthorized request
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Unauthorized
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        '404':
          content:
            application/json:
              example:
                message: Not found
                type: CLIENT_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Not found
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
        '500':
          content:
            application/json:
              example:
                message: Internal server error
                type: SERVER_ERROR
              schema:
                $ref: '#/components/schemas/errorResponse'
          description: Internal server error
          headers:
            x-fabric-request-id:
              $ref: '#/components/headers/xFabricRequestIdResponseHeader'
components:
  parameters:
    xFabricTenantId:
      description: >-
        A header used by fabric to identify the tenant making the request. You
        must include tenant id in the authentication header for an API request
        to access any of fabric’s endpoints. You can retrieve the tenant id ,
        which is also called account id, from
        [Copilot](/v3/platform/settings/account-details/getting-the-account-id).
        This header is required.
      example: 5f328bf0b5f328bf0b5f328b
      in: header
      name: x-fabric-tenant-id
      required: true
      schema:
        type: string
    xFabricChannelId:
      description: >-
        x-fabric-channel-id identifies the sales channel where the API request
        is being made; primarily for multichannel use cases. The channel ids are
        12 corresponding to US and 13 corresponding to Canada. The default
        channel id is 12. This field is required.
      example: '12'
      in: header
      name: x-fabric-channel-id
      required: true
      schema:
        type: string
    xFabricRequestId:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      in: header
      name: x-fabric-request-id
      required: false
      schema:
        type: string
  schemas:
    eligibilityResponse:
      description: Eligibility details object.
      properties:
        eligibleReasonCodes:
          description: Reason codes for returns
          items:
            $ref: '#/components/schemas/reasonCodeAndDescription'
          type: array
        fees:
          description: Fee details
          items:
            $ref: '#/components/schemas/policyFeeResource'
          type: array
        items:
          description: Item's eligibility for return, cancellation, or exchange
          items:
            $ref: '#/components/schemas/itemEligibilityResource'
          type: array
        orderId:
          description: 24-character system-generated order ID
          example: 62f3982438bcab1951be0a19
          type: string
        period:
          description: Return, exchange or cancellation window as per merchant policy
          example: 30D00H00M
          type: string
        policyType:
          description: >-
            Policy type that determines eligibility of exchange, return, or
            cancellation. If omitted, the default policy is considered.
          example: Company Policy 2023
          type: string
      type: object
    errorResponse:
      description: Error response
      properties:
        errors:
          description: Errors
          items:
            $ref: '#/components/schemas/errorResponse'
          type: array
        message:
          description: Error message
          example: Bad request
          type: string
        type:
          description: Error type
          example: CLIENT_ERROR
          type: string
      type: object
    reasonCodeAndDescription:
      description: Return or exchange reason
      properties:
        code:
          description: >-
            Reason code for return, cancellation, or exchange. Values are
            configurable as per requirement.
          example: 1DMG
          type: string
        description:
          description: Brief description for the return `code`
          example: Damaged
          type: string
      type: object
    policyFeeResource:
      description: Policy fee
      properties:
        amount:
          description: Fee applicable for the policy
          example: 33.9
          format: double
          type: number
        amountInCurrencies:
          items:
            $ref: '#/components/schemas/amountInCurrency'
          type: array
        currency:
          description: Three-letter currency code as defined by ISO-4217
          example: USD
          type: string
        platinumFee:
          description: >-
            Fees applicable for return, cancellation, or exchange of an item as
            per the policy
          example: 33.9
          format: double
          type: number
      type: object
    itemEligibilityResource:
      description: Item's eligibility for return, cancellation, or exchange
      properties:
        eligibleQuantity:
          description: >-
            Quantity of the given item eligible for return, cancellation, or
            exchange
          example: 10
          format: int32
          type: integer
        isEligible:
          description: >-
            true: Item is eligible for return or exchange  false: Item is not
            eligible for return or exchange
          example: true
          type: boolean
        lineItemId:
          description: >-
            Merchant-defined unique identifier for each item in an order. When
            omitted, fabric will generate it during order creation, in UUID
            format.
          example: 62f3dfc438bcab1951be0a19
          type: string
        sku:
          description: Stock keeping unit (SKU), unique identifier of item
          example: P1234
          type: string
      type: object
    amountInCurrency:
      description: Amount in currency object details.
      properties:
        amount:
          description: The amount displayed in the primary currency.
          example: 123.45
          format: double
          type: number
        currency:
          description: Currency in ISO-4217
          example: USD
          type: string
        group:
          description: >-
            A unique identifier for currencies. All calculations and invoicing
            are based on this identifier. For example, the `Shopper` group uses
            USD, while the `Retailer` group uses EUR.
          example: SHOPPER
          type: string
      required:
        - currency
        - group
      type: object
  headers:
    xFabricRequestIdResponseHeader:
      description: Unique request ID
      example: 263e731c-45c8-11ed-b878-0242ac120002
      required: false
      schema:
        type: string
  securitySchemes:
    authorization:
      bearerFormat: JWT
      scheme: bearer
      type: http

````