Inspiration

I've spent 20+ years building CRM solutions on Microsoft Dynamics (and 6 years as a Microsoft MVP). In almost every project, the same gap shows up: the sale is closed in Dynamics 365, but getting paid happens somewhere else — someone exports an invoice, logs into PayPal, re-types the amounts, sends it, and then manually chases late payers and updates the CRM.

There is no first-party PayPal connector for Power Platform today. Dynamics 365 Commerce only supports the PayPal checkout button, the Azure Data Factory connector is read-only and end-of-support, and the only third-party option in the catalog proxies your PayPal data through an external paid service. Businesses running on Dynamics 365 and Power Platform have no open, direct way to bring PayPal into their flows, apps, or AI agents.

What it does

Collecta is an AI collections agent that lives where the business data already is — inside the native Copilot in Dynamics 365 Sales:

  • "Bill Acme for October" — the agent reads the customer and line items from Dynamics 365, drafts a PayPal invoice, shows a summary and asks for confirmation before sending it.
  • "Who owes me money?" — lists unpaid and overdue PayPal invoices with amounts and days late.
  • "Send a payment reminder to Fabrikam" — finds the overdue PayPal invoice, shows what will be sent and, after explicit confirmation, sends the PayPal payment reminder.
  • Automatic reconciliation — when the customer pays (fully or partially), a PayPal webhook triggers a flow that re-fetches the invoice from PayPal, records each payment in Dynamics 365 and closes the invoice as paid. PayPal stays the source of truth for payments; Dynamics 365 stays the system of record for customers and invoices.

How we built it

  • PayPal custom connector for Power Platform (open source) — an OpenAPI definition covering PayPal Invoicing v2, Orders v2, Payouts and Transaction Search, with rich descriptions so AI agents can pick the right action. PayPal uses OAuth client credentials, which custom connectors don't support natively, so the connector uses custom C# code to exchange the Client ID/Secret for an access token on each call.
  • Dataverse / Dynamics 365 Sales — Accounts, Contacts and Invoices are the business context. Instead of a parallel table, the native Invoice table is extended with PayPal columns (PayPal invoice ID, status, payment link, sent date), so each Dynamics invoice knows its PayPal state.
  • Power Automate — the agent's tool flows (preview, bill, list unpaid invoices) and a webhook reconciliation flow for invoice paid, updated, cancelled and refunded events. The flow never trusts the payload: it re-fetches the invoice from PayPal and upserts payments by transaction ID, so duplicated or forged calls are harmless.
  • Microsoft Copilot Studio — a generative-orchestration agent connected as a sub-agent of the native Copilot in Dynamics 365 Sales, so sellers use it without leaving Dynamics, with human-in-the-loop confirmation before anything that moves money. Evaluated in Copilot Studio: 6/6 test scenarios passed, 100% answer quality.
  • Everything runs against the PayPal Sandbox.

Challenges we ran into

  • Auth: bridging PayPal's client-credentials OAuth with the Power Platform connector model (solved with connector custom code).
  • Designing a safe agent: an agent that can bill customers must never act without explicit confirmation, so every money-moving action has a confirmation step.
  • Enterprise plumbing: licensing Copilot Studio with pay-as-you-go billing across multiple Microsoft tenants took more time than expected.
  • Running inside the native Copilot: making Collecta work as a connected agent of Copilot in Dynamics 365 Sales meant finding the exact security roles a least-privileged user needs, and enforcing a two-turn confirmation rule in the agent, because Copilot Studio's built-in confirmation card can't render in that host.

Accomplishments that we're proud of

  • An open-source PayPal connector for Power Platform that talks directly to PayPal's REST APIs — no third-party proxy, no extra subscription — that any maker can import and reuse.
  • A full end-to-end loop: CRM → PayPal invoice → customer payment → CRM updated, driven by natural language.

What we learned

Agentic commerce works best when the agent sits on top of the system of record (the CRM) and the payment platform (PayPal) at the same time — that's where it can act, not just answer.

What's next for Collecta

  • Submit the connector to Microsoft's official PowerPlatformConnectors repository.
  • PayPal webhook signature verification as defense in depth, per-user Dataverse connections, disputes and refunds handling, subscriptions for recurring billing, and Microsoft Teams as a channel.

Built With

  • apimatic
  • azure
  • c#
  • claude
  • custom-connector
  • dataverse
  • dynamics-365
  • generative-ai
  • microsoft-copilot-studio
  • openapi
  • paypal
  • paypal-orders
  • paypal-payouts
  • paypal-sandbox
  • paypal-webhooks
  • power-automate
  • power-platform
  • python
Share this project:

Updates

Submission history