๐ Problem Statement
Billing and operations administrators managing complex recurring revenue models (usage-based, step-up, hybrid, or exception-based pricing) face significant challenges configuring and maintaining plans in the Pelcro platform.
๐ก User Stories
As a Product or Billing Admin, I want to define billing logic in natural language (e.g., โbill $5 for the first month and increase by $1 per monthโ), so that I can launch and maintain complex billing plans.
๐ฏ Definition of Done (DoD)
1. AI Plan Creation (UI)
Admin can select โAI Planโ during plan setup.
Required field: Plan Prompt (natural language billing rule).
Usage DB selector defaults to shipment table with predefined queries.
Available only to abstracted accounts.
*2. Billing Agent Invocation
At the time of subscription creation, the Billing Agent (via OpenAI API) determines whether to create an invoice immediately or defer the first invoice until renewal.
Send the AI Prompt + Usage data from shipments
if AI billing plan, use period end for invoice creation.
For standard or step-up pricing plans, the first invoice is created at subscription start.
For usage-based or hybrid plans, the first invoice is generated upon renewal, covering usage from the previous billing period.
The Billing Agent returns a structured JSON payload containing subscription updates and invoice details:
{ "subscription_updates": { "current_period_start": "ISO-8601", "current_period_end": "ISO-8601" }, "invoice": { "amount": 10, "currency": "USD", "start_date": "ISO-8601", "end_date": "ISO-8601" "line_items": [ {"description": "Base charge", "amount": 5}, {"description": "Usage (Shipment) charge", "amount": 5}, ] } }
3. Shipment Data Retrieval
Billing Agent queries the shipment and returns tables via predefined SQL templates.
Usage data is aggregated (sum per day of week) and fed into AI with the prompt for rate computation.
4. Subscription quantity field must be modifiable from the subscription update flow on the platform without requiring a renewal.
4. Open API & JS SDK
AI Plans are exposed via the same API structure as standard plans.
5. Accounting
For PoC, all invoices should have time-based revenue recognition.
6. Taxes
Taxes must be collected on the final invoice amount that gets generated by the billing agent.
7. Logs
All actions, data inputs, AI responses, and results are logged to OpenSearch.
Please authenticate to join the conversation.
Done
Pelcro Product
Accounting
4 months ago

Rana Haleem
Get notified by email when there are changes.
Done
Pelcro Product
Accounting
4 months ago

Rana Haleem
Get notified by email when there are changes.