Skip to main content

Billing Services

The Billing Services provide comprehensive financial management capabilities including payment processing, subscription management, credit operations, and billing analytics for the VChata platform.

Overview

The Billing Services layer includes:
  • 💳 Billing Service - Core billing operations and organization setup
  • 💰 Balance Service - Credit balance management and operations
  • 🏦 Stripe Service - Payment processing and Stripe integration
  • 💳 Credit Service - Credit purchasing and consumption tracking
  • 🧾 Invoice Service - Invoice generation and management
  • 📊 Message Usage Service - Usage tracking and billing calculations

Billing Service

Organization Billing Setup

The Billing Service handles the complete billing infrastructure setup for organizations.

Setup Billing

Add Payment Method

Create Subscription

Available Methods

Balance Service

Credit Balance Management

The Balance Service handles all credit balance operations and calculations.

Get Balance

Update Balance

Consume Credits

Balance Operations

Stripe Service

Payment Processing Integration

The Stripe Service handles all Stripe API interactions and payment processing.

Create Customer

Create Payment Intent

Handle Webhook

Stripe Operations

Credit Service

Credit Operations

The Credit Service handles credit purchasing, consumption tracking, and auto-refill operations.

Purchase Credits

Track Usage

Configure Auto-Refill

Credit Operations

Invoice Service

Invoice Management

The Invoice Service handles invoice generation, management, and retrieval.

Generate Invoice

Get Invoice

List Invoices

Invoice Operations

Message Usage Service

Usage Tracking

The Message Usage Service tracks message usage and calculates billing costs.

Track Message

Get Usage Stats

Calculate Costs

Usage Operations

Integration Examples

Complete Billing Setup Flow

Credit Purchase Flow

Usage Tracking Flow

Error Handling

Common Error Scenarios

Monitoring and Analytics

Billing Metrics

Usage Analytics

Security Considerations

Payment Security

Data Protection