#RubyDev-prices

1 messages · Page 1 of 1 (latest)

olive herald
#

yes you get all Prices and Products together when you list one of them, and you can pass a plan ID to the Price retrieve API and vice versa

#

it all just works together seamlessly

#

i.e if you list Prices, you get Price objects proice_xxxx , and also Plan objects plan_xxxx , but they are rendered as Prices in the API response so you can work with them all exactly the same way.

chrome arch
#

Okay let me check

chrome arch
#

when I update this price metadata

#

price_1KPkpGGABbZHUFxpsSzdWzcy

#

to price

#

why plan metadata got changed to price from plan

#

plan_L5xSftrMzHn08r

#

?

#

not sure what is hapening

#

Do this plan and price are related in any way?

#

plan_L5xSftrMzHn08r
price_1KPkpGGABbZHUFxpsSzdWzcy

#

@olive herald please help

#

I saw plan and price are related

#

but why did when I update price metadata plan metadata got changed?

cursive cipher
#

@chrome arch please give me a moment and I'll look at this

chrome arch
#

sure please

cursive cipher
#

I do see that those objects changed at almost the same time, but I'm seeing two separate update requests that made those changes. Based on what I'm seeing it looks like your Ruby code updated each object separately.

chrome arch
#

not sure but I just updated price

#

so I updated only price

#

price_1KPkpGGABbZHUFxpsSzdWzcy

cursive cipher
#

Do you have the request ID (req_XXX) from where you updated that price?

chrome arch
#

Okay wait a minute please

#

req_IlNeaL1iTzDvYJ

#

this is the request where plan metadata get updated to value 'price'

#

though I updated price metadata

cursive cipher
#

That request also happened nearly a day after you changed the metadata on the price object, which supports that these changes weren't linked together (at least not on our end). That request seems to have come from your Ruby code.

chrome arch
#

Okay can I send you request IDS?

#

I mean event IDS

cursive cipher
#

Sure

chrome arch
#

evt_1KS1CZGABbZHUFxpCkm9tC6R

#

evt_1KS1CZGABbZHUFxpdrNzD1zH

#

both events happened at the same time when I updated Stripe::Plan

#

it means if I update the plan price also get updated

#

Note: I only called Stripe::plan.update

cursive cipher
#

But if you look at the ID of the object in those events, you can see that they're both for the same object.

chrome arch
#

hmm but I updated this using plan_ id

#

I mean plan_id

#

Okay now I get it

#

why when I pull list of plan I'm getting id as price_

#

#<Stripe::Plan:0x3fc9a9acf820 id=price_1JWfpYGABbZHUFxpeMEh3qxz> JSON: {
"id": "price_1JWfpYGABbZHUFxpeMEh3qxz",
"object": "plan",

#

look at this

#

it is plan but id is price_

cursive cipher
#

Sorry, I thought it'd already been mentioned in this thread, Prices and Plans are basically interchangeable. Prices are the new version of Plans.

chrome arch
#

when I call Stripe::Plan.list does it also fetch price?

#

cause I'm getting these ids ["plan_K9xQRLisVERbfY", "price_1JVd9TGABbZHUFxpLI22Zgfx", "price_1JVd9SGABbZHUFxpzavzoPeM", "price_1JVd9RGABbZHUFxpC814tVbt", "price_1JVd9PGABbZHUFxppmNraAJc", "price_1JVd9OGABbZHUFxprah28qJJ", "price_1JVd9MGABbZHUFxpNm0yXt0J", "price_1JVd9KGABbZHUFxpZlltQ35G", "price_1JVd9JGABbZHUFxpL6omTHXK", "price_1JVd9IGABbZHUFxphPQZvFO5"]

#

mix with plan_ and price_

cursive cipher
#

Yes it does.

chrome arch
#

ahh can I only get plan and price by passing old API version?

#

before call

#

cause earlier it was like that

#

both were seperate

cursive cipher
#

Hm, possibly, but I'm not seeing mention of such a change in the API changelog so I'm not sure if it's controlled by the API version or the client library version.

ruby glacier
#

The Price/Plan APIs are designed to be interoperable, so this is all expected

#

You can use a plan anywhere we ask for a price