An AI finance assistant that works inside Cegid PHC GO
The starting point
PHC GO has a full API. Ardaven speaks MCP.
Ardaven bots reach business systems through MCP, the Model Context Protocol. Cegid PHC GO has a full web API but no MCP server we could use, so we built one. The brief: prove the integration on demo data only, keep credentials out of chats and code, and run real tasks end to end.
Getting API access took longer than the build. The trial signup failed once on Cegid's side, and DevGO, where apps get an APP ID, is open only to PHC GO partners and API developers. The trial accepted API logins without an APP ID, so we could carry on; a production rollout will register one.
What we built
One server, every entity
The bot never holds a raw password in chat: Ardaven stores the PHC GO login encrypted and passes it to the MCP server with each connection.
- One server, every entity. PHC GO describes its own data model: 248 entities and their fields. The server reads that catalogue and offers a small set of generic tools (list, describe, query, read, create, update, delete) over every entity the user may reach. Guided tools handle the jobs that take several steps: documents with lines, credit notes, receipts, signing, cancelling and finding a product's suppliers.
- Names are checked. When a query names a field that doesn't exist, PHC GO returns no rows and no error. The server checks every entity and field name against the catalogue and suggests the right one, so a typo can't turn into a wrong answer.
- People approve changes. Tools that write are marked as writes, and deleting, signing and cancelling as destructive. In the web chat, Ardaven pauses on them and shows the exact request before anything runs. Each tool can be set to ask or to run on its own.
- Credentials stay put. The PHC GO login lives in Ardaven, encrypted, and the server sends it only to PHC GO hosts. Identity, security and SQL entities are out of reach, and so are the matching web services.
Round one: the basics
Six everyday jobs, from the web chat
Six everyday jobs, in this order; each builds on the one before. The figures show the conversations as they happened, with tax numbers and record ids hidden.
Task 1. Who owes us money?
"Which customers owe us money right now, and how overdue is each amount?"
Checked in PHC GO: each amount matches the customer's balance ("Saldo em aberto"). A €23.45 receipt credit on another account is correctly not counted as overdue.
Task 2. What should we reorder?
"Which products are running low, with fewer than 5 units in stock? I want to reorder them."
Why it's one call: PHC GO gives services a stock figure too, often negative. The products tool leaves them out, so the list holds only goods you can actually reorder.
Task 3. Add a customer
"We have a new customer: Café Aurora, Lda, in Braga, email geral@cafe-aurora.example. Please add them to PHC GO."
What happened: the bot searched first so it wouldn't create a duplicate. PHC GO refused the customer without a tax number, with its own message; the bot explained it and finished once it had one.
Task 4. Add a product
"Add a new product to PHC GO: reference CAF-1KG, name "Café em grão 1 kg", sale price 18.50 EUR."
What happened: the request waited for a person's approval, showing the exact fields it would write. PHC GO added its own defaults, such as the category "Mercadorias".
Task 5. Invoice the customer, then sign
"Now invoice A Contradança, S.A. for 10 × CAF-1KG and 2 × A001. Show me the draft before signing it."
Checked in PHC GO: only product references and quantities came from the chat. PHC GO filled in names, prices, 23% VAT, the customer's 10% line discount and a 5% financial discount of €55.58, which is why the total is below net plus VAT. The invoice stayed a draft until the user said yes, and signing needed its own approval.
Behind those two tool calls, the server talks to PHC GO the way PHC GO's own screens do:
The first attempt failed: a document started through the API comes without the blank line PHC GO's screens start with. We changed the server to build lines from the catalogue, and the bot's retry succeeded. The conversation above leaves that exchange out.
Task 6. Record the payment
"A Contradança has just paid invoice FT 36 in full. Please record the receipt and finalize it."
Checked in PHC GO: the bot found FT 36's open item in the customer's current account and settled it with a receipt. FT 36 is fully settled and the customer's balance is back where it was.
Round two: situations from a real week
Harder requests, in the web chat and on Telegram
Harder requests, the kind that land on a finance desk with a phone call or a deadline attached. Two of them needed a person to push back, as they would with a new colleague, and the bot went back to PHC GO and corrected itself both times.
Task 7. Should we sell on credit?
Web chat · reads only
"Sons e Ritmos wants to place a €2,000 order on credit. Before I say yes: what's their credit limit, what do they owe us right now, how late do they usually pay, and what have they bought from us? Give me a recommendation."
What happened: the first answer read a credit limit of 0 as "no credit allowed"; in PHC GO it means no limit was set. Corrected, the bot opened the €615 item itself, found it was an old receipt balance rather than an unpaid invoice, checked how the customer actually pays, and kept a more careful recommendation: prepayment or a deposit.
Task 8. Goods arrived damaged
Web chat · credit note
"A Contradança just called: 2 of the Adufe drums on invoice FT 36 arrived damaged in transport. Credit them for those 2 drums only, sign it, and tell me where their account stands afterwards."
Checked in PHC GO: credit note NC 1 is linked to FT 36, credits only the two drums with the invoice's own 10% and 5% discounts (−€1,104.23 in all), carries the legally required reason, and is signed. PHC GO refuses a credit note without a reason, so the tool always asks for one; it also refuses to credit more than was invoiced.
The same assistant, from a phone
We created a Telegram bot with BotFather and connected it to the same Ardaven bot, with the same tools and the same PHC GO login. Only invited people can talk to it; anyone else gets turned away. Telegram has no approval buttons, so tools set to "ask" are refused there and only tools set to run on their own can write. The Telegram images below are screenshots of the real chat in Telegram Web.
Task 9. Restock from the last supplier
Telegram · supplier order
"We're running low on Gaita de foles (G002) and Guitarra portuguesa (G001). Find who we last bought each one from and at what price, and if one supplier has both, place a supplier order with them for 5 of each."

From the top: the invite (code hidden), the first attempt, the retry and the order.
Checked in PHC GO: supplier order no. 1 to Mais Música, lda, 5 × each at the prices last paid (€635.00 and €555.37), €7,320.78 with VAT. PHC GO priced the order with purchase prices, not sale prices.
Why "let's try that again": Ardaven gives a Telegram turn five tool steps. The first attempt spent them working out where PHC GO keeps purchase history and ran out before answering. We added a tool that answers "who supplied this, at what price" in one call; the retry used three steps.
Task 10. Month-end collections
Telegram · reminders in Portuguese
"It's month end. Who should we chase first? Rank everyone who owes us money by amount and by how late it is, net of any credits they have with us. Then write a short, polite payment reminder in Portuguese for each one, ready to send by email, with the amount and the documents it refers to."


The request and the first answer, then the correction and the new ranking.
What happened: the first answer said it had netted credits but hadn't, so A Contradança's reminder asked for €3,075.00 instead of €1,970.77. The person caught it before sending; the bot re-read the whole current account, re-ranked, and rewrote that reminder citing both documents. Next, the receivables tool should return each customer's net position so the model doesn't have to work it out.
What the live system taught us
Found on the real PHC GO, fixed in the server
The server was first built against a simulated PHC GO. These only showed up on the real one; each is handled in the server and covered by a test.
- The session token goes in an
Engine-Authheader. PHC's PHP example looks like it sendsAuthorization: Engine-Auth:…, but PHP's curl ignores array keys and sends each value as a raw header line. - A lost session comes back as HTTP 200 with a
system.token…error, never as a 401, so the server logs in again when it sees that code. - A filter on a misspelt field returns zero rows and no error. On sales documents, the cancelled flag is
anulada, notanulado. - A document started through the API has no blank line; lines are built from the catalogue and linked to the document.
- Credit notes come from the invoice (
getNewRefundDoc), with quantities at zero for the caller to set, and need a reason (ncReason) before PHC GO will save them. - Supplier orders are final as soon as they're saved, and PHC GO prices them with the last purchase price.
- Queries can't combine filters with OR, so finding the documents behind a product's purchase lines takes one small query each.
- Services carry a stock figure but hold no stock, flagged by
stnson each product.
Results
| Measure | Result | How we checked |
|---|---|---|
| Coverage | 215 of PHC GO's 248 entities (8,691 fields) reachable; identity, security and SQL excluded | PHC GO's own entity catalogue |
| Accuracy | Overdue amounts matched PHC GO's balance for every customer | Compared with each customer's balance in PHC GO |
| Data created | 1 customer, 1 product, 1 signed invoice (€1,298.78), 1 receipt settling it, 1 signed credit note (−€1,104.23), 1 supplier order (€7,320.78) | Opened each record in PHC GO afterwards |
| Pricing | No price, tax or discount typed in chat; PHC GO applied all of them, purchase prices included | Document lines and totals in PHC GO |
| Corrections | Twice a person corrected the bot; both times it re-checked PHC GO and fixed its answer | Tasks 7 and 10 |
| Control | Every write paused for a person's approval in the web chat, until the team switched most tools to automatic for the demo | Ardaven's approval prompts |
| Quality | 53 automated tests; every problem found on the live system fixed and covered | Test suite, each fix's test run against the old code |
Demo data from a Cegid PHC GO trial company. Installation details, record ids, invite codes and tax numbers are hidden. Cegid, PHC GO and Telegram are trademarks of their owners. Built by LayerX with Ardaven.
Let's wire an agent into your systems.