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

# Create Refund

> Issue a refund against a payment



## OpenAPI

````yaml post /v1/aggregators/{raast-aggregator-id}/refunds
openapi: 3.1.0
info:
  title: Raast Wire
  version: 1.0.0
  description: ''
servers:
  - url: https://api.getsafepay.com/raastwire
security: []
tags:
  - name: Aggregators
  - name: Access Keys
  - name: Merchants
  - name: Raast Merchants
  - name: Payments
  - name: Refunds
  - name: QRs
  - name: Utilities
  - name: Aliases
  - name: Ledgers
  - name: Webhooks
paths:
  /v1/aggregators/{raast-aggregator-id}/refunds:
    parameters:
      - $ref: '#/components/parameters/AggregatorIdParam'
    post:
      tags:
        - Refunds
      summary: Create Refund
      description: Issue a refund against a payment
      requestBody:
        $ref: '#/components/requestBodies/CreateRefund'
      responses:
        '200':
          $ref: '#/components/responses/CreateRefundResponse'
      security:
        - apiKey: []
components:
  parameters:
    AggregatorIdParam:
      name: raast-aggregator-id
      in: path
      required: true
      schema:
        type: string
        example: agg_2288490a-2176-4de5-b373-0ffb6f8e2e6e
      description: The unique identifier for the aggregator
  requestBodies:
    CreateRefund:
      description: Request to create Refund
      content:
        application/json:
          schema:
            type: object
            properties:
              request_id:
                type: string
              payment_id:
                type: string
              amount:
                type: integer
              reason:
                type: string
                enum:
                  - TechnicalProblem
                  - DuplicatePayment
              addtl_info:
                type: string
              debitor_iban:
                type: string
            required:
              - request_id
              - payment_id
              - amount
              - reason
              - debitor_iban
          examples:
            Create Refund:
              value:
                request_id: 9af69842-3011-4d6b-98d0-c3de1caa96d3
                payment_id: pm_54b6bcee-aa58-454d-aed9-ce97d6bdd797
                amount: 500
                reason: TechnicalProblem
                addtl_info: ''
                debitor_iban: PK12ALFH0031001006540005
  responses:
    CreateRefundResponse:
      description: This response contains details of a refund
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLengthHeader'
        Date:
          $ref: '#/components/headers/DateHeader'
      content:
        application/json:
          schema:
            allOf:
              - $ref: '#/components/schemas/StandardResponse'
              - type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Refund'
  headers:
    ContentLengthHeader:
      schema:
        type: string
        example: '256'
    DateHeader:
      schema:
        type: string
        example: Sat, 12 Aug 2023 08:55:04 GMT
  schemas:
    StandardResponse:
      type: object
      description: Standard response structure for successful operations
      properties:
        api_version:
          type: string
          example: v1
          description: The current version of the API spec
        data:
          type: object
          description: Contains the response data
    Refund:
      type: object
      properties:
        token:
          type: string
        payment_id:
          type: string
        amount:
          type: string
        type:
          type: string
        reason:
          type: string
        addtl_info:
          type: string
        status:
          type: string
        trace_reference:
          type: string
        msg_id:
          type: string
        return_id:
          type: string
        request_id:
          type: string
        msg_created_at:
          $ref: '#/components/schemas/Timestamp'
        settle_at:
          nullable: true
        created_at:
          $ref: '#/components/schemas/Timestamp'
        updated_at:
          $ref: '#/components/schemas/Timestamp'
    Timestamp:
      type: string
      format: date-time
      description: ISO 8601 timestamp in UTC
      example: '2025-03-13T09:12:34.000Z'
  securitySchemes:
    apiKey:
      type: apiKey
      name: X-SFPY-AGGREGATOR-SECRET-KEY
      in: header

````