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

# Debit a wallet

> Removes funds and records double-entry ledger entries. Returns 402 if balance is insufficient.



## OpenAPI

````yaml /api-reference/public-openapi.yaml post /v1/wallets/{wallet_id}/debit
openapi: 3.0.3
info:
  contact: {}
  description: Usage-based billing and metering API for Monigo.
  title: Monigo Public API
  version: '1.0'
servers:
  - url: https://api.monigo.co
security: []
paths:
  /v1/wallets/{wallet_id}/debit:
    post:
      tags:
        - wallets
      summary: Debit a wallet
      description: >-
        Removes funds and records double-entry ledger entries. Returns 402 if
        balance is insufficient.
      parameters:
        - name: wallet_id
          in: path
          description: Wallet UUID
          required: true
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/handlers.DebitWalletRequest'
        description: Debit details
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                additionalProperties: true
                type: object
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '402':
          description: Payment Required
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
      security:
        - ApiKeyAuth: []
components:
  schemas:
    handlers.DebitWalletRequest:
      properties:
        amount:
          type: string
        currency:
          type: string
        description:
          type: string
        entry_type:
          type: string
        idempotency_key:
          type: string
        metadata:
          items:
            type: integer
          type: array
        reference_id:
          type: string
        reference_type:
          type: string
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API key with Bearer prefix (for programmatic/server-to-server access),
        format: Bearer {api_key}
      in: header
      name: Authorization
      type: apiKey

````