> ## 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.

# Update vendor refund payment

> 
        Update an existing vendor refund payment's status or details.

        **Updatable Fields:**
        - `status`: Update payment status (with validation)
        - `failure_reason`: Required when status is 'failed'
        - `payment_reference`: Update external reference
        - `processing_fee_cents`: Update processing fee

        **Status Transitions:**
        - `pending` → `processing`, `completed`, `failed`, `cancelled`
        - `processing` → `completed`, `failed`
        - `completed` → (no transitions allowed)
        - `failed` → (no transitions allowed)
        - `cancelled` → (no transitions allowed)
        



## OpenAPI

````yaml PATCH /v1/platform/businesses/{business_id}/vendor-refunds/payments/{vendor_refund_payment_id}/
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}/vendor-refunds/payments/{vendor_refund_payment_id}/:
    patch:
      tags:
        - Vendor Refund Payments
      summary: Update vendor refund payment
      description: |2-

                Update an existing vendor refund payment's status or details.

                **Updatable Fields:**
                - `status`: Update payment status (with validation)
                - `failure_reason`: Required when status is 'failed'
                - `payment_reference`: Update external reference
                - `processing_fee_cents`: Update processing fee

                **Status Transitions:**
                - `pending` → `processing`, `completed`, `failed`, `cancelled`
                - `processing` → `completed`, `failed`
                - `completed` → (no transitions allowed)
                - `failed` → (no transitions allowed)
                - `cancelled` → (no transitions allowed)
                
      operationId: update_vendor_refund_payment
      parameters:
        - in: path
          name: business_id
          schema:
            type: string
            format: uuid
          description: Business UUID
          required: true
        - in: path
          name: vendor_refund_payment_id
          schema:
            type: string
            format: uuid
          description: Vendor Refund Payment UUID
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedVendorRefundPaymentUpdateRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedVendorRefundPaymentUpdateRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedVendorRefundPaymentUpdateRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VendorRefundPaymentCreateResponse'
          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:
        - BusinessScopedJWT: []
        - PartnerJWT: []
        - BasicAuth: []
        - BearerUnscoped: []
        - BearerBusinessScoped: []
components:
  schemas:
    PatchedVendorRefundPaymentUpdateRequest:
      type: object
      description: Serializer for updating vendor refund payment status and details.
      properties:
        status:
          enum:
            - pending
            - processing
            - completed
            - failed
            - cancelled
          type: string
          x-spec-enum-id: 13b0995e5c712ee4
          description: |-
            New payment status

            * `pending` - pending
            * `processing` - processing
            * `completed` - completed
            * `failed` - failed
            * `cancelled` - cancelled
        failure_reason:
          type: string
          description: Reason for failure (required if status is 'failed')
        payment_reference:
          type: string
          description: Updated payment reference
          maxLength: 100
        memo:
          type: string
          description: Updated memo
        metadata:
          nullable: true
          description: Updated metadata
    VendorRefundPaymentCreateResponse:
      type: object
      description: |-
        Serializer for vendor refund payment create/update responses.

        This serializer formats the response data for successful refund payment
        creation operations. Renamed from VendorRefundPaymentResponseSerializer
        to avoid naming conflict with vendor_refund_serializers.py.
      properties:
        refund:
          type: object
          additionalProperties: {}
          description: Complete refund information
        payment:
          type: object
          additionalProperties: {}
          nullable: true
          description: Payment information
        allocations:
          type: array
          items:
            type: object
            additionalProperties: {}
          description: List of allocations created
      required:
        - allocations
        - payment
        - refund
    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
  securitySchemes:
    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.
    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.
    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.

````