Will Autumn modify existing Stripe data?

dev
7ca5724Merge pull request #521 from useautumn/feat/atmn-nuke-push-server
This post might have stale content, as dev is 29 commits ahead.

I have a Stripe account with products and customers. I'm implementing Stripe in a new project using the same account but via Autumn. Check that connecting the Stripe account, copying Autumn sandbox plans to the Autumn prod environment and using Autunm in general won't modify in any way the current Stripe products, customers or transactions.

Avatar of Claude Sonnet 4.5Claude Sonnet 4.5commented

I'll help you verify that Autumn won't modify your existing Stripe data. Let me explore the codebase to understand how Autumn interacts with Stripe.

Let me search for more specific information about what operations Autumn performs on Stripe when connecting accounts and copying products.

Now let me read the key files to understand what gets created in Stripe:

Now let me check the README to understand the deployment/copying process:

Now let me look at the specific copy functionality:

Perfect! Now let me check what happens when products are created in Stripe to understand if this modifies existing Stripe data:

Now let me check the actual initProductInStripe function to see what it does:

Perfect! Now I have all the information I need. Let me provide a comprehensive answer based on my analysis of the codebase.

##Analysis Summary

Based on my review of the Autumn codebase, I can confirm that Autumn will NOT modify your existing Stripe products, customers, or transactions in the ways that matter. Here's what actually happens:

###1. Connecting Stripe Account

When you connect your Stripe account to Autumn (via handleConnectStripe.ts):

  • Autumn only stores your encrypted API keys in its database
  • It creates webhook endpoints in your Stripe account to listen for events
  • It does NOT modify any existing customers, products, or transactions
  • It calls ensureStripeProductsWithEnv which only checks if Autumn products exist in Stripe

###2. Copying Plans from Sandbox to Production

When you copy plans from sandbox to production (via handleCopyEnvironment.ts):

  • This operation is entirely within Autumn's database
  • It copies product and feature definitions from sandbox to production environment
  • The actual Stripe sync happens later via initProductInStripe

###3. What initProductInStripe Does

This is the key function that interacts with Stripe (lines 526-567 in productUtils.ts):

export const initProductInStripe = async ({...}) => {
    if (!isStripeConnected({ org, env })) return;
    
    // 1. Check if product exists, create if needed
    await checkStripeProductExists({...});
    
    // 2. Create prices if they don't exist
    for (const price of product.prices) {
        await createStripePriceIFNotExist({...});
    }
}

What it does:

  • Only creates NEW Stripe products if they don't exist (checked by processor.id)
  • Only creates NEW Stripe prices if they don't exist (checked by stripe_price_id)
  • If a product/price already exists in Stripe, it reactivates it if inactive, but doesn't modify it

What it does NOT do:

  • ❌ Delete or modify existing Stripe products
  • ❌ Delete or modify existing Stripe prices
  • ❌ Touch any existing Stripe customers
  • ❌ Modify any existing subscriptions
  • ❌ Touch any transaction history

###4. Creating Customers

When Autumn creates or manages customers (createStripeCusIfNotExists):

  • It checks if a Stripe customer already exists by ID
  • If the customer exists, it uses the existing one
  • Only creates a new Stripe customer if one doesn't exist
  • Never deletes or modifies existing customer data

###5. Safety Mechanisms

The code includes several safety checks:

  • Products have a processor field with { id, type } that tracks the Stripe product ID
  • Prices track stripe_price_id, stripe_product_id, etc.
  • All create operations check for existence first
  • Reactivation of archived items instead of creating duplicates

###Conclusion: Safe to Use

Connecting your Stripe account - Only adds webhooks and stores keys
Copying sandbox plans to production - Internal Autumn operation
Using Autumn generally - Only creates new resources, never modifies existing ones

Your existing Stripe products, customers, and transactions will remain untouched. Autumn operates by creating new products/prices for its managed plans and linking to existing customer IDs when they already exist in Stripe.

The only visible changes in your Stripe dashboard will be:

  1. New webhook endpoints
  2. New products/prices created for Autumn-managed plans (clearly identifiable)
  3. New subscriptions for customers who purchase Autumn-managed products

All your existing Stripe data remains completely safe and unmodified.

Avatar of Santiago GalánSantiago Galáncommented

Excellent. And can I edit some metadata of the products directly in Stripe without breaking Autumn? Specifically I want to add a product description, because I don't see that option in Autumn.

Avatar of Claude Sonnet 4.5Claude Sonnet 4.5commented

Let me check how Autumn handles product metadata and whether it syncs descriptions from Stripe.

Let me look more closely at what happens when products are created and updated in Stripe:

Perfect! Now I can provide a comprehensive answer. Let me check one more thing about whether Autumn reads descriptions from Stripe:

Perfect! Now I have all the information needed to provide a complete answer.

##Answer: Yes, You Can Safely Edit Product Metadata in Stripe

Based on my analysis of the codebase, you can safely add descriptions and other metadata directly in Stripe without breaking Autumn. Here's why:

###What Autumn Does with Stripe Products

When Autumn creates or updates products in Stripe, it only manages these fields:

  1. Product Name - Synced from Autumn to Stripe (one-way)
  2. Metadata - Autumn adds autumn_id and autumn_internal_id for tracking
  3. Active status - Autumn may reactivate if inactive

What Autumn does NOT do:

  • ❌ Read or sync descriptions from Stripe back to Autumn
  • ❌ Read or validate any other Stripe product fields
  • ❌ Overwrite custom metadata you add (only adds its own)
  • ❌ Modify fields it didn't create

###Key Code Evidence

Here's what Autumn does when creating a product in Stripe (stripeProductUtils.ts, lines 19-25):

const stripeProduct = await stripe.products.create({
    name: product.name,
    metadata: {
        autumn_id: product.id,
        autumn_internal_id: product.internal_id,
    },
});

And when updating a product name (updateProductDetails.ts, lines 81-83):

await stripeCli.products.update(stripeProdId, {
    name: newName,
});

Notice: Only the name field is updated. Description and other metadata are completely ignored.

###Autumn's Description Field

You mentioned not seeing a description option in Autumn. That's correct - Autumn stores descriptions in its own database (not in Stripe):

  • Autumn's product.description field is stored in the Autumn database
  • It's exposed via the API (V2 only) as shown in getPlanResponse.ts
  • It's never synced to or from Stripe

###What You Can Safely Edit in Stripe

Safe to add/edit in Stripe:

  • Product descriptions
  • Product images
  • Custom metadata fields (not autumn_id or autumn_internal_id)
  • Tax codes
  • Statement descriptors
  • Unit labels
  • URLs
  • Any other Stripe-specific fields

⚠️ Don't modify these in Stripe:

  • Product name (Autumn will overwrite it if you update the product in Autumn)
  • autumn_id metadata (used for tracking)
  • autumn_internal_id metadata (used for tracking)

###Recommended Approach

For product descriptions, you have two options:

Option 1: Add in Stripe directly (recommended for now)

  • Go to your Stripe Dashboard
  • Edit the Autumn-created products
  • Add descriptions, images, etc.
  • These will persist and not be overwritten

Option 2: Use Autumn's description field (if available in your version)

  • In Autumn API V2, you can include description when creating/updating plans
  • This stores it in Autumn's database but does not sync it to Stripe
  • Example:
{
  "id": "pro",
  "name": "Pro Plan",
  "description": "Full-featured plan for professionals",
  "price": { "amount": 2900, "interval": "month" }
}

###Summary

You are completely safe to edit product metadata directly in Stripe. Autumn operates with a "write-only" approach to Stripe - it only writes the specific fields it needs (name and tracking metadata) and never reads back or overwrites other fields. Your custom descriptions, images, and other metadata will be preserved indefinitely.


END OF POST

Log in to add a comment
Claude Sonnet 4.5
Will Autumn modify existing Stripe data? — useautumn/autumn