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

# Refund a payment

> Starts a refund of a completed payment. The merchant authorises it at their bank: open `authorisationUrl` in a new window, then poll the refund. `authorisationUrl` is returned only in this response. Returns 409 if the payment is not refundable or the amount exceeds what remains, and 404 if the payment is not on the account.



## OpenAPI

````yaml /autogenerated/openapi/roqqett.openapi.json post /roqqett/payments/{paymentId}/refunds
openapi: 3.1.0
info:
  title: Roqqett API
  version: 2.0.0
  description: Version 2
  license:
    name: UNLICENSED
    url: https://docs.equalsmoney.com
servers:
  - url: https://api.equalsmoney.com/v2
    description: Production
security: []
paths:
  /roqqett/payments/{paymentId}/refunds:
    post:
      tags:
        - Refunds
      summary: Refund a payment
      description: >-
        Starts a refund of a completed payment. The merchant authorises it at
        their bank: open `authorisationUrl` in a new window, then poll the
        refund. `authorisationUrl` is returned only in this response. Returns
        409 if the payment is not refundable or the amount exceeds what remains,
        and 404 if the payment is not on the account.
      operationId: createRefund
      parameters:
        - name: paymentId
          in: path
          required: true
          schema:
            type:
              - string
            format: uuid
            maxLength: 36
            description: The ID of a Roqqett payment or refund record.
            example: 9c4e1a7b-3d2f-4b6a-8e5c-0f7d2a9b1c34
        - name: accountId
          in: query
          schema:
            description: The ID of the account to work with.
            type:
              - string
            example: F50091
          required: true
      requestBody:
        description: Body
        content:
          application/json:
            schema:
              type:
                - object
              properties:
                amount:
                  type:
                    - object
                  properties:
                    amount:
                      type:
                        - string
                      maxLength: 32
                      pattern: ^[0-9]+(\.[0-9]+)?$
                      description: >-
                        Decimal amount in major units, as a string. Never a
                        float.
                      example: '10000.00'
                    currencyCode:
                      type:
                        - string
                      enum:
                        - GBP
                        - EUR
                      description: >-
                        ISO-4217 code of a currency Roqqett can take payments
                        in: GBP over Faster Payments, EUR over SEPA Instant.
                      example: GBP
                  required:
                    - amount
                    - currencyCode
                  description: >-
                    How much to refund. At most the payment amount less anything
                    already refunded, in the payment's currency.
                reason:
                  type:
                    - string
                  minLength: 1
                  maxLength: 140
                  description: Why the refund is being made.
                  example: Item returned
              required:
                - amount
              example:
                amount:
                  amount: '10000.00'
                  currencyCode: GBP
                reason: Item returned
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  id:
                    type:
                      - string
                    format: uuid
                    maxLength: 36
                    description: The ID of a refund.
                    example: 4a7d2c9e-1b5f-4e3a-9c8d-6b0f1e2a7c45
                  paymentId:
                    type:
                      - string
                    format: uuid
                    maxLength: 36
                    description: The payment being refunded.
                    example: 9c4e1a7b-3d2f-4b6a-8e5c-0f7d2a9b1c34
                  status:
                    type:
                      - string
                    enum:
                      - AWAITING_AUTHORISATION
                      - PENDING
                      - COMPLETED
                      - FAILED
                      - CANCELLED
                    description: >-
                      AWAITING_AUTHORISATION until the merchant authorises the
                      refund at their bank via `authorisationUrl`.
                    example: AWAITING_AUTHORISATION
                  amount:
                    type:
                      - object
                    properties:
                      amount:
                        type:
                          - string
                        maxLength: 32
                        pattern: ^[0-9]+(\.[0-9]+)?$
                        description: >-
                          Decimal amount in major units, as a string. Never a
                          float.
                        example: '10000.00'
                      currencyCode:
                        type:
                          - string
                        enum:
                          - GBP
                          - EUR
                        description: >-
                          ISO-4217 code of a currency Roqqett can take payments
                          in: GBP over Faster Payments, EUR over SEPA Instant.
                        example: GBP
                    required:
                      - amount
                      - currencyCode
                    description: >-
                      A money value: a decimal amount as a string plus an
                      ISO-4217 currency code.
                  reason:
                    type:
                      - string
                      - 'null'
                    maxLength: 140
                    description: Why the refund was made.
                    example: Item returned
                  authorisationUrl:
                    type:
                      - string
                      - 'null'
                    format: uri
                    maxLength: 2048
                    description: >-
                      The page where the merchant authorises the refund at their
                      bank: open it in a new window, then poll the refund. It
                      carries a short-lived token, so it is returned only when
                      the refund is created; retrieving a refund always returns
                      `null`.
                    example: >-
                      https://pay.roqqett.com/ob/refund?sessionId=4a7d2c9e-1b5f-4e3a-9c8d-6b0f1e2a7c45&paymentToken=example-token&organisationId=0b6f3c1e-8a2d-4f5b-9e7c-3d1a2b4c5e6f
                  createdAt:
                    type:
                      - string
                    format: date-time
                    description: >-
                      The date the Resource was initially created. ISO 8601
                      format without milliseconds.
                  completedAt:
                    type:
                      - string
                      - 'null'
                    format: date-time
                    description: When the refund reached a terminal status.
                    example: '2026-10-02T12:10:00Z'
                required:
                  - id
                  - paymentId
                  - status
                  - amount
                  - reason
                  - authorisationUrl
                  - createdAt
                  - completedAt
                example:
                  id: 4a7d2c9e-1b5f-4e3a-9c8d-6b0f1e2a7c45
                  paymentId: 9c4e1a7b-3d2f-4b6a-8e5c-0f7d2a9b1c34
                  status: AWAITING_AUTHORISATION
                  amount:
                    amount: '10000.00'
                    currencyCode: GBP
                  reason: Item returned
                  authorisationUrl: >-
                    https://pay.roqqett.com/ob/refund?sessionId=4a7d2c9e-1b5f-4e3a-9c8d-6b0f1e2a7c45&paymentToken=example-token&organisationId=0b6f3c1e-8a2d-4f5b-9e7c-3d1a2b4c5e6f
                  createdAt: '2019-08-24T14:15:22Z'
                  completedAt: '2026-10-02T12:10:00Z'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
        '409':
          description: Conflict
          content:
            application/json:
              schema:
                type:
                  - object
                properties:
                  message:
                    type:
                      - string
                    maxLength: 1024
                    description: Human-readable error description.
                    example: Checkout session not found.
                  errors:
                    type:
                      - array
                    items:
                      type:
                        - object
                      properties:
                        path:
                          type:
                            - string
                          description: The location of the bad parameter.
                        message:
                          type:
                            - string
                          description: Description of why the validation failed.
                        errorCode:
                          type:
                            - string
                          description: Where the error occurred.
                      required:
                        - path
                        - message
                      description: An object containing details about one particular error.
                required:
                  - message
                  - errors
                example:
                  message: Checkout session not found.
                  errors:
                    - path: string
                      message: string
                      errorCode: string
      security:
        - CommonAuth:
            - roqqett:refunds:create:any
      x-codeSamples:
        - lang: Shell
          label: cURL
          source: |-
            curl --request POST \
              --url 'https://api.equalsmoney.com/v2/roqqett/payments/{paymentId}/refunds?accountId={{accountId}}' \
              --header 'Authorization: <api-key>' \
              --header 'Content-Type: application/json' \
              --data '
            {
              "amount": {
                "amount": "10000.00",
                "currencyCode": "GBP"
              },
              "reason": "Item returned"
            }
            '
components:
  securitySchemes:
    CommonAuth:
      type: apiKey
      in: header
      name: Authorization

````