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

# Create refund payment

> Create a payment for an existing refund. Supports idempotency via external_id.
- Amount must not exceed remaining refundable amount.
- Status transitions: pending→processing (partial), →paid (fully covered).



## OpenAPI

````yaml POST /v1/platform/businesses/{business_id}/invoices/refunds/{refund_id}/payments/
openapi: 3.0.3
info:
  title: Thredfi Accounting Platform API
  version: 1.0.0
  description: >-
    Comprehensive API for accounting, invoice management, open banking, and
    intelligence services.
servers: []
security: []
paths:
  /v1/platform/businesses/{business_id}/invoices/refunds/{refund_id}/payments/:
    post:
      tags:
        - Refund Payments
      summary: Create refund payment
      description: >-
        Create a payment for an existing refund. Supports idempotency via
        external_id.

        - Amount must not exceed remaining refundable amount.

        - Status transitions: pending→processing (partial), →paid (fully
        covered).
      operationId: create_refund_payment
      parameters:
        - in: path
          name: business_id
          schema:
            type: string
            pattern: ^[0-9a-f-]+$
          required: true
        - in: path
          name: refund_id
          schema:
            type: string
            pattern: ^[0-9a-f-]+$
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateRefundPaymentRequestRequest'
            examples:
              CreateRefundPayment:
                value:
                  amount_cents: 20000
                  method: ACH
                  completed_at: '2026-02-13T10:58:03.887570Z'
                  external_id: rp-2024-001
                  processor: STRIPE
                  memo: Partial refund transfer
                  transaction_tags:
                    - refund_batch:2024-01
                    - channel:bank
                  refund_processing_fee_cents: 30
                summary: Create Refund Payment
                description: Example request payload to create a refund payment
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/CreateRefundPaymentRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateRefundPaymentRequestRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundPayment'
          description: ''
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
          description: Validation errors in request data
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Authentication required - missing or invalid API key
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Permission denied - insufficient privileges
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Resource not found
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Conflict - resource already exists or invalid state transition
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable entity - business logic validation failed
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      security:
        - PartnerJWT: []
        - BusinessScopedJWT: []
        - BasicAuth: []
        - BearerUnscoped: []
        - BearerBusinessScoped: []
components:
  schemas:
    CreateRefundPaymentRequestRequest:
      type: object
      description: >-
        Serializer for creating a refund payment (reusable for other endpoints).
        All amounts in cents.
      properties:
        amount_cents:
          type: integer
          minimum: 1
          description: >-
            Amount to disburse for this refund in cents (e.g., 20000 for
            €200.00)
        method:
          enum:
            - CASH
            - CHECK
            - CREDIT_CARD
            - DEBIT_CARD
            - ACH
            - BANK_TRANSFER
            - PAYPAL
            - STRIPE
            - OTHER
          type: string
          x-spec-enum-id: c331bf4f48370b25
          description: |-
            Payment method for the refund payment

            * `CASH` - Cash
            * `CHECK` - Check
            * `CREDIT_CARD` - Credit Card
            * `DEBIT_CARD` - Debit Card
            * `ACH` - ACH
            * `BANK_TRANSFER` - Bank Transfer
            * `PAYPAL` - PayPal
            * `STRIPE` - Stripe
            * `OTHER` - Other
        completed_at:
          type: string
          format: date-time
          description: When the refund payment was completed
        external_id:
          type: string
          minLength: 1
          description: Required idempotency key per refund (unique within a refund)
          maxLength: 255
        processor:
          type: string
          description: Payment processor
          maxLength: 100
        memo:
          type: string
          description: Optional notes for the payment
        transaction_tags:
          type: array
          items:
            type: string
            minLength: 1
            maxLength: 100
          description: Optional list of string tags for reconciliation
        refund_processing_fee_cents:
          type: integer
          minimum: 0
          default: 0
          description: Processing fee for this refund payment in cents (e.g., 30 for €0.30)
      required:
        - amount_cents
        - external_id
        - method
    RefundPayment:
      type: object
      description: Serializer for refund payments. All amounts in cents.
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
          description: Unique refund payment identifier
        refund_id:
          type: string
          format: uuid
          readOnly: true
          description: ID of the refund this payment belongs to
        external_id:
          type: string
          description: Your unique identifier for idempotency (unique within refund)
          maxLength: 255
        refunded_amount:
          type: integer
          description: Refunded amount in cents
          readOnly: true
        refund_processing_fee:
          type: integer
          readOnly: true
          description: Processing fee in cents
        completed_at:
          type: string
          format: date-time
          nullable: true
          description: Date and time when refund payment was completed
        method:
          enum:
            - BANK_TRANSFER
            - CREDIT_CARD
            - DEBIT_CARD
            - ACH
            - CHECK
            - CASH
            - PAYPAL
            - STRIPE
            - OTHER
          type: string
          x-spec-enum-id: ba977578c39a8b5e
          description: >-
            Payment method used for refund (CASH, CHECK, CREDIT_CARD,
            BANK_TRANSFER, etc.)


            * `BANK_TRANSFER` - Bank Transfer

            * `CREDIT_CARD` - Credit Card

            * `DEBIT_CARD` - Debit Card

            * `ACH` - ACH/Direct Debit

            * `CHECK` - Check/Cheque

            * `CASH` - Cash

            * `PAYPAL` - PayPal

            * `STRIPE` - Stripe

            * `OTHER` - Other
        processor:
          type: string
          description: Payment processor used (e.g., Stripe, PayPal, manual)
          maxLength: 100
        transaction_tags:
          description: List of tags for categorization and reconciliation tracking
        memo:
          type: string
          description: Optional description or notes for this refund payment
        metadata:
          description: Custom key-value pairs for payment context
        reconciled_bank_transactions:
          type: array
          items:
            $ref: '#/components/schemas/EntityReconciliationDetail'
          readOnly: true
          description: Bank transactions this refund payment is reconciled to
        created_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when refund payment record was created
        updated_at:
          type: string
          format: date-time
          readOnly: true
          description: Timestamp when refund payment record was last updated
      required:
        - created_at
        - id
        - reconciled_bank_transactions
        - refund_id
        - refund_processing_fee
        - refunded_amount
        - updated_at
    ValidationErrorResponse:
      type: object
      description: Validation error response with field-specific errors
      properties:
        error_code:
          type: string
          description: Error code (e.g., 'validation_error')
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Contains field_errors and additional context
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - detail
        - error_code
        - message
    ErrorResponse:
      type: object
      description: Standard error response format
      properties:
        error_code:
          type: string
          description: Error code for programmatic handling
        message:
          type: string
          nullable: true
          description: Human-readable error message
        detail:
          type: object
          additionalProperties: {}
          description: Additional error details including field_errors and debug info
        request_id:
          type: string
          description: Request ID for tracing
      required:
        - error_code
        - message
    EntityReconciliationDetail:
      type: object
      description: >-
        Which bank transaction an entity (invoice/bill payment) is reconciled
        to.
      properties:
        payment_type:
          type: string
        bank_transaction_id:
          type: string
          format: uuid
        bank_transaction_date:
          type: string
          format: date-time
        bank_transaction_amount_cents:
          type: integer
        bank_transaction_direction:
          type: string
        reconciled_amount_cents:
          type: integer
        reconciliation_link_id:
          type: string
          format: uuid
        reconciled_at:
          type: string
          format: date-time
        currency:
          type: string
        bank_account_name:
          type: string
        notes:
          type: string
      required:
        - bank_transaction_amount_cents
        - bank_transaction_date
        - bank_transaction_direction
        - bank_transaction_id
        - currency
        - reconciled_amount_cents
        - reconciled_at
        - reconciliation_link_id
  securitySchemes:
    PartnerJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner-level JWT token (unscoped). Token payload includes `partner_id`.
        Business access is validated via partner ownership. Format: `Bearer
        <your-jwt-token>`


        **Use this for**: Multi-business operations where the business_id is
        specified in the URL and partner has access to multiple businesses.
    BusinessScopedJWT:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT token. Token payload includes `business_id` to
        automatically scope requests. Format: `Bearer <your-jwt-token>`


        **Use this for**: Business-specific operations where the business
        context is embedded in the token.
    BasicAuth:
      type: http
      scheme: basic
      description: >-
        Basic authentication for OAuth2 token endpoint. Use partner_uuid:api_key
        as username:password. Example: Authorization: Basic
        base64(partner_uuid:api_key)
    BearerUnscoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Partner (unscoped) JWT Bearer token. Obtain via POST
        /v1/platform/oauth2/token with Basic auth (partner_uuid:api_key). Use
        header: Authorization: Bearer {access_token}
    BearerBusinessScoped:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Business-scoped JWT Bearer token. Obtain via POST
        /v1/platform/{business_id}/oauth2/token/ using a partner Bearer token.
        Only valid for endpoints whose URL contains that business_id.

````