#Vinny GG

1 messages · Page 1 of 1 (latest)

soft ledgeBOT
neon scarab
#

Where are you looking? What API are you using?

violet jetty
neon scarab
#

Ok, and what are you expecting to see?

violet jetty
#

Starting at $0.50 /month

#

I'm getting the price from an old stripe account and moving it to a new account, I would like to know how I can pass it on when the product has this price

neon scarab
#

Can you share a price_xxx ID?

violet jetty
#

price_1LuQelG5ciCKjMS7JjEGeFvE

neon scarab
#

Is this the new object or the old one you're migrating?

violet jetty
#

old

neon scarab
#

You're using the wrong field. You need to look at the tiers array, not unit_amount. Your Price is tiered billing scheme.

violet jetty
#

Ok, but I can't consult the array of the tier in this endpoint price, right?

neon scarab
#

I'm not sure what you mean by 'consult'?

#

You're trying to migrate a Price object from one account to another right?

#

Then you need to pass the parameters as they are on the old Price when creating the new Price

#

You're not right now, as tiers is missing. That field is not returned automatically from the API, you need to expand it:

prices->all(['expand' => ['tiers']])
#

So pass that when querying Prices from the old account, and you'll see the actual unit amount data you need

violet jetty
#

Thank you very much, this is what I was looking for

neon scarab
#

np!

violet jetty
#

Would you help me
I couldn't send the null value, what value could I put?

#

Don't let me not put the uo_to index either

raw orchid
violet jetty
#

hmmm

#

Thank you very much

#

Prices with type=one_time are not supported with tiered billing

raw orchid
#

correct, tiered pricing is for our subscriptions product only

raw orchid
# violet jetty

that looks like a recurring Price (so not type=one-time) so it wouldn't give you the error you quoted(?)

violet jetty
#

I'm trying to create new price on a new stripe account with old account data

raw orchid
#

ok. Not sure I follow really, it's impossible for the other account to have a one_time Price with tiers (since that's impossible), so there must be an issue in your logic for copying

violet jetty
#

Could you give me an example of price creation with tiers

raw orchid
violet jetty
#

This here is my data I'm sending, what's wrong?

raw orchid
#

you're not passing an explicit type

#

so it defaults to one_time

#

and then one_time Prices can't have Tiers; hence the error

violet jetty
#

When I add the type it shows this error

raw orchid
#

yeah there's no type on Price

#

if it's recurring, then you do that by passing recurring with a hash containing the details. Check the docs

#

sorry for the confusion I added, there is not a type as a parameter, I was wrong, but the idea is if you don't pass recurring => [...] it's one_time and if you do, it's recurring.