Stripe Connector
Stripe Connector
Connect your Stripe account to Brevo via Tajo for complete payment data synchronization, subscription lifecycle management, and revenue-driven marketing automation.
Overview
| Property | Value |
|---|---|
| Platform | Stripe |
| Category | E-commerce |
| Setup Complexity | Easy |
| Official Integration | Yes |
| Data Synced | Customers, Payments, Subscriptions, Invoices, Events |
| API Base URL | https://api.stripe.com/v1 |
Features
- Customer sync - Sync Stripe customers with Brevo contacts including metadata
- Payment tracking - Track successful payments, refunds, and failed charges
- Subscription management - Sync subscription lifecycle events for retention campaigns
- Invoice data - Sync invoice details for post-purchase and renewal automation
- Revenue attribution - Map lifetime value and MRR to Brevo attributes
- Webhook events - Real-time event notifications for all payment activities
- Multi-currency support - Handle payments across multiple currencies
- Checkout session tracking - Track Stripe Checkout for abandoned payment recovery
Prerequisites
Before you begin, ensure you have:
- A Stripe account with API access
- Stripe API keys (publishable and secret keys)
- A Brevo account with API access
- A Tajo account
Authentication
API Key Authentication
Stripe uses bearer token authentication with your secret API key.
curl https://api.stripe.com/v1/customers \ -u sk_live_YOUR_SECRET_KEY:API Key Security
Never expose your secret key in client-side code. Use the publishable key for frontend operations and the secret key only on your server.
Restricted API Keys
Create restricted keys with specific permissions for enhanced security:
- Go to Stripe Dashboard > Developers > API Keys
- Click “Create restricted key”
- Grant only the permissions Tajo requires
Required Permissions
customers: readcharges: readpayment_intents: readsubscriptions: readinvoices: readevents: readproducts: readprices: readConfiguration
Basic Setup
connectors: stripe: enabled: true secret_key: "${STRIPE_SECRET_KEY}" webhook_secret: "${STRIPE_WEBHOOK_SECRET}"
# Data sync options sync: customers: true payments: true subscriptions: true invoices: true products: true
# Brevo list assignment lists: all_customers: 20 subscribers: 21 churned: 22Field Mapping
Map Stripe customer data to Brevo contact attributes:
Default Mappings
| Parameter | Type | Description |
|---|---|---|
email required | string | Customer email address (unique identifier) |
name optional | string | Customer full name, split into FIRSTNAME/LASTNAME |
phone optional | string | Maps to SMS attribute for WhatsApp/SMS |
currency optional | string | Default currency for the customer |
created optional | timestamp | Customer creation date in Stripe |
metadata optional | object | Custom key-value metadata from Stripe |
subscriptions optional | array | Active subscription details |
balance optional | integer | Customer account balance in cents |
Custom Attribute Mapping
field_mapping: # Standard fields email: email name: FULLNAME phone: SMS
# Payment metrics total_spent: TOTAL_SPENT payment_count: PAYMENT_COUNT last_payment_date: LAST_PAYMENT_DATE average_order_value: AOV
# Subscription fields subscription_status: SUB_STATUS plan_name: PLAN_NAME mrr: MONTHLY_REVENUE subscription_start: SUB_START_DATE
# Custom metadata metadata.customer_tier: VIP_TIER metadata.referral_source: REFERRAL_SOURCEAPI Endpoints
Core Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/customers | List all customers |
POST | /v1/customers | Create a customer |
GET | /v1/customers/{id} | Retrieve a customer |
POST | /v1/customers/{id} | Update a customer |
GET | /v1/charges | List all charges |
GET | /v1/payment_intents | List payment intents |
Subscription Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/subscriptions | List subscriptions |
GET | /v1/subscriptions/{id} | Retrieve a subscription |
GET | /v1/invoices | List invoices |
GET | /v1/invoices/upcoming | Retrieve upcoming invoice |
GET | /v1/products | List products |
GET | /v1/prices | List prices |
Event Endpoints
| Method | Endpoint | Description |
|---|---|---|
GET | /v1/events | List events |
GET | /v1/events/{id} | Retrieve an event |
Events
Payment Events
| Event | Trigger | Use Case |
|---|---|---|
payment_intent.succeeded | Payment completed | Order confirmation |
payment_intent.payment_failed | Payment failed | Recovery email |
charge.refunded | Refund processed | Refund notification |
charge.dispute.created | Chargeback initiated | Dispute handling |
Subscription Events
| Event | Trigger | Use Case |
|---|---|---|
customer.subscription.created | New subscription | Onboarding flow |
customer.subscription.updated | Plan changed | Upgrade/downgrade flow |
customer.subscription.deleted | Subscription cancelled | Churn prevention |
customer.subscription.trial_will_end | Trial ending in 3 days | Trial conversion campaign |
invoice.payment_failed | Subscription payment failed | Dunning email sequence |
Customer Events
| Event | Trigger | Use Case |
|---|---|---|
customer.created | New customer added | Welcome email |
customer.updated | Customer data changed | Attribute sync |
customer.deleted | Customer removed | Cleanup |
Code Examples
Initialize Connector
import { TajoClient } from '@tajo/sdk';
const tajo = new TajoClient({ apiKey: process.env.TAJO_API_KEY, brevoApiKey: process.env.BREVO_API_KEY});
// Connect Stripeawait tajo.connectors.connect('stripe', { secretKey: process.env.STRIPE_SECRET_KEY, webhookSecret: process.env.STRIPE_WEBHOOK_SECRET});Run Customer Sync
// Full historical syncawait tajo.connectors.sync('stripe', { type: 'full', resources: ['customers', 'subscriptions', 'payments'], since: '2023-01-01'});
// Check sync statusconst status = await tajo.connectors.status('stripe');console.log(status);// {// connected: true,// lastSync: '2024-01-15T10:30:00Z',// customersSynced: 12500,// subscriptionsSynced: 8200,// paymentsSynced: 45000// }Handle Stripe Webhooks
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);
app.post('/webhooks/stripe', async (req, res) => { const sig = req.headers['stripe-signature'];
let event; try { event = stripe.webhooks.constructEvent( req.body, sig, process.env.STRIPE_WEBHOOK_SECRET ); } catch (err) { return res.status(400).send(`Webhook Error: ${err.message}`); }
// Forward to Tajo for Brevo sync await tajo.connectors.handleWebhook('stripe', { type: event.type, data: event.data.object });
res.status(200).json({ received: true });});Rate Limits
Stripe enforces the following rate limits:
| Type | Limit | Details |
|---|---|---|
| Live mode | 100 read requests/second | Per secret key |
| Live mode | 100 write requests/second | Per secret key |
| Test mode | 25 requests/second | Per secret key |
| Webhook delivery | 100,000 events/day | Per endpoint |
Rate Limit Handling
Stripe returns a 429 Too Many Requests response when limits are exceeded. Implement exponential backoff. Use list endpoints with auto-pagination for bulk data retrieval.
Troubleshooting
Common Issues
| Issue | Cause | Solution |
|---|---|---|
| 401 Unauthorized | Invalid API key | Check secret key in Stripe Dashboard |
| Webhook signature fail | Incorrect webhook secret | Re-copy webhook signing secret from Dashboard |
| Customer not synced | No email on Stripe customer | Ensure email is set on Stripe customer records |
| Missing subscription data | Insufficient permissions | Update restricted key permissions |
| Duplicate events | Webhook retry delivery | Implement idempotency with event IDs |
Debug Mode
Enable verbose logging:
connectors: stripe: debug: true log_level: verbose log_webhooks: trueTest Connection
tajo connectors test stripe# ✓ API connection successful# ✓ Customers readable# ✓ Subscriptions readable# ✓ Payments readable# ✓ Webhook endpoint verifiedBest Practices
- Use restricted API keys - Create keys with minimum required permissions
- Always verify webhook signatures - Prevent spoofed webhook events
- Handle idempotency - Use Stripe event IDs to prevent duplicate processing
- Sync customer metadata - Store marketing-relevant data in Stripe metadata fields
- Monitor webhook delivery - Check Stripe Dashboard for failed deliveries
- Use test mode first - Validate your integration with Stripe test mode and test clocks
Security
- API Key Authentication - Secret key-based access with restricted key support
- Webhook signature verification - HMAC SHA-256 signature validation
- TLS encryption - All API communication encrypted via HTTPS
- PCI compliance - Stripe handles PCI DSS compliance for payment data
- IP whitelisting - Optional IP restrictions for API access
Related Resources
- Stripe API Documentation
- Stripe Webhooks Guide
- Shopify Connector
- Customer Sync Skill
- Brevo Contacts API
Open-Source Implementation Map
This section is derived from official or public repository material discovered for the Stripe connector. Use it as the engineering companion to the setup guide above: it shows where the API surface lives, what implementation assets exist, and how Tajo should translate them into reliable Brevo sync behavior.
Repository Snapshot
| Repository | Commit | Languages / formats | Files |
|---|---|---|---|
| stripe/openapi | 3b6451b | Markdown (13), JSON (11), YAML (11), YAML (8), ruby-version (1), license (1) | 45 |
Integration Shape
graph LR Source["Stripe API / repository"] --> Auth["Auth and scopes"] Source --> Objects["Objects, events, and schemas"] Auth --> Tajo["Tajo connector runtime"] Objects --> Tajo Tajo --> Brevo["Brevo contacts, attributes, lists, campaigns"] Tajo --> Ops["Backfill, cursor, retries, logs"]What To Reuse
- Stripe’s OpenAPI Specification
- This repository contains [OpenAPI specifications][openapi] for Stripe’s API.
- Changelog
- Directory Structure
- | Directory | Description |
Tajo Revamp Checklist
- Keep authentication setup aligned with the vendor docs and the public repository’s current API shape.
- Map primary resources into explicit Tajo sync objects with stable external IDs.
- Prefer cursor-based or updated-at incremental sync where the API exposes it; otherwise document the fallback.
- Treat webhook handlers as idempotent and replay-safe, especially for order, contact, ticket, and campaign events.
- Capture pagination, rate limits, retry headers, and partial-failure behavior in connector smoke tests.
- Keep examples small and runnable against sandbox or test-mode accounts.