Sign inGet started
Sources

Stripe

View as MarkdownOpen in ChatGPTOpen in Claude
Connect your agent
Add to CursorAdd to VS Code

Connect Stripe with a read-only restricted key, so your agent sees each payment and refund next to the visit and campaign it came from.

Updated

What we read

  • Charges and refunds of the last 30 days, then every hour, in their own currency
  • The visit a payment came from, when your site passes it in the charge's metadata

How it connects

Open Connections > Stripe in your project, paste your restricted key, and click Connect.

We check the restricted key with the vendor at once. It is kept encrypted for this project, never shown again, and deleted when you disconnect.

Requirements

  • A Stripe account, and a Stripe user who can create API keys in it.
  • An owner or admin of the nextanalytica project, to connect it.

How do you create the restricted key?

A restricted key can do only what you allow. Ours needs one permission, read-only.

  1. In the Stripe Dashboard, open Developers > API keys and click Create restricted key.
  2. Name it nextanalytica.
  3. Find Charges and Refunds and set it to Read. Leave every other permission at None.
  4. Click Create key, and confirm with the code Stripe sends you.
  5. Click the key to copy it. It starts with rk_live_.

Then paste it in Connections > Stripe and click Connect.

What does it sync, and how often?

  • Payments: each charge's amount, currency, status and description.
  • Refunds that went through, each with its amount and currency.

We sync every hour and read the last 30 days again each time, since a payment can still be refunded or disputed. Amounts stay in their own currency; your agent converts them when it reads. We keep the copy for 13 months, like your visits. We never create, change or refund a payment.

How do you tie a payment to its visit?

Pass the visitor's id in the payment's metadata. Where your site creates a payment, add na_distinct_id with the same user id it passes to nextanalytica.identify(). For Checkout, set it in payment_intent_data.metadata. Add these too, if your site keeps them:

Metadata keyWhat it holds
na_distinct_idThe user id the site passes to identify()
na_landing_routeThe page the visit landed on
na_utm_sourceThe visit's utm_source
na_utm_campaignThe visit's utm_campaign

A payment without na_distinct_id still counts as revenue, but your agent can't credit it to a channel. Your agent can set this up with you: open Connections > Stripe > Not set up yet? and copy the message.

Troubleshooting

"That's a secret key with full access to your Stripe account. Make a restricted key with Charges and Refunds: Read instead, and paste that."

You pasted the secret key. Create a restricted key as above and paste that.

"Stripe didn't accept this key. Copy it again, or make a new restricted key."

The key was mistyped, deleted or expired. Copy it again, or create a new one.

"This key can't read payments. Edit it in Stripe and set Charges and Refunds: Read."

In Developers > API keys, open the key's menu, click Edit key, set Charges and Refunds to Read and save. Then paste the key again.

"Stripe refused our access: connect it again"

The key was deleted or rolled in Stripe after it was connected. Create a new restricted key and paste it.

Next steps

Related
  • Sources overview: How nextanalytica copies data from the tools you already use, keeps it 13 months or longer, and puts it next to your visits.
  • Google Search Console: Read the Google searches that show your site, with clicks, impressions and position by page and query, next to your visits, in your own agent.
  • Google Analytics 4: Read Google Analytics 4's sessions, key events, pages and countries, by day, back to your property's start, next to the tag's visits.
  • Bing Webmaster Tools: Read the Bing searches that show your site, with clicks, impressions and position, by query and page.
  • ChatGPT Ads: Read your ChatGPT Ads spend, impressions, clicks and conversions, by campaign and day. Read-only, never changes your ads.
  • Odoo: Read Odoo's sales orders and CRM leads, with the campaign Odoo recorded on each, so revenue meets the visits behind it.
Still have questions?
Was this page useful?