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

# Refund Payin

> Issues a partial or full refund for a confirmed payin. Only supported payment methods can be refunded.
For bank wire payins, a `bankaccount_id` is required to specify the refund destination.




## OpenAPI

````yaml POST /payins/{id}/refund
openapi: 3.1.0
info:
  title: Truust API
  version: '2.0'
  description: >
    The Truust API allows you to manage payment flows, orders, customers,
    wallets, and more.


    ## Authentication


    All authenticated endpoints require a Bearer token using your account's
    **Secret Key**.


    ```

    Authorization: Bearer {your_secret_key}

    ```


    Your API keys are available in the Dashboard under **Account Settings → API
    Developers**.
  contact:
    email: hello@truust.io
  license:
    name: Proprietary
servers:
  - url: https://{subdomain}.truust.io/2.0
    description: Production
    variables:
      subdomain:
        default: your-subdomain
        description: Your account subdomain
  - url: https://{subdomain}-sandbox.truust.io/2.0
    description: Sandbox
    variables:
      subdomain:
        default: your-subdomain
        description: Your account subdomain
security:
  - bearerAuth: []
tags:
  - name: Account
    description: Manage your Truust account
  - name: Customers
    description: Manage buyers and sellers (end users)
  - name: Orders
    description: Create and manage escrow payment orders
  - name: Payins
    description: Manage incoming payments for orders
  - name: Payouts
    description: Manage outgoing payments from orders
  - name: Wallets
    description: Manage customer and account wallets
  - name: Bank Accounts
    description: Manage bank accounts for payouts
  - name: Cards
    description: Manage tokenized payment cards
  - name: Subscriptions
    description: Manage recurring payment subscriptions
  - name: Verifications
    description: KYC verification for customers and accounts
  - name: Bundles
    description: Manage product bundles for orders
  - name: Refunds
    description: View refund records
paths:
  /payins/{id}/refund:
    post:
      tags:
        - Payins
      summary: Refund payin
      description: >
        Issues a partial or full refund for a confirmed payin. Only supported
        payment methods can be refunded.

        For bank wire payins, a `bankaccount_id` is required to specify the
        refund destination.
      operationId: refundPayin
      parameters:
        - $ref: '#/components/parameters/PayinId'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              example:
                amount: 2
                multipayin: 0
              properties:
                amount:
                  type: number
                  minimum: 0
                  description: Amount to refund. Defaults to full amount if not provided.
                multipayin:
                  type: integer
                  enum:
                    - 0
                    - 1
                  description: >-
                    Set to `1` to refund all payins associated with the order of
                    this payin.
                bankaccount_id:
                  type: integer
                  description: >-
                    Required if the payin is of Bankwire type. Bank account ID
                    to receive the refund.
                tag:
                  type: string
                  maxLength: 100
                metadata:
                  type: object
                  additionalProperties: true
      responses:
        '200':
          description: Payin with refund details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Payin'
        '403':
          description: Refunds not supported for this payment method
        '422':
          $ref: '#/components/responses/ValidationError'
components:
  parameters:
    PayinId:
      name: id
      in: path
      required: true
      schema:
        type: integer
      description: Payin ID.
  schemas:
    Payin:
      type: object
      properties:
        id:
          type: integer
        self:
          type: string
          example: /2.0/payins/456
        reference:
          type: string
          nullable: true
          description: Provider's payment reference ID.
        type:
          type: string
          description: Payment method type (e.g. `CARD`, `BANKWIRE`, `WALLET`).
        subtype:
          type: string
          nullable: true
        status:
          type: string
          enum:
            - CREATED
            - AUTHORIZED
            - CONFIRMED
            - DENIED
            - REFUNDED
            - CANCELLED
        provider:
          type: object
          additionalProperties: true
          description: Raw provider response data.
        tag:
          type: string
          nullable: true
        direct_link:
          type: string
          format: uri
          nullable: true
          description: >-
            Payment page URL. Only present when status is `CREATED` or
            `AUTHORIZED`.
        created_at:
          type: string
          format: date-time
          nullable: true
        confirmed_at:
          type: string
          format: date-time
          nullable: true
        denied_at:
          type: string
          format: date-time
          nullable: true
        connections:
          $ref: '#/components/schemas/Connections'
    Connections:
      type: object
      description: Hypermedia links to related resources.
      additionalProperties:
        type: string
  responses:
    ValidationError:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                example: The given data was invalid.
              errors:
                type: object
                additionalProperties:
                  type: array
                  items:
                    type: string
                example:
                  name:
                    - The name field is required.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Use your account's **Secret Key** as the Bearer token.

````