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

# Refund deposit

> Refund a successful mobile money deposit.



## OpenAPI

````yaml POST /api/b2b/fiat/deposit/{transactionId}/refund
openapi: 3.1.0
info:
  title: Tanda API
  version: 1.0.0
  description: >-
    Collect and send KES payments in Kenya through M-PESA, Airtel Money and bank
    transfer.
servers:
  - url: https://api.tandapay.io
    description: Sandbox and production (your keys decide which)
security:
  - bearerAuth: []
tags:
  - name: Authentication
  - name: Account
  - name: Checkout
  - name: Collections
  - name: Payouts
  - name: Beneficiaries
  - name: Transactions
  - name: Reference data
  - name: Webhooks
paths:
  /api/b2b/fiat/deposit/{transactionId}/refund:
    post:
      tags:
        - Collections
      summary: Refund deposit
      description: >-
        Refunds a successful mobile money deposit to the customer's wallet. The
        refund is a new transaction with its own ID; its outcome arrives as a
        `transaction_updated` webhook with `type: "refund"`.
      operationId: refund-deposit
      parameters:
        - name: transactionId
          in: path
          required: true
          description: The `transactionId` of the successful deposit.
          schema:
            type: string
          example: aB3dE5fG7hJ9kL1mN2pQ
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                refundReason:
                  type: string
                  description: Why you're refunding.
                  example: Order cancelled by customer
                externalReference:
                  type: string
                  description: Your unique ID for the refund.
                  example: refund_order_10045
              required:
                - refundReason
                - externalReference
            example:
              refundReason: Order cancelled by customer
              externalReference: refund_order_10045
      responses:
        '200':
          description: Refund initiated.
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      refundTransactionId:
                        type: string
                      originalTransactionId:
                        type: string
              example:
                success: true
                message: Transaction refund initiated successfully.
                data:
                  refundTransactionId: rF4gH6jK8lM0nP2qR4sT
                  originalTransactionId: aB3dE5fG7hJ9kL1mN2pQ
        '401':
          description: Missing, invalid or expired bearer token.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                success: false
                message: Unauthorized
components:
  schemas:
    Error:
      type: object
      properties:
        success:
          type: boolean
          example: false
        message:
          type: string
          description: Human-readable; may change.
        errorCode:
          type: string
          description: Stable code to branch on.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Token from Generate bearer token.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.