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

# Refund a merchant order

> Refund part or all of one merchant order's captured payment and return the refund with its status (`reserved`, `executing`, `pending`, `unknown`, `succeeded` or `failed`). An `unknown` outcome is confirmed with the payment provider automatically; retry with the same reference, never a new one. Requires the `orders:write` scope. Returns `422` when the amount exceeds the refundable remainder and `409` while a transfer is unresolved or the payment is disputed.



## OpenAPI

````yaml /api-reference.json post /v1/merchant-orders/{child_order_id}/refunds
openapi: 3.1.0
info:
  description: >-
    Multi-merchant checkout infrastructure (808labs). UAE/AED first on Stripe;
    Saudi/SAR follows separate certification. OpenAPI is canonical; customers
    can integrate without an SDK. Customer dashboard authentication uses
    verified OIDC; workspace access requires an invitation or explicitly enabled
    Sandbox self-registration; machine integrations use scoped API keys. Plans
    and usage are defined in the developer guide. Internal operator and provider
    callback contracts are excluded.
  title: Ignyt Platform API
  version: 0.1.0
servers:
  - url: https://sandbox.ignite-checkout.ai
    description: 'Planned Sandbox host: use assigned deployment URL until activated'
  - url: https://api.ignite-checkout.ai
    description: 'Planned Production host: separate approval and Live credentials required'
security: []
tags:
  - name: Integration
    description: Identity, usage and the public schema for the calling integration.
  - name: Merchants
    description: Discover merchants, manage enrollments and invite stores.
  - name: Catalog
    description: Products, variants, categories and synchronization.
  - name: Carts and checkout
    description: >-
      Build carts, freeze quotes, submit purchases and manage optional Sandbox
      buyer sharing.
  - name: Webhooks and events
    description: Endpoints, deliveries, retries and the event feed.
  - name: Refunds
    description: Request and follow refunds on merchant orders.
  - name: Purchases and orders
    description: Purchases, merchant orders, cancellations and returns.
  - name: Payments and finance
    description: Payment breakdowns, statements and disputes.
  - name: Custom fields
    description: Approved custom field schemas and order extensions.
paths:
  /v1/merchant-orders/{child_order_id}/refunds:
    post:
      tags:
        - Refunds
      summary: Refund a merchant order
      description: >-
        Refund part or all of one merchant order's captured payment and return
        the refund with its status (`reserved`, `executing`, `pending`,
        `unknown`, `succeeded` or `failed`). An `unknown` outcome is confirmed
        with the payment provider automatically; retry with the same reference,
        never a new one. Requires the `orders:write` scope. Returns `422` when
        the amount exceeds the refundable remainder and `409` while a transfer
        is unresolved or the payment is disputed.
      operationId: client_refund_v1_merchant_orders__child_order_id__refunds_post
      parameters:
        - in: path
          name: child_order_id
          required: true
          schema:
            title: Child Order Id
            type: string
        - description: >-
            Required unless the body sets `external_ref`, which takes
            precedence. A client-generated key (1–120 characters) identifying
            this refund: repeating the request with the same key returns the
            original refund instead of refunding again, and reusing it with a
            different `amount_minor` is rejected with `409`. After a timeout or
            network error, retry with the same key, never a new one.
          in: header
          name: Idempotency-Key
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            description: >-
              Required unless the body sets `external_ref`, which takes
              precedence. A client-generated key (1–120 characters) identifying
              this refund: repeating the request with the same key returns the
              original refund instead of refunding again, and reusing it with a
              different `amount_minor` is rejected with `409`. After a timeout
              or network error, retry with the same key, never a new one.
            title: Idempotency-Key
        - in: header
          name: authorization
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
        - in: header
          name: x-ignite-app-id
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Ignite-App-Id
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundIn'
        required: true
      responses:
        '201':
          content:
            application/json:
              example:
                amount_minor: 2500
                child_order_id: mord_example
                components:
                  - amount_minor: 90
                    beneficiary: ignite
                    key: platform_fee
                  - amount_minor: 22
                    beneficiary: tenant:ten_example
                    key: client_share
                  - amount_minor: 2388
                    beneficiary: merchant
                    key: merchant_net
                currency: AED
                external_ref: return-8841
                id: rfd_example
                provider_ref: re_sbx_example
                reason: Shopper returned item
                requires_recovery: false
                source: client
                status: succeeded
              schema:
                $ref: '#/components/schemas/FinanceRefundView'
          description: Successful Response
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: Missing, expired or invalid credentials (`unauthorized`).
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The credential is valid but lacks the required scope, role,
            environment or ownership for this resource (`forbidden` or a more
            specific code).
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The resource does not exist or is not visible to this credential
            (`not_found`).
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            The request conflicts with the resource's current state, repeats an
            idempotency key with a different body, or is not available here
            (`conflict`, `unsupported_operation` or a more specific code). Read
            the resource again before deciding how to proceed.
        '422':
          content:
            application/json:
              schema:
                properties:
                  error:
                    properties:
                      code:
                        type: string
                      details:
                        anyOf:
                          - items:
                              properties:
                                loc:
                                  items:
                                    anyOf:
                                      - type: string
                                      - type: integer
                                  type: array
                                msg:
                                  type: string
                                type:
                                  type: string
                              required:
                                - type
                                - loc
                                - msg
                              type: object
                            type: array
                          - type: object
                      message:
                        type: string
                      request_id:
                        type: string
                    required:
                      - code
                      - message
                      - details
                      - request_id
                    type: object
                required:
                  - error
                type: object
          description: Validation Error
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/IgniteErrorEnvelope'
          description: >-
            A plan allowance, rate limit or resource limit was reached. For
            `rate_limited` (a per-second ceiling) or the monthly API allowance
            (`plan_quota_exceeded`), wait for the `Retry-After` interval before
            retrying. A specific `*_rate_limited` code, such as
            `invitation_email_rate_limited`, is an hourly limit sent without
            `Retry-After`: retry later with bounded backoff. A resource limit
            described by the operation, such as active merchant requests or
            uploads, does not clear by waiting: complete or withdraw existing
            items first. Monthly allowance and cost limits never block servicing
            of accepted orders; per-second ceilings still apply to servicing
            routes.
          headers:
            Retry-After:
              description: >-
                Seconds to wait before retrying, sent only when the monthly API
                allowance is exhausted (`plan_quota_exceeded`) or a per-second
                rate limit (`rate_limited`) is reached; specific
                `*_rate_limited` codes omit it.
              schema:
                type: integer
      security:
        - MachineKey: []
        - CustomerOIDC: []
components:
  schemas:
    RefundIn:
      properties:
        amount_minor:
          anyOf:
            - exclusiveMinimum: 0
              type: integer
            - type: 'null'
          description: >-
            Refund in integer minor units of the merchant order's currency (2500
            = AED 25.00). Omit it to refund the whole remaining refundable
            amount; it cannot exceed that remainder.
          examples:
            - 2500
          title: Amount Minor
        external_ref:
          anyOf:
            - maxLength: 120
              minLength: 1
              type: string
            - type: 'null'
          description: >-
            Your stable reference for this refund. It identifies the refund for
            safe retries and takes precedence over the `Idempotency-Key` header;
            one of the two is required.
          examples:
            - return-8841
          title: External Ref
        reason:
          description: Why the refund is issued.
          examples:
            - Shopper returned item
          maxLength: 200
          minLength: 1
          title: Reason
          type: string
      required:
        - reason
      title: RefundIn
      type: object
    FinanceRefundView:
      properties:
        amount_minor:
          title: Amount Minor
          type: integer
        child_order_id:
          title: Child Order Id
          type: string
        components:
          items:
            additionalProperties: true
            type: object
          title: Components
          type: array
        currency:
          title: Currency
          type: string
        external_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: External Ref
        id:
          title: Id
          type: string
        provider_ref:
          anyOf:
            - type: string
            - type: 'null'
          title: Provider Ref
        reason:
          title: Reason
          type: string
        requires_recovery:
          title: Requires Recovery
          type: boolean
        source:
          title: Source
          type: string
        status:
          title: Status
          type: string
      required:
        - id
        - child_order_id
        - amount_minor
        - currency
        - reason
        - source
        - external_ref
        - provider_ref
        - status
        - components
        - requires_recovery
      title: FinanceRefundView
      type: object
    IgniteErrorEnvelope:
      description: Document the existing error handler without changing its serialization.
      properties:
        error:
          $ref: '#/components/schemas/IgniteErrorDetail'
      required:
        - error
      title: IgniteErrorEnvelope
      type: object
    IgniteErrorDetail:
      description: Stable error fields; details remain open to each domain's JSON evidence.
      properties:
        code:
          title: Code
          type: string
        details:
          title: Details
        message:
          title: Message
          type: string
        request_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Request Id
      required:
        - code
        - message
        - details
        - request_id
      title: IgniteErrorDetail
      type: object
  securitySchemes:
    MachineKey:
      description: Server-side scoped Ignyt API key.
      scheme: bearer
      type: http
    CustomerOIDC:
      bearerFormat: JWT
      description: >-
        Customer access token; current membership, role and app selection are
        enforced. Protected actions use recent email-code verification in the
        configured Sandbox or recent authenticator verification in legacy
        password mode. Available when customer authentication is enabled.
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.