Pay fines and fees through AI chat

Workflow purpose

This guide demonstrates how to use Proto's AI agent to let citizens find and pay what they owe a public body – traffic fines, parking penalties, licence fees or municipal charges – without visiting an office or searching a payments portal.

The workflow looks up outstanding fines and fees by notice number, ID number or vehicle registration, lists them with their amounts and due dates, and lets the person choose what to pay. The AI agent sends a secure payment link from your own payment gateway – no card or account details are ever entered in the chat – then confirms the payment with the gateway when the person returns and sends the official receipt as a document. People who want to dispute a fine or pay in instalments are sent to the right team as a ticket instead.

Unpaid fines often grow because paying is harder than it should be – an unclear amount, a portal that's hard to find, or a counter with limited hours. Bringing the balance, the link and the receipt into one conversation removes most of that friction.

Who can benefit from this guide:

  • Traffic and road safety authorities
  • Municipalities collecting parking fines, rates and service charges
  • Licensing and permit offices
  • Courts and justice ministries collecting fines
  • Revenue agencies collecting penalties and fees

Fines and fees payment

This workflow finds outstanding fines and fees, sends a payment link and issues receipts 24/7. See how to build a fines payment workflow.

Just starting with the platform?
For initial setup of your AI agent – including workspace setup, agent training, and channel deployment – please start here. This workflow guide assumes your AI agent is set up and ready for more advanced configurations.

1. Create a trigger

Start the flow when a person asks about a fine or fee they owe.

  • Navigate to the Workflows tab in the AI agent settings.
  • Click New workflow and select Message received as the Workflow type.
  • Name the trigger (e.g. “Fines and Fees”) and add a short description (e.g. “Triggers if user wants to check or pay a fine, penalty, parking ticket, licence fee or municipal charge, or wants to dispute a fine or pay in instalments.”).
  • Add training phrases (e.g. “Pay my traffic fine”, “Do I have any fines”, “I got a parking ticket”, “How much do I owe”, “I want to dispute my fine”).

2. Look up what the person owes

People rarely have every reference to hand, so let them search the way that suits them.

Add a Send message action:

“I can find your outstanding fines and fees. How would you like to search?”

Add quick reply options: Notice number | ID number | Vehicle registration. Under each Message received sub-trigger, add a Set variable action that stores lookup_type (e.g. notice, id, vehicle), then an Ask survey action. Action title: Fine lookup

Field Variable Type Invalid reply
Enter the number lookup_value Text Please enter the number exactly as it appears on your notice or document

Then add a Send API action:

  • HTTP method: GET
  • URL endpoint: your fines and revenue system’s lookup endpoint, passing lookup_type and lookup_value
  • Headers: the authorisation key your system requires
  • Resulting variable: fines

A vehicle registration or notice number doesn’t prove who the person is, so have your system return only what’s printed on a notice – reference, offence or charge, date, amount and due date – and never names, addresses or other personal details.

Under Error and Timed out, add a Send message saying the service isn’t available right now and giving your payments portal as an alternative.

3. List the outstanding items

Show the person exactly what they owe and what happens if they wait.

Under Success, add a Branch action:

  • If _.len(fines["items"]) == 0: Send message – “There are no outstanding fines or fees for {lookup_value}. If you’ve received a notice recently, it can take a few days to appear.” End with quick reply options Search again | That’s all.
  • Else: continue below.

Messages can’t loop through a list, so have your system return a ready-made summary with one line per item, alongside the structured data. Add a Send message:

“I found {fines[“count”]} outstanding item(s):

{fines[“summary”]}

Total: {fines[“total”]}“

Each summary line should read like Notice TF-20418 – speeding – 12 Oct – 1,500 – due 11 Nov – increases to 3,000 after the due date. Items that are under dispute, already in court or already paid but not yet cleared should be shown with that status and left out of the total, so nobody pays for something that’s on hold.

4. Choose what to pay

Add a Send message with quick reply options: Pay everything | Pay one item | Dispute a fine | Pay in instalments, and a Message received sub-trigger for each.

  • Under Pay everything, add a Set variable action that stores pay_refs as fines["payable_refs"].
  • Under Pay one item, add an Ask survey with a Text field for the notice number (pay_refs), then a Branch that checks it is in fines["payable_refs"]. If it isn’t, send a Send message listing the payable references and ask again.

Payments are never taken inside the chat – the AI agent hands over a secure link from your own payment provider.

Add a Send API action:

  • HTTP method: POST
  • URL endpoint: your payment service’s endpoint for creating a checkout or payment request
  • Body: pay_refs only – your system works out the amount from its own records, so it can’t be changed in the chat
  • Resulting variable: payment

Your payment service returns a checkout link, a payment ID, the amount and an expiry time. Then add a Show carousel action with one card:

  • Title: Pay {payment["amount"]}
  • Subtitle: {pay_refs} – link valid until {payment["expires_at"]}
  • Button: type Open Link, text “Pay securely”, link {payment["checkout_url"]}

The person pays on your gateway’s page – by card, mobile money or bank transfer, whatever your provider supports – and their payment details never pass through the conversation. Follow the carousel with a Send message:

“Tap Pay securely to complete your payment. When you’ve finished, come back here and tap I’ve paid, and I’ll send your receipt.”

Add quick reply options: I’ve paid | I need help.

6. Confirm the payment

Check with the gateway rather than taking the person’s word for it.

Under the I’ve paid sub-trigger, add a Send API action (HTTP method: GET) to your payment service’s status endpoint, passing payment["id"], with the resulting variable payment_status. Then add a Branch action:

Condition Send message
payment_status["status"] == "paid" “Thank you – your payment of {payment[“amount”]} for {pay_refs} has been received.“ Continues to Step 7
payment_status["status"] == "pending" “Your payment is still being processed. This can take a few minutes – tap Check again shortly.”
payment_status["status"] == "failed" “Your payment didn’t go through and you haven’t been charged. Would you like a new link?”
payment_status["status"] == "expired" “That payment link has expired. I’ll create a new one for you.”
Else “I couldn’t confirm your payment. A member of our team can check it for you.”

Under pending, add a Check again quick reply with a Jump back to the start of this step. Use a Set variable action to count checks, and after three, send the person to Step 9. Under failed and expired, add a Jump back to Step 5 for a fresh link.

Your fines system should mark items as paid from your gateway’s own payment notification, not from the chat – the chat only reads the result, so a payment is recorded even if the person never comes back.

7. Send the official receipt

Under the paid branch, add a Send API action (HTTP method: GET) to your receipt endpoint, passing payment["id"], with the resulting variable receipt.

Then add a Send attachment action. File format: Document. Source: Chat script, e.g. receipt["url"]. Follow it with a Send message:

“Here’s your official receipt, reference {receipt[“number”]}. Keep it as proof of payment.“

People often come back days later for a receipt. Add a second Message received trigger (e.g. “Payment Receipt”, with phrases like “I need my receipt”, “Proof I paid my fine”) that asks for the notice number, looks up paid items and sends the receipt the same way.

8. Log disputes and instalment requests

Some people shouldn’t pay yet – send them to the team that decides.

Under the Dispute a fine sub-trigger, add a Send message first:

“Paying a fine usually means accepting it, so don’t pay a fine you want to dispute. Tell me what happened and our review team will look at it.”

Change this to match your own rules. Then add an Ask survey action. Action title: Fine dispute

Field Variable Type Invalid reply
Notice number dispute_ref Text Please enter the notice number
Reason dispute_reason Text, with quick replies I wasn’t the driver | Vehicle was sold or stolen | Details are wrong | Other Please choose one of the options
Explain what happened dispute_details Text Please describe what happened
Upload any evidence dispute_evidence Attachment (multiple files) Please upload the files
Full name full_name Text Please enter your full name
Email email Email Please provide a valid email address
Phone number phone Phone Please provide a valid phone number

Turn Enable skip on for the evidence field. Add a Create ticket action assigned to your fines review team, with Subject Dispute – {dispute_ref} – {dispute_reason}, the details in Description, dispute_evidence in Attachment(s), the person’s name, email and phone, Auto-apply tags fine-dispute, and an Email template confirming the reference. Also add a Send API action (HTTP method: POST) that flags the notice as disputed in your fines system, so its penalty is put on hold while it’s reviewed.

Under the Pay in instalments sub-trigger, add an Ask survey with the notice number, the reason, the amount they can afford each month (Number), and their name, email and phone. Add a Create ticket assigned to your collections team, with the tag instalment-request.

Both teams reply from the ticket in the Inbox. Check the teamspace’s overdue rule in Settings › Tickets › Overdue rules – it applies to every ticket. With Apply overdue status after set to 7 days and Exclude weekends on, no request is left waiting while penalties grow.

9. Hand over to a live agent

Under I need help, after an unconfirmed payment, and whenever the person asks, add a Live agent handoff action assigned to your payments support team, with Live agent availability check turned on. The live agent sees the notice numbers, the payment ID and the gateway’s status in the Inbox, so they can trace a payment without asking for it again.

10. Test the flow

Validate every path before going live using the AI agent tester side panel.

  • Search by notice number, ID number and vehicle registration, and check the summary and total – including an item under dispute that is left out of the total.
  • Make a test payment in your gateway’s sandbox, tap I’ve paid, and confirm the receipt opens with the right reference.
  • Test a failed payment, an expired link and a payment still pending after three checks.
  • Submit a dispute with evidence and confirm the ticket is tagged and the notice is flagged as disputed.
  • Build and test in an undeployed version – Duplicate the live version on the Workflows tab – then Deploy when every path passes.

Finalise the AI agent deployment by configuring your preferred channels and languages.