> ## 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.

# Process a payment

> Processes a payment against an invoice. Supports idempotency keys to prevent duplicate charges.



## OpenAPI

````yaml post /v1/payments
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/payments:
    post:
      tags:
        - Payments
      summary: Process a payment
      description: >-
        Processes a payment against an invoice. Supports idempotency keys to
        prevent duplicate charges.
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                invoiceId:
                  type: string
                  minLength: 1
                amount:
                  type: number
                  minimum: 0
                  exclusiveMinimum: true
                method:
                  type: string
                  minLength: 1
                idempotencyKey:
                  type: string
              required:
                - invoiceId
                - amount
                - method
      responses:
        '201':
          description: Payment processed
          content:
            application/json:
              schema:
                nullable: true
        '400':
          description: Validation error
        '409':
          description: Idempotency conflict

````