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

# Refund an order

> Initiates a refund for a completed order.



## OpenAPI

````yaml /swagger/openapi-billing.json post /payment/refund
openapi: 3.0.0
info:
  title: OpenAPI3
  version: 1.0.0
servers:
  - url: https://billing.funnelfox.com/{org_id}/v1
    description: FunnelFox Billing API
    variables:
      org_id:
        default: your-org-id
        description: Your organization ID
security:
  - FunnelFoxSecretKey: []
paths:
  /payment/refund:
    post:
      tags:
        - Payment management
      summary: Refund an order
      description: Initiates a refund for a completed order.
      parameters:
        - name: org_id
          in: path
          required: true
          description: Organization ID
          schema:
            type: string
          style: simple
          explode: false
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundIn'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Ok200'
components:
  schemas:
    RefundIn:
      properties:
        reason:
          default: ''
          description: Short reason code (e.g., "duplicate_payment", "unauthorized_charge")
          maxLength: 256
          title: Reason
          type: string
        comment:
          default: ''
          description: Human-readable comment or reference (e.g., support ticket link)
          maxLength: 2048
          title: Comment
          type: string
        external_id:
          description: Your unique identifier for the user
          maxLength: 256
          title: Customer Id
          type: string
        order_id:
          description: Order ID (can include multiple transactions, fallbacks, and refunds)
          format: uuid
          title: order id
          type: string
        amount:
          anyOf:
            - type: number
            - type: string
          default: null
          description: Refund amount (omit for full refund)
          title: Amount of partial refund
          nullable: true
        soft_refund:
          default: false
          description: Keep subscription active (true) or cancel it (false)
          title: Soft Refund
          type: boolean
      required:
        - external_id
        - order_id
      title: RefundIn
      type: object
    Ok200:
      properties: {}
      title: Ok200
      type: object
  securitySchemes:
    FunnelFoxSecretKey:
      type: apiKey
      in: header
      name: ff-secret-key
      description: Secret key for FunnelFox Billing API. Required for all requests.

````