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

# Estimate refund for a shipment or order

> Calculates the refund amount and breakdown for an order or a specific shipment before a cancellation is initiated. Returns an `OrderRefundEstimate` describing the total refundable amount, its split across the original payment modes/methods, the recommended and available refund modes, and any refunds already processed against the shipment. Use this to preview the refund the customer will receive and to let the operator pick a refund mode.



## OpenAPI

````yaml https://openapi.commercengine.io/ce-admin.json post /orders/refund-estimates
openapi: 3.1.0
info:
  title: CE Admin APIs
  version: '1.0'
  summary: Comprehensive admin interface for managing your e-commerce platform
  description: >-
    Complete administrative API suite for Commerce Engine, providing powerful
    tools to manage products, orders, customers, inventory, analytics, and
    system configuration. Designed for administrators and backend integrations
    requiring full platform control.
  license:
    name: All Rights Reserved
    url: https://www.commercengine.io/contact-us
  contact:
    email: support@commercengine.io
    url: https://www.commercengine.io/contact-us
    name: Support
servers:
  - url: https://staging.api.commercengine.io/api/v1/{store_id}/admin
    description: Staging Server
    variables:
      store_id:
        default: store_id
        description: Store ID
  - url: https://prod.api.commercengine.io/api/v1/{store_id}/admin
    description: Prod Server
    variables:
      store_id:
        default: store_id
        description: Store ID
security:
  - Authorization: []
tags:
  - name: Analytics
    description: Analytics
  - name: Catalog
    description: Catalog
  - name: Coupons & promotions
    description: Coupons & promotions
  - name: Customers
    description: Customers
  - name: Filter Options
    description: Filter Options
  - name: Inventories
    description: Inventories
  - name: Marketplace
    description: Marketplace
  - name: Marketplace Catalog
    description: Marketplace Catalog
  - name: Media Gallery
    description: Media Gallery
  - name: Metrics
    description: Metrics
  - name: Orders
    description: Orders
  - name: Payments
    description: Payments
  - name: Payouts
    description: Payouts
  - name: POS
    description: POS
  - name: POSAdmin
    description: Admin endpoints to be used as proxy in pos
  - name: Segments
    description: Segments
  - name: Shipping
    description: Shipping
  - name: SSE
    description: SSE
  - name: Store
    description: Store
  - name: Webhooks
    description: Webhooks
paths:
  /orders/refund-estimates:
    post:
      tags:
        - Orders
      summary: Estimate refund for a shipment or order
      description: >-
        Calculates the refund amount and breakdown for an order or a specific
        shipment before a cancellation is initiated. Returns an
        `OrderRefundEstimate` describing the total refundable amount, its split
        across the original payment modes/methods, the recommended and available
        refund modes, and any refunds already processed against the shipment.
        Use this to preview the refund the customer will receive and to let the
        operator pick a refund mode.
      operationId: estimate-order-refund
      requestBody:
        content:
          application/json:
            schema:
              type: object
              required:
                - order_number
                - shipment_number
              properties:
                order_number:
                  type: string
                shipment_number:
                  description: >-
                    Shipment number to estimate refund for. If not provided,
                    refund will be estimated for the order as a whole.
                  type:
                    - string
                    - 'null'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                  success:
                    type: boolean
                  content:
                    properties:
                      order:
                        $ref: '#/components/schemas/OrderRefundEstimate'
                    type: object
components:
  schemas:
    OrderRefundEstimate:
      title: OrderRefundEstimate
      description: >-
        A preview of the refund a customer will receive when an order or a
        shipment is cancelled and refunded. Returned by the refund estimate
        endpoint and used to drive the operator's refund-mode selection before
        any refund is actually initiated.
      type: object
      properties:
        order_number:
          type: string
        shipment_reference_number:
          description: Reference number of the shipment the refund is being estimated for.
          type: string
        currency:
          $ref: '#/components/schemas/Currency'
        refund_amount:
          description: >-
            Total refundable amount for the order or shipment, before choosing a
            refund mode.
          type: number
        refund_amount_breakup:
          description: >-
            Breakdown of `refund_amount` across the original payment modes and
            methods. Drives the explanation shown to the operator and customer
            about how the refund will be processed.
          type: array
          items:
            $ref: '#/components/schemas/OrderRefundAmountBreakup'
        recommended_refund_mode:
          description: >-
            Refund mode the system recommends based on the original payment mix
            and store configuration. Should be pre-selected in the operator UI.
          type: string
        available_refund_modes:
          description: >-
            Refund modes the operator can choose from for this shipment. Common
            values include `bank-transfer` and `original-payment-mode`.
          type: array
          items:
            type: string
        previous_refund_amount:
          description: >-
            Total amount already refunded against this order in earlier refund
            operations. `0` if no refunds have been processed yet.
          type: number
        previous_refund_amount_breakup:
          description: >-
            Breakdown of `previous_refund_amount` by the payment mode/method
            each portion was refunded to.
          type: array
          items:
            $ref: '#/components/schemas/OrderRefundAmountBreakup'
      x-tags:
        - Orders
    Currency:
      title: Currency
      type: object
      properties:
        name:
          type: string
        code:
          type: string
        symbol:
          type: string
      x-tags:
        - Store
    OrderRefundAmountBreakup:
      title: OrderRefundAmountBreakup
      description: >-
        One line item in a refund amount breakdown, describing how a portion of
        the refund maps back to an original payment.
      type: object
      properties:
        original_payment_mode:
          description: >-
            Payment mode used in the original transaction this portion of the
            refund is being attributed to (e.g., `payment-gateway`,
            `bank-transfer`).
          type: string
          enum:
            - payment-gateway
            - bank-transfer
        original_payment_method:
          description: >-
            Payment method used in the original transaction (e.g., `NACH`,
            `UPI`, `CARD`, `NETBANKING`, `WALLET`, `IMPS`, `NEFT`, `RTGS`).
          type: string
        amount:
          description: >-
            Refund amount to be credited to the customer. Amount will be
            adjusted for any scheduled payment if provided order was paid using
            NACH mandate.
          type: number
        label:
          description: >-
            Explanation of how this portion of the refund will be processed.
            Safe to display directly to the operator.
          type: string
      x-tags:
        - Orders
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````