#meshpaul-prices

1 messages · Page 1 of 1 (latest)

cobalt vortexBOT
sand bear
cobalt vortexBOT
#

meshpaul-prices

pastel quest
#

I understand this. So do I am trying to get all products and for each product I get default price object ... Then I try to make it inactive using
Ex.
var price = product.getDefaultPriceObject()
price.udate(PriceUpdateParams.builder().setActive(false).build())
but I don't see any POST v1/prices/ calls in the log

#

so how to set it inactive using Java API

lusty perch
#

👋 stepping in

#

Looks like you are mostly doing this correctly. If you aren't seeing any logs come through at all then you need to check your server for errors.

pastel quest
#

I a literally doing this interactively in test mode in a test case...

#

Ok let me see it could be that default PaymentObject is null

#

this is why it's not making the api call

#

or rather PriceObject

#

I guess I have to query Prices by Ids then

lusty perch
#

You do need the Price ID, yes.

pastel quest
#

So to my point when invoking product.getDefaultPriceObject() using Java API I am getting null and the expectation is to get Price object... so there is a bug

sick quartz
#

@pastel quest do you have an example Price/Product I can look at? Like did you explicitly make it the default Price on that Product?

pastel quest
#

Hmm

sick quartz
#

But my gut right now is: you think you have a default Price, but you don't. It's a special/separate feature. You likely just have a Product, and that Product has one (or multiple) Price(s).
So what you want is to call the List Prices API instead (you can pass product: 'prod_123') to get the Price(s) and then update each one separately

pastel quest
#

Ok will do

#

Ok what I am getting is this
This price cannot be archived because it is the default price of its product.; request-id: req_GN2iHwSecDMRVb
com.stripe.exception.InvalidRequestException: This price cannot be archived because it is the default price of its product.; request-id: req_GN2iHwSecDMRVb

#

so the Products can't be deleted

#

it looks like they stay there forever

#

Issue is that we created them in test mode

#

and we didn't fully understood this

sick quartz
#

you could delete all Test data if that really bothers you!

pastel quest
#

how

sick quartz