#jaunt-archived-products-dashboard
1 messages ยท Page 1 of 1 (latest)
I'm seeing that view populate with some archived products on my own test account - do you have a specific example of an archived product you're not seeing in that view?
Thanks for checking. Let me find an example.
So prod_KbsDTcFTphMAB3 says it's archived, but won't show up when I look at products / archived.
Hmm.... that's very strange. Give me a bit to dig in further
thanks!
Can you do me a quick favor - can you make a quick API call to retrieve all the archived products for that account (set active: false when you list all products (https://stripe.com/docs/api/products/list#list_products-active)
Hmm, let me think how I can do this quickly. Is there a way to make api calls in the dashboard?
no you can't make API calls in the Dashboard
ok so I'll probably have to make a function in my production back end and deploy it.
shouldn't take me too long
@grand jewel you don't really need to
that specific product was created with price_data and product_data on Checkout and in that case the product is just not shown in the Dashboard
I see. but might be possible to get it through the API you are thinking?
That would be good because this kind of relates to another issue under investigation where adhoc created products are re-using old products instead of creating new ones.
I need to find out which customers ended up with products with meta data from other customers.
For example if I create a product with a name "LESSON", and add meta data specifying which lesson, that doesn't work if the products aren't uniquely created.
You can explicitly retrieve that product via the API yes, but you can't mutate/change it
that's ok, I just need to see which customers are messed up. I've now changed the system not to rely on meta data in products at all.
But if I request all inactive products, will I get ones that were created in checkout?
I don't think so but I can try quickly, give me 5
thanks
doesn't work unfortunately, those are "ad-hoc" products and we don't really surface them on their own. But you can retrieve them directly
I see. So I can get all subscriptions, find out which product they are tied to, then retrieve that product.
best option is to use https://stripe.com/docs/api/checkout/sessions/all and expand data.line_items.data.price and then read the Product ids for each one
Ok that's cool.
ah if it's on subs you can do https://stripe.com/docs/api/subscriptions/list and expand items.data.price.product I think
and get the entire info in one call
Nice.
I'm glad we're just a startup with not too many customers yet. Ha. How adhoc products are being reused is hard to understand. My guess is under the hood when you try to create a new one, it's looking for existing active ones by name only. But that it throws out the meta data and uses the old meta is a head scratcher.
I'm surprised we would ever re-use a product under the hood
if you have an example I can check
These two products were created yesterday by customers (adhoc), yet the meta data came from products created in october. I don't see how I could have accidentally done that because if you look at ddcode in my meta data, it's the current webapp version, and I don't keep that info around, so yesterday's products having a month old version info means it came from the old products I think.
prod_KZKU82XL8IlRzG
prod_KZKUrheku9W0we
so prod_KZKU82XL8IlRzG was created by your own code, with metadata on November 10: https://dashboard.stripe.com/logs/req_Is77C9q35b7ZPY
I can look further if you want
Thanks. I'm trying to figure out what's going on but jumping all over the place. Also hard since I can't see the archived products.
Super confusing what's happening. I wonder if something is wrong with the go code I'm using, like somehow data is crossing between api call to my backend.
Is there a way to see which customer or subscription is attached to prod_KZKU82XL8IlRzG?
you can use https://stripe.com/docs/api/subscriptions/list#list_subscriptions-price to see all subs on a price/product
OK. I'll finish this function to get all subscriptions first.
Ps for listing subscriptions as you mentioned above with expanding items.data.price.product, is that possible? It says I should be expanding "data.items" instead, but would that break the 4 depth limit?
anyway, I seem to get a lot of data about everything without expanding at all.
hey there, just catching up
items.data.price.product is only 4 levels, so that should be fine
are you having issues with it?
Hi thanks! It's because it's from the list subscriptions route, so it's a list that gets returned. I guess I could make that call for each one.
ah so on a list request the expansion needs to start with the data. layer to refer to each iterated item
and that does count as a layer, yes
ie, listing subscriptions you be limited to expand[]=data.items.data.price
ok thanks! Almost got it working. Then to figure out what else is going on ๐
Sounds good, let us know if you need any help ๐
thanks!
Hello, I found an anomaly that I can't explain:
This event is a subscription update: evt_1JuA2PDqsmyGk25Qw5NYcxom
It's for: sub_1JgdV6DqsmyGk25Q0ldmCXns
Which is attached to this product: prod_KXig2H6oc3CMLq
But in the event, items[0].data.plan.product is set to prod_KUDn0vkxNFZPMd, and so is plan.product.
It's only under "previous_attributes" that the correct product shows up as prod_KXig2H6oc3CMLq.
prod_KUDn0vkxNFZPMd is for a product that was created on Oct 27, adhoc for a completely different user: vt_1JpFLeDqsmyGk25Q71spgREV
Hello! Let me take a look, hang on...
Thank you kindly!
In this request (which is the one that generated the customer.subscription.updated above) you're updating the Subscription to use price_1JpFLeDqsmyGk25QKzaDKafR which is a Price for Product prod_KUDn0vkxNFZPMd: https://dashboard.stripe.com/logs/req_5DO14LfbDKcRmR
The event data is reflecting the change you made.
ok that's helpful.. I will take a look thanks!
I think this entire mess-up was caused by a colleague attaching an adhoc price to a different customer. He tried to downgrade a customer from premium to standard, but the drop down just populates with a bunch of same-named prices, so it's impossible to know they have specialized meta data in the interface.
That could be. One thing to note is that Prices in Stripe cannot be attached to Customers. What's your use case for creating Prices for each Customer?
I guess I meant products. When a user wants to "check out", I had been creating ad-hoc products to send to the checkout session. I attach meta data to those products. We have our own product catalog and so we don't want to maintain a separate version in the stripe dashboard. This works well seemingly. A couple confusing things though, is that in the stripe dashboard under products, you can't see products created in this way, nor can you export them. Yet when you are adjusting someones subscription, they seem to pop up there.
Products can't be attached to Customers either.
Well they can indirectly
Sure, but not in any functional/meaningful way.
We don't surface the Products/Prices you create ad-hoc for one-off purchases in most places because doing so would quickly overwhelm your reusable Products/Prices.
But you're saying the ad-hoc Prices are showing up when you edit a Subscription?
Well, there are a bunch of products that show up under "Products" and I would have thought they are all adhoc as we don't ever create them in the dashboard, but they are only a subset of products. I think those are the ones that show up when editing a subscription.
Could it have to do with a user editing one in the customer portal or something? Here's one example of one showing up: prod_KYtToSTnwea3Ya
To clarify, are we talking about Products or Prices?
Products, sorry.
That Product was created explicitly as a reusable Product here: https://dashboard.stripe.com/logs/req_a1G3j0TcRb6ykK
It was not created ad-hoc.
So I guess somehow the way I am creating them in golang is either making them reusable or not.
I see.
So when the customer wants to go to the customer portal to manage their subscription, I create products, But when they originally buy them they are adhoc. Damn.
So when the customer wants to go to the customer portal to manage their subscription, I create products
Can you expand on this? I don't understand why you would create a Product prior to sending someone to the Customer Portal.
Well because I create adhoc products in the first place, I need to be able to send them to the portal with a second subscription to upgrade or downgrade to. When they first purchase they already chose standard or premium.
It's quite crazy -- I had some help here with setting it up ๐
And when creating new prices to attach to their portal session, I couldn't see a way to do it adhoc. I remember that now.
I understand you don't want to maintain your product catalog in Stripe, but I think you might be shooting yourself in the foot by trying to do all this ad-hoc. What if you added your products to Stripe as they're used instead of all at once up front?
Ha, I definitely already have a bullet hole in my foot!
I guess I'd have to search for them and reuse if I find them? As long as products were truly fixed, in that they had a consistent ID matching their attributes, I guess that could work. For a while we were selling lesson and have hundreds of them, and course packs that changed all the time.
But now just a few subscriptions which would be easier. Hmm
And I'm sure there's a way to make sure the user always gets both tiers available when managing their subscription.
But for example, we are planning on adding a third tier, so then we'd still have to massage existing products to match that third tier.
The way I have it now, is I detect their current subscripton, scan our own catalogue for matching tiers, and rebuild their choices before they go to their protal.
Maybe the solution is to not use stripe checkout.
The easiest approach long-term by far is going to be to create all your Products in Stripe up front.
And just do it manually.
Failing that, if you create them as they're used and save the Product and Price IDs on your end alongside the product and price info you already have, you'll then know when to add stuff to Stripe: if there's no Stripe ID for it, create it and save the ID.
It's super painful as well as we have multiple prices for each country.
We actually did what you are saying originally. Here's what a product looked like back then. And then if we want one for each lesson and course pack, the dashboard way got massively annoying. Json was so much better and we could use git.
prod_GBEBaUMhkZynF2
The way you're doing it now is going to eventually end up with the same situation; all the Products will eventually be in Stripe as more and more people use the Portal.
A solution could be to somehow create them adhoc... shouldn't that be possible?
Or is that only when sending to checkout session?
If you create them adhoc they're not going to show up in the Portal.
Wait, I think we might be talking past each other.
I'm saying that if you create a Product/Price adhoc they will not show up in the Customer Portal. I'm referring specifically to the scenario where your customer is being sent to the Portal to up/downgrade.
Meaning adhoc will not work for your use case.
No worries! Just wanted to make sure we're on the same page. ๐
why wouldn't they show up? I guess because they have to be reusable.
The Portal would end up with thousands of options if adhoc Prices showed up.
For customer portal? But right now only the two I create and attach via "subUpdate" show up,
Enabled: stripe.Bool(true),
Products: catalogue,
DefaultAllowedUpdates: []*string{stripe.String("promotion_code"), stripe.String("price")},
ProrationBehavior: stripe.String("always_invoice"),
}
Should it matter whether the products in the catalogue I send are adhoc or not?
BusinessProfile: &stripe.BillingPortalConfigurationBusinessProfileParams{
PrivacyPolicyURL: stripe.String("https://singdaptive.com/privacy"),
TermsOfServiceURL: stripe.String("https://singdaptive.com/terms"),
},
Features: &stripe.BillingPortalConfigurationFeaturesParams{
InvoiceHistory: &stripe.BillingPortalConfigurationFeaturesInvoiceHistoryParams{
Enabled: stripe.Bool(true),
},
PaymentMethodUpdate: &stripe.BillingPortalConfigurationFeaturesPaymentMethodUpdateParams{
Enabled: stripe.Bool(true),
},
SubscriptionCancel: &stripe.BillingPortalConfigurationFeaturesSubscriptionCancelParams{
Enabled: stripe.Bool(true),
},
SubscriptionPause: &stripe.BillingPortalConfigurationFeaturesSubscriptionPauseParams{
Enabled: stripe.Bool(true),
},
SubscriptionUpdate: subUpdate,
},
}
I mean using this billing portal configuration.
The normal use case for adhoc Prices is when you have a Product you charge variable amounts for. That Product would end up with dozens, hundreds, or even thousands of adhoc Prices as a result. If we showed every adhoc Price for that Product in the Portal it wouldn't make sense.
Ok that makes sense. I'm just confused because I have many "reusable" products but only the two I specify in subscriptionupdate show up, so I figured if I specified adhoc prices in subscription update that might work.
I don't think that would work. It's worth a try, but I imagine it won't.
I guess alternatively I could archive active products after they are "used"?
Yeah, I suppose that would work, but you're really going against the grain of how Stripe is designed to work here. You're likely to keep running into rough edges and issues and will probably end up expending more effort if you continue trying to do everything adhoc instead of going with the intended flow and adding all of your Products and Prices to Stripe as they exist in your catalog.
Ok will ponder that. I know you are right. But it's not insignificant how error prone it is to manage a catalog through a dashboard like that.
No version control etc.
I'm not suggesting you manage it through the Dashboard.
It's probably best to set up a scheduled task that runs some code that makes sure Stripe is up to date periodically.
I see. So a function that takes my json store and syncs it to stripe. I like that.
I'm thinking something that goes through each Product/Price on your end, checks to see if there's already a Stripe ID associated with it, if not it creates and stores one, and for archived/deleted/whatever Products/Prices you could fetch the associated Stripe Product/Price and make sure it's also archived.
Ah yes.
Then you run that as often as you need to keep everything up to date. Maybe on a schedule, maybe when certain Product/Price updates take place on your end, maybe a combination.
Yes. Ok I'm with you. I appreciate the help. I think that's totally doable.
I recommend creating a new Stripe account dedicated to testing just this code. You never need to activate it, just use it in test mode with this code. Each time you run the code you can verify the info, then use the Delete all test data... button to reset and test fresh again after making changes: https://dashboard.stripe.com/test/developers
I already have three accounts (local, dev, and prod) ๐
Deleting all of your test data shouldn't take too long if all you've got are the Products and Prices in there.