PolarNotion

Log Polar orders into a Notion revenue database

A Polar + Notion agent flow

Polar shows you orders in its own dashboard, which is fine until you want to slice revenue the way your team thinks, by week, by product, alongside notes the dashboard can't hold. A Notion database does that. The agent lists orders with polar_orders_list, reads the ones placed since the last run, and writes a page per order with notion-create-pages: the amount, the product, the customer, and the order date. Polar replies to the list call rather than pushing, so the agent runs on a cadence, a few times a day, and an order id already logged is skipped. Purchases and renewals accumulate into a database you can group, filter, and annotate.

The flow

Polarpolar_orders_list

Lists orders such as purchases and subscription renewals.

Notionnotion-create-pages

Creates one or more Notion pages with specified properties and content.

Step by step

  1. List recent orders

    The agent calls polar_orders_list newest-first, which returns purchases and subscription renewals, and reads down until it reaches an order id it has already logged.

  2. Diff against the database

    It checks the Notion database for pages already carrying each order id, so a re-run over an overlapping window doesn't create duplicate revenue rows.

  3. Create the page

    notion-create-pages writes a page per new order with the amount as a number property, the order date as a date, the product and customer as text or relation, and the order id stored for dedupe.

Tell your agent

Three times a day, list Polar orders placed since the last run, and for each order id not already in my Notion Revenue database, create a page with the amount, product, customer, order type, and date. Skip orders already logged.

Setup

This flow needs both servers connected to your agent. Follow each install guide:

Worth knowing

  • polar_orders_list returns both one-off purchases and subscription renewals, so store the order type on the page. Counting every row as a new sale would overstate growth when renewals are mixed in.
  • The order references a customer and product by id. If the page should show the customer's email or the product name, the agent resolves them with polar_customers_get or polar_products_get, ideally caching per id so it doesn't re-fetch the same product each order.
  • notion-create-pages writes into a database whose schema you set first. Map amount to a number and the date to a date property, or the page is created without the fields your revenue views depend on.
  • Cap the first run so a backfill doesn't write every historical order at once; bound the initial window and let the cadence handle new orders.

Questions

Does it separate new sales from renewals?
polar_orders_list returns the order type, so the agent writes it onto each page. Group or filter the Notion database by that property to see new revenue and renewal revenue apart, which the dashboard alone won't let you annotate.
Can it convert amounts to a single currency?
The order carries its own amount and currency. Currency conversion isn't something the order tool does, so if you sell in several currencies the agent would apply a rate you supply during the write, and you should store both the original and converted values.