#nsad__

1 messages · Page 1 of 1 (latest)

glad sorrelBOT
jagged bridge
#

Hello

#

What's the issue?

hybrid bough
#

Hello my friend

#

when i try:

stripe.Price.modify(
    instance.stripe_plan_id,
    product=instance.product.stripe_product_id,
    nickname=instance.nickname,
    unit_amount=instance.price,
    currency=instance.currency,
    recurring={"interval": instance.interval},
    active=instance.is_active,
)
show:
stripe.error.InvalidRequestError: Request req_h31P5mLKZLnOgk: Received unknown parameters: unit_amount, product, currency

but when i try just some fields, like this, works normally:

stripe.Price.modify(
    instance.stripe_plan_id,
    product=instance.product.stripe_product_id,
    nickname=instance.nickname,
    active=instance.is_active,
)
#

this happen in creation too

jagged bridge
#

You can't update unit_amount for a Price for instance

#

Prices are generally immutable

#

If you want to update them you should mostly be creating a new one

hybrid bough
#

but why this happen in create price?

#
plan = stripe.Price.create(
    product=instance.product.stripe_product_id,
    nickname=instance.nickname,
    unit_amount=instance.price,
    currency=instance.currency,
    recurring={"interval": instance.interval},
    active=instance.is_active
)
jagged bridge
#

What is the error for that?

#

You should see a request ID that you can look at

#

Feel free to share that request ID here as well and I can look at it

hybrid bough
#

give the same error:

stripe.error.InvalidRequestError: Request req_1nOZZNylchbgks: Received unknown parameters: unit_amount, product, currency
#

id = price_1NxX5eLzQK7EQjsIOrSpeeKP

jagged bridge
#

That is not a Price creation request

#

That is an update request

#

You can see that it is a POST request to /v1/prices/price_1NxX1aLzQK7EQjsI4epzraH0 which indicates you are attempting to update price_1NxX1aLzQK7EQjsI4epzraH0

hybrid bough
#

so my signals was with problem, i remove if with modify

#

so when i need change price, and this price already use, how change?

#

need use lookup?

jagged bridge
#

Well if you want to change something like the amount then you would create a new Price

#

If you just want to change one of the mutable pieces then you would retrieve it and then update it, yes.

hybrid bough
#

a okay, thanks so much! Have a nice day!