Billing issue type

Sort a SaaS billing message into unrecognized charge, duplicate charge, plan question, failed payment or cancellation.

F@f

Problem

"Billing" is one queue in most support tools, but a failed card, an unknown charge and a cancellation need different people, different urgency and different tools.

Goal

Send each billing message to the flow that can resolve it, and keep possible fraud apart from routine questions.

Input / state

The customer's message and account facts from your billing system.

message
The customer's message.
account
Plan, seat count, recent invoices and status, looked up in code.

Decision question

ChoiceQuestion key billing_issue

What billing issue is the customer raising?

Options

  • unrecognized_chargeA charge the customer doesn't recognize or didn't authorize.
  • duplicate_or_post_cancel_chargeCharged twice, or charged after they cancelled.
  • plan_or_price_questionA question about plans, prices, seats, proration or an invoice amount.
  • failed_paymentTheir payment failed or their card was declined.
  • cancellation_requestWants to cancel the subscription or stop renewal.

Allowed outcomes

Decided in your code from the answer and its confidence. Thresholds are yours to set and test.

  • Unrecognized chargeChoice is unrecognized_charge and confidence meets your threshold.
  • Duplicate or post-cancel chargeChoice is duplicate_or_post_cancel_charge and confidence meets your threshold.
  • Plan or price questionChoice is plan_or_price_question and confidence meets your threshold.
  • Failed paymentChoice is failed_payment and confidence meets your threshold.
  • CancellationChoice is cancellation_request and confidence meets your threshold.
  • Billing agentConfidence is below your threshold: probability is spread across options.

Example scenarios

Predefined demonstrations. No model is called; the outcome shown is an illustrative judgment.

Example state

{
  "account": {
    "plan": "Team (monthly)",
    "seats": 8,
    "status": "active",
    "last_invoice": "2026-03-01"
  },
  "message": "There's a $49 charge from you on our card and nobody here signed up for anything."
}

Outcome

Illustrative
Unrecognized charge

Choice is unrecognized_charge and confidence meets your threshold.

Why

The customer doesn't recognize the charge.

Using it well

  • Check charge amounts and dates in code against the billing system. The model reads the message; it shouldn't do the arithmetic.
  • An unrecognized charge may mean someone else used the account. Check for that before treating it as a pricing question.

Request definition

POST https://api.typesafe.ai/v1/systemone
{
  "model": "jev-latest",
  "state": {
    "message": "<message>",
    "account": "<account>"
  },
  "questions": {
    "billing_issue": {
      "type": "choice",
      "instructions": "What billing issue is the customer raising?",
      "criteria": {
        "unrecognized_charge": "A charge the customer doesn't recognize or didn't authorize.",
        "duplicate_or_post_cancel_charge": "Charged twice, or charged after they cancelled.",
        "plan_or_price_question": "A question about plans, prices, seats, proration or an invoice amount.",
        "failed_payment": "Their payment failed or their card was declined.",
        "cancellation_request": "Wants to cancel the subscription or stop renewal."
      }
    }
  }
}

Request shape from the System One API reference; a Kev server accepts the same body. Replace the placeholder state with your data. Requests need your own API key or server.

Version History

v1Current Versionabout 8 hours ago@f

Initial version

Comments (0)