#poacher2k-price-update

1 messages ยท Page 1 of 1 (latest)

iron spear
stray prism
#

sure! req_UlRuFqAtqRCVzU

iron spear
#

Not the old price_xxx

stray prism
#

ohhhhhhhh ๐Ÿคฆโ€โ™‚๏ธ

#

how does it know which price to transfer it to?

#

do I do this with the new price id?

iron spear
#

It's transferring it to the Price object you're updating. So in the request you've shared, price_1JkpglFXX7EwAD2MMSoMkXFg

#

So you actually need to update price_1LScreFXX7EwAD2M1vOM7ImQ

#

and pass transfer_lookup_key=true

stray prism
#

okay! I erroneously thought each price had a lookup id, but this belongs to the product then I reckon!

#

thanks a bunch! ๐Ÿ™‚

iron spear
#

There's no lookup_key on the Product object. I'm confused

stray prism
#

I am too ๐Ÿคฃ well, how does it know what price to transfer the lookup_key from/to?

#

the docs say:

If set to true, will atomically remove the lookup key from the existing price, and assign it to this price.

#

it doesn't say what "the existing price" means

iron spear
#

Well, lookup_key is unique so we just know which Price object to transfer it from

stray prism
#

right, so that means the lookup key needs to be provided as well in the request?

iron spear
#

Yes

stray prism
#

gotcha. that was incredibly unclear by only looking at the documentation

#

thank you for clearing things up! the correct command is then:

stripe prices update price_1LScreFXX7EwAD2M1vOM7ImQ \
-d "lookup_key"=my_lookup_key \
-d "transfer_lookup_key"=true
iron spear
#

Perfect!

stray prism
#

again thank you! seems obvious, but only after knowing a bit more about how it works

#

hope you have a good day and rest of the week ๐Ÿ™‚