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

# Confirm refund action for an order in refund_required state

> Only valid when the order's `refund_capability` is `programmatic`.
Must be called within `refund_window_hours` from `order.refund_required`.
After the window the server auto-applies `refund_preference.default`.




## OpenAPI

````yaml /api-reference/openapi.yaml post /order/{order_id}/refund-action
openapi: 3.1.0
info:
  title: Privata Wallet API
  version: 1.2.0
  summary: REST API for integrating Privata swap aggregator into crypto wallets.
  description: |
    Privata is a non-custodial swap aggregator. Wallets call this API to fetch
    quotes from 50+ providers, create exchange orders with deposit addresses,
    and track order lifecycle via webhooks or Server-Sent Events.

    Wire format is snake_case. The official JS/TS SDK (`@privata/wallet-api`)
    exposes camelCase and handles the conversion at the SDK boundary.
  contact:
    name: Privata partner support
    email: partners@privataswap.com
    url: https://docs.privataswap.com
  license:
    name: Proprietary
servers:
  - url: https://api.privataswap.com/partner/v1
    description: Production
  - url: https://api.privataswap.com/v2/exchange
    description: ChangeNOW-compatible layer (legacy clients)
security:
  - apiKey: []
tags:
  - name: Public
    description: Read endpoints. Work without an API key at lower rate-limit.
  - name: Orders
    description: Create and track exchange orders.
  - name: Refunds
    description: Refund capability and partner-confirmed refund actions.
  - name: Streaming
    description: SSE event stream for order status.
  - name: Webhooks
    description: Outbound HTTP callbacks to your endpoint.
  - name: Partner
    description: Self-service stats and history for the authenticated partner.
  - name: Health
    description: Uptime probe surface.
paths:
  /order/{order_id}/refund-action:
    post:
      tags:
        - Refunds
      summary: Confirm refund action for an order in refund_required state
      description: >
        Only valid when the order's `refund_capability` is `programmatic`.

        Must be called within `refund_window_hours` from
        `order.refund_required`.

        After the window the server auto-applies `refund_preference.default`.
      parameters:
        - in: path
          name: order_id
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RefundActionRequest'
      responses:
        '202':
          description: Accepted
        '400':
          $ref: '#/components/responses/Error'
        '409':
          description: REFUND_WINDOW_EXPIRED or REFUND_NOT_PROGRAMMATIC
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    RefundActionRequest:
      type: object
      required:
        - action
      properties:
        action:
          type: string
          enum:
            - refund_to_address
            - convert_to_stable
        stable_target:
          type: string
          nullable: true
          enum:
            - USDT-TRC20
            - USDT-ERC20
            - USDC-ERC20
            - USDC-SOL
            - null
          description: Required when action=convert_to_stable.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              enum:
                - INVALID_KEY
                - RATE_LIMITED
                - INVALID_PAIR
                - AMOUNT_TOO_LOW
                - AMOUNT_TOO_HIGH
                - NO_PROVIDERS_AVAILABLE
                - PROVIDER_ERROR
                - QUOTE_EXPIRED
                - ORDER_NOT_FOUND
                - DUPLICATE_ACTIVE_ORDER
                - REFUND_WINDOW_EXPIRED
                - REFUND_NOT_PROGRAMMATIC
                - STABLE_TARGET_REQUIRED
                - WEBHOOK_PAUSED
                - SCOPE_REQUIRED
            message:
              type: string
            request_id:
              type: string
  responses:
    Error:
      description: Error response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        Partner API key issued in the dashboard. Use `pk_live_...` in
        production, `pk_test_...` against sandbox.

````