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

# Credit Wallet

> Credits funds to a specified user sub-wallet, adding money to their available balance. Supports various sub-wallet types with behaviour determined by wallet configuration.




## OpenAPI

````yaml /openapi/ppi/ppi.yaml post /ppi/wallet/credit
openapi: 3.0.3
info:
  title: PPI Wallet API
  description: >-
    API for managing PPI (Prepaid Payment Instrument) wallets and sub-wallets,
    including credit and debit operations.
  version: 1.0.0
  contact:
    name: PPI Service Team
    email: support@cashfree.com
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0
servers:
  - url: https://api.cashfree.com
    description: Production server.
  - url: https://sandbox.cashfree.com
    description: Sandbox server.
security:
  - XClientID: []
    XClientSecret: []
tags:
  - name: Wallet Management
    description: Operations related to PPI wallet management.
  - name: User Management
    description: Operations related to user management within the PPI system.
  - name: Beneficiary Management
    description: Operations related to beneficiary management for users.
  - name: KYC Management
    description: Operations related to KYC (Know Your Customer) management.
  - name: Transfers
    description: Operations related to transfer.
paths:
  /ppi/wallet/credit:
    post:
      tags:
        - Wallet Management
      summary: Credit Wallet
      description: >
        Credits funds to a specified user sub-wallet, adding money to their
        available balance. Supports various sub-wallet types with behaviour
        determined by wallet configuration.
      operationId: creditWallet
      parameters:
        - $ref: '#/components/parameters/global_x_api_version'
      requestBody:
        description: Request parameters to credit funds to a user's sub-wallet.
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreditRequest'
            examples:
              creditTransaction:
                summary: Credit transaction example
                description: Example of crediting funds to a user's sub-wallet.
                value:
                  credit_id: CREDIT126345
                  user_id: USER827364
                  wallet_id: WALLET936721
                  cf_sub_wallet_id: '35246543210987654321'
                  amount: 100.5
                  remarks: Refund for order 123
                  notes:
                    example_key1: example_value1
                    example_key2: example_value2
      responses:
        '200':
          description: Success response for crediting a wallet.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreditResponse'
              examples:
                SUCCESS_GIFT_WALLET:
                  summary: Successful credit to GIFT_WALLET
                  value:
                    credit_id: CREDIT126345
                    cf_credit_id: '8901234567890123456'
                    wallet_id: WALLET936721
                    user_id: USER827364
                    amount: 100.5
                    sub_wallet:
                      cf_sub_wallet_id: '35246543210987654321'
                      name: Gift Wallet
                      type: GIFT_PPI
                      status: ACTIVE
                      balance: 1500.75
                      available_balance: 1500.75
                      funds_on_hold: 0
                    issued_gift_code:
                      code: GIFT-2025-XYZ123
                      value: 100.5
                      expiry: '2025-12-31T23:59:59Z'
                    status: SUCCESS
                    remarks: Refund for order 123
                    initiated_at: '2025-09-02T10:15:30Z'
                    processed_at: '2025-09-02T10:20:45Z'
                    notes:
                      example_key1: example_value1
                      example_key2: example_value2
                SUCCESS_CLOSED_WALLET:
                  summary: Successful credit to CLOSED_WALLET
                  value:
                    credit_id: CREDIT126345
                    cf_credit_id: '8901234567890123456'
                    wallet_id: WALLET936721
                    user_id: USER827364
                    amount: 100.5
                    sub_wallet:
                      cf_sub_wallet_id: '35246543210987654321'
                      name: Closed Wallet
                      type: CLOSED_LOOP_PPI
                      status: ACTIVE
                      balance: 1500.75
                      available_balance: 1500.75
                      funds_on_hold: 0
                    status: SUCCESS
                    remarks: Refund for order 123
                    initiated_at: '2025-09-02T10:15:30Z'
                    processed_at: '2025-09-02T10:20:45Z'
                    notes:
                      example_key1: example_value1
                      example_key2: example_value2
                SUCCESS_SMALL_PPI_WALLET:
                  summary: Successful credit to SMALL_PPI_WALLET
                  value:
                    credit_id: CREDIT126345
                    cf_credit_id: '8901234567890123456'
                    wallet_id: WALLET936721
                    user_id: USER827364
                    amount: 100.5
                    sub_wallet:
                      cf_sub_wallet_id: '35246543210987654321'
                      name: Small PPI Wallet
                      type: SMALL_PPI
                      status: ACTIVE
                      balance: 1500.75
                      available_balance: 1500.75
                      funds_on_hold: 0
                    status: SUCCESS
                    remarks: Refund for order 123
                    initiated_at: '2025-09-02T10:15:30Z'
                    processed_at: '2025-09-02T10:20:45Z'
                    notes:
                      example_key1: example_value1
                      example_key2: example_value2
        '400':
          description: Bad request - Invalid input parameters.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                credit_id_missing:
                  $ref: '#/components/examples/credit_id_missing'
                auth_mode_missing:
                  $ref: '#/components/examples/auth_mode_missing'
                auth_mode_invalid:
                  $ref: '#/components/examples/auth_mode_invalid'
                auth_data_missing:
                  $ref: '#/components/examples/auth_data_missing'
                auth_notification_modes_missing:
                  $ref: '#/components/examples/auth_notification_modes_missing'
                auth_notification_modes_too_many:
                  $ref: '#/components/examples/auth_notification_modes_too_many'
                auth_notification_modes_null:
                  $ref: '#/components/examples/auth_notification_modes_null'
                auth_notification_modes_duplicate:
                  $ref: '#/components/examples/auth_notification_modes_duplicate'
                user_id_missing:
                  summary: User ID missing
                  value:
                    code: user_id_missing
                    type: validation_error
                    message: user_id is missing in the request
                userWalletMismatch:
                  summary: User-Wallet mismatch
                  value:
                    message: wallet does not belong to provided user
                    code: wallet_id_value_invalid
                    type: validation_error
                userSubWalletMismatch:
                  summary: User-SubWallet mismatch
                  value:
                    message: sub-wallet does not belong to provided user
                    code: sub_wallet_id_value_invalid
                    type: validation_error
                sub_wallet_id_invalid:
                  summary: Sub-wallet ID is Invalid
                  value:
                    code: sub_wallet_id_invalid
                    type: validation_error
                    message: cf_sub_wallet_id is invalid in the request
                credit_id_value_missing:
                  summary: Credit ID value is invalid
                  value:
                    code: credit_id_value_invalid
                    type: validation_error
                    message: credit_id value is invalid in the request
                sub_wallet_id_missing:
                  summary: Sub-wallet ID missing
                  value:
                    code: sub_wallet_id_missing
                    type: validation_error
                    message: cf_sub_wallet_id is missing in the request
                amountMissing:
                  summary: Amount missing
                  value:
                    code: amount_missing
                    type: validation_error
                    message: amount is missing in the request
                invalidAmount:
                  summary: Invalid amount format
                  value:
                    code: amount_value_invalid
                    type: validation_error
                    message: amount should be a positive number
                missingClientId:
                  summary: Missing client ID
                  value:
                    message: x-client-id is missing in the request
                    code: x-client-id_missing
                    type: validation_error
                missingClientSecret:
                  summary: Missing client secret
                  value:
                    message: x-client-secret is missing in the request
                    code: x-client-secret_missing
                    type: validation_error
                maximumNotesExceeded:
                  summary: Maximum notes limit exceeded
                  value:
                    message: Maximum 10 notes entries allowed
                    code: notes_value_invalid
                    type: validation_error
                notesValueInvalidLength:
                  summary: Note value length exceeds limit
                  value:
                    message: Note value must be 200 characters or less
                    code: notes_value_invalid
                    type: validation_error
                notesKeyInvalidLength:
                  summary: Note key length exceeds limit
                  value:
                    message: Note Key must be 50 characters or less
                    code: notes_value_invalid
                    type: validation_error
        '401':
          $ref: '#/components/responses/Response401'
        '402':
          description: Payment Required - Insufficient funds in user's account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                insufficientFunds:
                  summary: Insufficient funds in user's account
                  value:
                    code: insufficient_balance
                    type: validation_error
                    message: >-
                      Insufficient balance in user's account to process this
                      credit
        '403':
          description: Forbidden - Access denied.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                ipNotWhitelisted:
                  summary: IP not whitelisted
                  value:
                    code: ip_not_whitelisted
                    type: authentication_error
                    message: Authentication error (IP not whitelisted)
        '404':
          description: Not found - Wallet or sub-wallet not found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                walletNotFound:
                  summary: Wallet not found
                  value:
                    code: wallet_id_not_found
                    type: invalid_request_error
                    message: The specified wallet_id does not exist
                subWalletNotFound:
                  summary: Sub-wallet not found
                  value:
                    code: sub_wallet_id_not_found
                    type: invalid_request_error
                    message: The specified cf_sub_wallet_id does not exist
        '409':
          description: Conflict - Transaction already processed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                duplicateTransaction:
                  summary: Duplicate transaction
                  value:
                    code: credit_id_already_exists
                    type: validation_error
                    message: >-
                      Transaction with the same credit_id has already been
                      processed
        '422':
          description: Unprocessable Entity - Business rule validation failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                dailyMaxCreditCountLimitExceeded:
                  summary: Daily credit count limit exceeded
                  value:
                    code: daily_max_credit_count_limit_exceeded
                    type: validation_error
                    message: daily credit count cannot exceed 3 for Gift ppi
                monthlyMaxCreditCountLimitExceeded:
                  summary: Monthly credit count limit exceeded
                  value:
                    code: monthly_max_credit_count_limit_exceeded
                    type: validation_error
                    message: monthly credit count cannot exceed 20 for Gift ppi
                yearlyMaxCreditCountLimitExceeded:
                  summary: Yearly credit count limit exceeded
                  value:
                    code: yearly_max_credit_count_limit_exceeded
                    type: validation_error
                    message: yearly credit count cannot exceed 100 for Gift ppi
                dailyMaxCreditAmountLimitExceeded:
                  summary: Daily total credit amount limit exceeded
                  value:
                    code: daily_max_credit_amount_limit_exceeded
                    type: validation_error
                    message: >-
                      daily total credit amount cannot exceed ₹10,000.00 for
                      Small ppi
                monthlyMaxCreditAmountLimitExceeded:
                  summary: Monthly total credit amount limit exceeded
                  value:
                    code: monthly_max_credit_amount_limit_exceeded
                    type: validation_error
                    message: >-
                      monthly total credit amount cannot exceed ₹10,000.00 for
                      Small ppi
                yearlyMaxCreditAmountLimitExceeded:
                  summary: Yearly total credit amount limit exceeded
                  value:
                    code: yearly_max_credit_amount_limit_exceeded
                    type: validation_error
                    message: >-
                      yearly total credit amount cannot exceed ₹1,20,000.00 for
                      Small ppi
                maxBalanceLimitExceeded:
                  summary: Max balance limit exceeded
                  value:
                    code: max_balance_limit_exceeded
                    type: validation_error
                    message: max balance cannot exceed ₹1,00,000.00 for Gift ppi
                maxPerCreditLimitExceeded:
                  summary: Per credit amount limit exceeded
                  value:
                    code: max_per_credit_limit_exceeded
                    type: validation_error
                    message: per credit amount cannot exceed ₹10,000.00 for Gift ppi
        '429':
          description: Too Many Requests - Rate limit exceeded.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StructuredErrorResponse'
              examples:
                rateLimitExceeded:
                  summary: Rate limit exceeded
                  value:
                    code: rate_limit_exceeded
                    type: rate_limit_error
                    message: Rate limit exceeded. Please try again after some time
        '500':
          $ref: '#/components/responses/Response500'
components:
  parameters:
    global_x_api_version:
      description: API version to be used. Format is in YYYY-MM-DD.
      name: x-api-version
      in: header
      required: true
      schema:
        type: string
        default: '2025-11-01'
        example: '2025-11-01'
      example: '2025-11-01'
  schemas:
    CreditRequest:
      type: object
      required:
        - credit_id
        - user_id
        - wallet_id
        - cf_sub_wallet_id
        - amount
      properties:
        credit_id:
          type: string
          description: >-
            Unique identifier that you create to identify the credit transaction
            in your system. Maximum 100 characters. Only alphanumeric
            characters, periods (.), hyphens (-), and underscores (_) are
            allowed.
          example: CREDIT126345
        user_id:
          type: string
          description: >-
            Unique identifier for the user, as provided by you during PPI user
            creation.
          example: USER827364
        wallet_id:
          type: string
          description: >-
            Unique identifier for the wallet, as provided by you during wallet
            creation.
          example: WALLET936721
        cf_sub_wallet_id:
          type: string
          description: >-
            Unique identifier of the sub-wallet to which the amount will be
            credited.
          example: '35246543210987654321'
        amount:
          type: number
          format: double
          description: >-
            Amount to credit. Decimal values are allowed. The minimum value
            should be equal to or greater than 1.00 (>= 1.00).
          example: 100.5
        remarks:
          type: string
          description: >-
            Alphanumeric and whitespaces are allowed. The maximum character
            limit is 60.
          example: 'Refund for order #123'
        notes:
          $ref: '#/components/schemas/Notes'
    CreditResponse:
      type: object
      properties:
        credit_id:
          type: string
          description: >-
            Unique identifier for the credit transaction, as provided by you
            during the credit request.
          example: CREDIT126345
        cf_credit_id:
          type: string
          description: Unique identifier for the credit transaction, generated by Cashfree.
          example: '8901234567890123456'
        wallet_id:
          type: string
          description: >-
            Unique identifier for the wallet, as provided by you during wallet
            creation.
          example: WALLET936721
        user_id:
          type: string
          description: >-
            Unique identifier for the user, as provided by you during PPI user
            creation.
          example: USER827364
        amount:
          type: number
          format: double
          description: Amount that was credited.
          example: 100.5
        sub_wallet:
          $ref: '#/components/schemas/SubWallet'
        issued_gift_code:
          $ref: '#/components/schemas/IssuedGiftCode'
        status:
          type: string
          description: Status of the credit operation.
          example: SUCCESS
        remarks:
          type: string
          description: Remarks for the credit transaction.
          example: Refund for order 123
        initiated_at:
          type: string
          format: date-time
          description: Timestamp when the credit transaction was initiated.
          example: '2025-09-02T10:15:30Z'
        processed_at:
          type: string
          format: date-time
          description: Timestamp when the credit transaction was processed.
          example: '2025-09-02T10:20:45Z'
        notes:
          $ref: '#/components/schemas/Notes'
    StructuredErrorResponse:
      type: object
      properties:
        type:
          type: string
          description: A broad category of the error.
          example: internal_error
        code:
          type: string
          description: A machine-readable error code specific to the issue.
          example: internal_server_error
        message:
          type: string
          description: >-
            A message providing more details about the error, dynamic based on
            the specific issue.
          example: Internal server error
    Notes:
      type: object
      description: >-
        Optional key-value pairs for any extra information. Keys and values must
        be strings.
      properties:
        example_key:
          type: string
          description: value of the note
          example: example_value
    SubWallet:
      type: object
      properties:
        cf_sub_wallet_id:
          type: string
          description: >-
            Unique identifier for the sub-wallet provided in response while
            creating the wallet.
          example: '5432109876543210987'
        name:
          type: string
          description: Name for the sub-wallet.
          example: Gift Wallet
        type:
          type: string
          description: Type of the sub-wallet.
          example: GIFT_PPI
        status:
          type: string
          description: Status of the sub-wallet.
          example: ACTIVE
        balance:
          type: number
          format: double
          description: Current balance of the sub-wallet.
          example: 1500.75
        available_balance:
          type: number
          format: double
          description: Available balance in the sub-wallet.
          example: 1500.75
        funds_on_hold:
          type: number
          format: double
          description: Funds on hold in the sub-wallet.
          example: 0
    IssuedGiftCode:
      type: object
      properties:
        code:
          type: string
          description: >-
            Unique identifier for the gift code as provided in response  during
            sub-wallet credit.
          example: GIFT-2025-XYZ123
        value:
          type: number
          format: double
          description: Value of the gift code.
          example: 100.5
        expiry:
          type: string
          format: date-time
          description: Expiry date of the gift code.
          example: '2026-12-31T23:59:59Z'
  examples:
    credit_id_missing:
      summary: Credit ID missing
      value:
        code: credit_id_missing
        type: validation_error
        message: credit_id is missing in the request
    auth_mode_missing:
      summary: auth.mode missing
      value:
        code: auth_mode_missing
        type: validation_error
        message: auth.mode is required
    auth_mode_invalid:
      summary: auth.mode invalid
      value:
        code: auth_mode_invalid
        type: validation_error
        message: only OTP_VERIFICATION mode is supported
    auth_data_missing:
      summary: auth.data missing for OTP_VERIFICATION
      value:
        code: auth_data_missing
        type: validation_error
        message: auth.data is required for OTP_VERIFICATION
    auth_notification_modes_missing:
      summary: auth.data.notification_modes missing or empty
      value:
        code: auth_notification_modes_missing
        type: validation_error
        message: >-
          auth.data.notification_modes must contain at least one channel for
          OTP_VERIFICATION
    auth_notification_modes_too_many:
      summary: auth.data.notification_modes too many entries
      value:
        code: auth_notification_modes_too_many
        type: validation_error
        message: auth.data.notification_modes must contain at most 5 entries
    auth_notification_modes_null:
      summary: auth.data.notification_modes contains null
      value:
        code: auth_notification_modes_null
        type: validation_error
        message: auth.data.notification_modes cannot contain null entries
    auth_notification_modes_duplicate:
      summary: auth.data.notification_modes contains duplicates
      value:
        code: auth_notification_modes_duplicate
        type: validation_error
        message: auth.data.notification_modes must not contain duplicates
  responses:
    Response401:
      description: Unauthorised - Invalid or missing authentication.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StructuredErrorResponse'
          examples:
            invalidCredentials:
              summary: Invalid client credentials
              value:
                code: authentication_failed
                type: authentication_error
                message: Invalid client ID and client secret combination
    Response500:
      description: Internal server error.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/StructuredErrorResponse'
          examples:
            internalError:
              summary: Internal server error
              value:
                code: internal_server_error
                type: internal_error
                message: An internal error occurred while processing the request
  securitySchemes:
    XClientID:
      type: apiKey
      in: header
      name: x-client-id
      description: >-
        Your unique client identifier issued by Cashfree. You can find this in
        your [Merchant
        Dashboard](https://merchant.cashfree.com/merchants/landing?env=prod).
    XClientSecret:
      type: apiKey
      in: header
      name: x-client-secret
      description: >-
        The secret key associated with your client ID. Use this to authenticate
        your API requests. You can find this in your [Merchant
        Dashboard](https://merchant.cashfree.com/merchants/landing?env=prod).

````