#Filip-priceupdate

1 messages ยท Page 1 of 1 (latest)

arctic crypt
#

@exotic gate those links don't work for anyone else as they're logged-in links for your own dashboard. Can you share the req_xxx request IDs of the specific requests you're looking at?

exotic gate
#

Oh, sorry...

  1. req_BXd9gckm0EqDFC
  2. req_dEONqBaVc8MK9q
arctic crypt
#

the dashboard is able to do some extra things like let you edit Prices as 'drafts' before they're used, for convenience in the UI, but in the API Prices are immutable.

exotic gate
#

Understandable, but why is there lib implementation for this then? Any tips on how to have desired state price?

arctic crypt
#

You'd just create the Price with the details you want it to have.

exotic gate
#

And old price would be still present? I'm not achieving desired state with that approach.

arctic crypt
#

it would be present yes. To be clear the dashboard just lets you edit prices before they're used for convenience in the UI, the API doesn't.

#

you can't for example edit a price if it's already being used by >0 subscriptions :

exotic gate
#

But I understand what is the issue, "Updating price for ongoing subscriptions" is a bit problematic, but I'm not sure how to achive desired-state from perspective of the API.

arctic crypt
#

what is the desired state?

exotic gate
#

Oh, sorry I needed to get of to the meeting.

It is declarative vs imperative approach of defining something.

I want to have a single yaml file that is always going to reflect stripe products.
(most similar to ansible, but for stripe)

nimble flame
#

oh hey sorry for the delay this didnt alert in my UI

coarse ruin
#

Is your hope to use this yaml-like file to control the configurations for your products/prices? If so, could you give us an idea of the type of information that you hope to store in and reference from that configuration?

fiery estuary
#

reopened the thread for you @exotic gate

exotic gate
#

Hey, Thank you for re-opening.

@coarse ruin
Here is the example of simple yaml file:

 product_1:
  label: Plan name
  type: plan # biz logic
  pricing:
    price_1:
      price: 500
      model: volume
      metered_agg: max
      type: recurring
      billing_period: month
      prorated: true
    price_2:
      price: 1000
      model: volume
      metered_agg: max
      type: recurring
      billing_period: month
      prorated: true

The plan is to store keep every product and all prices for that product. Only reason that I would want Update rather then Create new one, is because of potential clutter in the YAML file.

Currently, I've opted that price_1 is going to be incremented every time the change is needed. Therefore, it would conform to the already active subscriptions.

But it would be also great to be able to do it without a need to archive every price that is being changed or at-least to "keep" unique identifier (price_1 in this case) and therefore to do Create + Archive in the background but it would seem like Update.

#

P.S. I'm not sure who is online so sorry for unnecessary pings ๐Ÿ˜…
(hopefully iOS 15 helped with that)

fiery estuary
#

Unfortunately what @arctic crypt mentioned before will still be an issue for you - you can't "reuse" the price ID like that to workaround not being able to update

exotic gate
#

Hmm, but can I use LookupKey instead? As a my own way of tracking most recent price while not "reusing" stripes price_ID

#

Not sure if that is intended to be used like that ๐Ÿค”

fiery estuary
#

Hm... I'm pretty sure LookupKey has to be unique, but not sure if it has to be unique across archived/inactive prices

exotic gate
#

Lets assume worst, that it needs to be unique. I would just need to add Archive tag with some iterator at the end (e.g. product_1_price_1_archived_1 ). I think this can work for my case.

Thank you, again ๐Ÿ™

And feel free to archive it again if you don't have anything to add ๐Ÿ˜„