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

# Debit a wallet

> Withdraws funds from a customer wallet. Fails if insufficient balance.



## OpenAPI

````yaml post /v1/wallets/{walletId}/debit
openapi: 3.0.0
info:
  title: Revstack API
  version: 1.0.0
  description: >-
    Open Source Billing OS for Developers. The scalable, developer-first billing
    engine with subscriptions, invoicing, usage metering, and entitlements.
servers:
  - url: http://localhost:6900
    description: Revstack API (Local Development)
security: []
paths:
  /v1/wallets/{walletId}/debit:
    post:
      tags:
        - Wallets
      summary: Debit a wallet
      description: Withdraws funds from a customer wallet. Fails if insufficient balance.
      parameters:
        - schema:
            type: string
            example: wal_abc123
          required: true
          name: walletId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                amount:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                referenceId:
                  type: string
              required:
                - amount
      responses:
        '201':
          description: Wallet debited
          content:
            application/json:
              schema:
                nullable: true
        '400':
          description: Insufficient balance or validation error

````