Skip to main content
creem migrate stripe reads the catalog of your Stripe account and writes it to the Creem store you’re logged in to: your Billing Meters as Creem meters, each Stripe price as a Creem product, the prices of one Stripe product as a product group, and your coupons and promotion codes as Creem discounts. It shows you the plan first, has Creem check it with a dry run, and writes only after you confirm. Your Stripe key stays on your machine. Customers and subscriptions stay in Stripe; What isn’t copied lists everything the command leaves out, and why.

Create a restricted key

In the Stripe dashboard, go to Developers → API keys → Create restricted key and give it: When the key can’t read one of the required lists, the plan names it under fetch_failures, nothing is written, and the command exits with 4. A key made for the first version of the command lacks Coupons and Promotion Codes: add them to it. The CLI only reads. Pass the key with --stripe-key or set STRIPE_API_KEY; in a terminal without either, the CLI asks for it. The key is sent to api.stripe.com only, never to Creem, and never printed or written to the report.

Migrate into your test store

Run the migration against a test store first, check the result in the dashboard, then copy it to live with creem catalog promote. Don’t run a second migration into live: promote pairs every test object with its live copy by key, so live ends up with the objects you checked.
1

Log in with a test key

2

Print the plan

The plan lists every meter, price, product group and discount with what Creem would do with it (create, update, unchanged or skip) and the reason for each skip. Nothing is written.
3

Run it

The CLI prints the plan again and asks before it writes. Each write runs as a dry run first, right before it’s sent. Meters are written first, then products, product groups and discounts.
4

Check the test store, then promote

Open your products, product groups, discounts and meters in the Creem dashboard in test mode and try a checkout. When they’re right, copy them to live:
See Promote test to live.
Use a Stripe test-mode key while you try it out, and your live Stripe key for the real catalog. Either way, the Creem side is your test store.

Options

How Stripe maps to Creem

A product name is the Stripe product’s name. When more than one of the Stripe product’s prices is copied, the price’s nickname is added, or its interval when it has none: Pro - Monthly, Pro - Yearly. Skipped prices don’t count, and inactive prices count only for each other, so --include-archived doesn’t rename an active product. When two names would still be the same, the currency is added: Pro - Monthly (USD), Pro - Monthly (EUR). The description is the Stripe product’s description, or the name when it has none. A meter’s unit label is the unit label of the Stripe product whose metered price is on that meter. When no product names one, the unit label is the meter’s event name, and the plan warns you: Creem uses the unit label as the meter’s credit bucket, and it can’t change once the meter exists. Stripe’s maximum for a customer-chosen amount is dropped with a warning, because Creem’s pay what you want has no maximum.

Product groups

A Stripe product with two or more copied recurring prices becomes a Creem product group with upgrades enabled, so a subscriber can switch between its prices. The group’s key is the Stripe product ID (prod_...) and its name is the product’s name. Its products are ordered by billing period, shortest first, then by price: Pro - Monthly, then Pro - Yearly. Every 12 months and every year are the same period, so their prices decide the order. One-time prices, skipped prices and, with --include-archived, archived prices aren’t in the group, so a product with one copied recurring price gets no group. Creem’s group names have at least 3 characters: a product with a shorter name gets no group (group_name_too_short), and its prices are still copied. A product that the group would contain but that’s already in another Creem group fails the group with product_already_grouped, and the error names that group. Products you added to the group in Creem stay in it, after the copied ones. A product copied from one of the Stripe product’s own prices that Stripe no longer groups, for example because the price was archived or is skipped now, leaves the group, and the plan names it (group_product_removed). The CLI recognizes these by the prices it reads and, for a price it doesn’t read, such as an archived one without --include-archived, by the stripe_product_id and stripe_price_id it wrote into the product’s metadata. A member without that metadata stays. Every run sends the group with upgrades enabled, so a re-run turns upgrades back on for a group where you switched them off in Creem.

Discounts

Every active promotion code becomes a Creem discount with the same code, keyed by the promotion code’s ID (promo_...). A coupon without promotion codes becomes one discount keyed by the coupon ID, and Creem generates its code; the report of the run names the code. A coupon-wide limit can’t be split between codes. Each promotion code’s discount gets its own limit: the code’s, or the coupon’s when it’s lower or the code has none. When the limits of a coupon’s copied codes add up to more than the coupon has left, the plan warns with shared_redemption_limit: together they can be redeemed more often than in Stripe. A discount the CLI wrote before keeps the products you added to it in Creem; the CLI adds the copied products it lacks, and takes a copied product off only from a repeating discount whose count it doesn’t fit, or before the product’s billing period changes (below). The plan names the copied products it keeps that Stripe doesn’t apply the discount to (discount_product_kept), because the CLI can’t tell whether Stripe dropped them or you added them; one warning names them all, with the products you added whose cycles give another count. A copied product in another currency that you added to a fixed discount stays the same way, and the currency warning names only the products the discount leaves out. Creem refuses a limit below the redemptions a discount already has in Creem, so when Stripe has fewer redemptions left than Creem redeemed, the limit becomes Creem’s redemptions so far and the code can’t be redeemed again (discount_redemptions_exhausted).

Repeating discounts

Stripe applies a repeating coupon to the charges in its first months, so every billing period that starts within them is discounted; Creem counts a repeating discount in billing cycles of the product bought. The CLI turns the months into cycles for each product the discount applies to, rounding up: 12 months are 12 cycles of a monthly product, 4 of a quarterly one and 1 of a yearly one, 3 months are 1 cycle of a yearly product, and 13 months are 2. A product billed by the day or week gets no count. When all products give the same number of cycles, the discount repeats for that many. Otherwise the CLI keeps the largest set of products with one number (on a tie, the set with the monthly products, else the one with the smaller number) and leaves the others out with a discount_products_narrowed warning that names them. One-time products are billed once either way and always stay. When no product is left, the discount is skipped with duration_unsupported. The Creem discount is never looser than the Stripe coupon. On a re-run, the CLI checks every product the Creem discount has against the count, also those Stripe doesn’t apply the coupon to any more and those whose price is archived (by the product’s billing period in Creem). A copied product whose cycles give another count is taken off and named in the discount_products_narrowed warning. These products leave the discount in an update of their own before any product is written. A product whose billing period changes (also when a lookup key moves to a price with another interval) leaves every repeating discount stored in Creem first too, whatever Stripe now says about the coupon (also one Stripe no longer has, or one the plan skips), so it never carries the old count; when Creem refuses that update, the period change isn’t written either. When the product is the last one on such a discount, Creem would refuse the discount without products, so the plan holds the period change (discount_last_product, also with --force): add another product to the discount in Creem, or change or delete it, then run again. When the run’s own update moves the discount to other products, run once with --force, which moves the discount, and then again, which writes the new period. A 100% discount of 1,200 billing cycles, Creem’s longest and what it takes for 100% off forever, keeps its products as long as every one of them whose billing period changes is billed in months or years. A product you added keeps the discount, and the plan warns when its cycles give another count (discount_product_kept). Once a discount has been redeemed, Creem keeps its count: when the count would change, the discount keeps its stored count on the products it fits and loses the others, and the plan warns (discount_count_kept); create a new code for the new count. When no product fits the stored count, the update fails (discount_redeemed) and no product leaves the discount. When a product the count was computed from isn’t written in a run, because it failed, Creem’s check refused it or it was blocked, the discount isn’t written either (dependency_failed), and the next run finishes it. A new one-time product doesn’t set the count: when it isn’t written, the discount is written without it (product_not_written), unless none of the discount’s products was written.

Keys and re-runs

Every object the CLI writes carries a key in external_id. A product group’s key is the Stripe product ID, a discount’s the promotion code ID or, for a coupon without promotion codes, the coupon ID. A product’s key is the price’s lookup key, or the price ID (price_...) when the price has no lookup key or Creem doesn’t take it as a key. Creem keys are 1 to 255 letters, digits, _, -, . and :, so a lookup key like Pro Monthly 2024 becomes the price ID, keeps its value in metadata.stripe_lookup_key, and the plan lists the replacement. A meter’s key is its Stripe ID (mtr_...). Two prices can’t share a key. When a price’s lookup key is another price’s ID, the plan fails both with key_collision and writes neither; give the price another lookup key in Stripe and run the command again. Discounts work the same way: a coupon without promotion codes is keyed by its ID, which you can choose in Stripe, so when it’s also the ID of another coupon’s promotion code, the plan fails both with key_collision and writes neither. Stripe can’t rename a coupon: create it again under another ID, or give it a promotion code, and run the command again. Each object is written with Creem’s keyed upsert, which creates it when the key is new and otherwise changes only what differs. A run that stopped halfway, or a second run, never creates an object twice. When nothing changed in Stripe, the plan lists every item as unchanged and nothing is written. Creem replaces a product’s whole metadata when the CLI sends it, so the CLI sends the stored metadata back, merged with Stripe’s product and price metadata and its own stripe_* keys. A key you added in Creem stays; a key that Stripe also has takes Stripe’s value.

Existing Creem objects

A Creem object that already has the key is updated. One without a key that looks like the Stripe object is proposed for adoption: a product, meter or product group with the same name, ignoring case and spacing, or a discount with the same code, ignoring case. The plan shows how each candidate differs, for example its price or event name, and never picks one for you. In a terminal, the CLI asks about each candidate: yes gives it the key, and no to all of them creates a new object. Without a terminal, answer with --adopt price_123=prod_abc to adopt that product, --adopt price_123=new to create a new one, --adopt alone to adopt every proposal that has exactly one candidate, or --create-new-unmatched to create new objects for every proposal the other answers leave open. With --adopt alone and --create-new-unmatched together, proposals with one candidate are adopted and only the rest get new objects. --yes never answers a proposal: while one is unanswered, the run writes nothing and exits with 7. Adopting gives the object its key with a PATCH. Meters and products are adopted before anything else is written; a product group or discount is adopted in its own turn, after the products it names. An adopted meter keeps its event name and unit label, because Creem doesn’t change them after a meter is created. When a price you already migrated gets a new lookup key in Stripe, or loses it, its Creem product still has the old key. The CLI finds that product by metadata.stripe_price_id and proposes it under the new key, answered like any other proposal. Adopting moves the key to it with a PATCH, so no second product is created; creating a new one leaves the old product as it is. When the lookup key moved to a new price that the CLI migrates (Stripe’s transfer_lookup_key), nothing is proposed: the Creem product with the key is updated to the new price, and the old price, when it’s still active or you pass --include-archived, becomes a product of its own. When the new price is one the CLI skips (for example a tiered price or another currency), the old price’s product is proposed under the old price’s key instead, so it isn’t duplicated.

What isn’t copied

These Stripe prices are skipped, with the reason in the plan: Billing Meters with the last aggregation are skipped (aggregation_unsupported). Inactive meters and, without --include-archived, inactive prices aren’t read. These coupons and promotion codes are skipped, with the reason in the plan: The plan also lists, once each:
  • Redemption history. Creem counts redemptions from zero, so only the redemptions left under a limit carry over.
  • Customers and subscriptions. The CLI reads no customers. Existing subscribers keep paying in Stripe until you move them.
  • Usage already recorded on your meters. Send new usage events to Creem once your app reports to it.
  • Webhook endpoints. They aren’t catalog data. Add your endpoint in Creem and handle Creem’s events.
Product images aren’t copied; the plan warns about each product that has some. The CLI never archives or deletes a Creem object because its Stripe price is gone. A product group whose Stripe product no longer has two copied recurring prices, and a discount whose promotion code is gone from Stripe, stay as they are in Creem; the plan lists them with an orphaned warning, so you can delete them yourself. The same warning comes with a promotion code or coupon that’s skipped now, for example because it became inactive or its limit is used up, while its Creem discount is still active: buyers can still redeem it in Creem until you expire or delete it. A coupon’s own discount, written before the coupon got promotion codes, is listed with coupon_has_promotion_codes and the warning too. When a coupon without promotion codes is deleted in Stripe, the CLI can’t tell its discount from one you created, because coupon IDs have no prefix, so the plan doesn’t list it. With --include-archived, it archives the Creem products of prices and products that are archived in Stripe.

Checks and exit codes

Before the first write, Creem checks the whole plan without writing anything: the meters and products together in one validation, then each product group and discount with a dry run. When Creem refuses an item, nothing is written and the command exits with 8; fix what the error says and run it again, or pass --force to write the rest. A discount whose code another Creem discount already holds fails with discount_code_taken. A discount that was redeemed in Creem keeps its amount, type, currency and duration (discount_redeemed), and an adopted discount that still has a Stripe coupon keeps its expiry, limit and products (discount_managed_by_stripe). For new terms, create a new code in Creem. A rate limit is waited out for as long as Creem’s Retry-After says, up to a minute. When a dry run comes back without Creem’s dry-run marker, the CLI stops: it can’t be sure the write didn’t happen. --dry-run and --json without --yes exit with 7 and 8 too, so a script knows the run would stop. With --json, the report is the same one creem migrate lemon-squeezy prints (schema creem.migration_report, version 1), with source.provider stripe.