#klavik-subs

1 messages · Page 1 of 1 (latest)

hasty drum
#

hi, what exact code did you use?

dreamy breach
#
Stripe::Subscription.update(
      current_stipe_subscription.id,
      {
        add_invoice_items: [
          {
            price: "price_1LSgPqJxFhjLfjdl3BfwKZ1H",
            quantity: 1
          },
          {
            price: "price_1LSgQPJxFhjLfjdly4X5UKO5",
            quantity: 1
          }
        ]
      }
    )

the code executed was that

and the ID of the request is : req_BtrXM7FTQHPUGD

hasty drum
#

you'd use items not add_invoice_items if you want to add a new recurring price

#

add_invoice_items is to add one-off amounts to be included in the next invoice(only accepts a one time Price), items are the actual recurring subscription line items for each billing period(only accepts recurring Prices)

dreamy breach
#

aah okay, got you. Will that add a recurring price to the invoice as an additional one, or will it replace the current one?

hasty drum
#

it would add a new one

#

you can replace the olde one by specifying the ID though

dreamy breach
#

okay just tested, it will just add them as extra lines, yes. Thank you for the help

Last question for now though, will it automatically generate a new invoice as well with prorations for the added items? or would that require another API call to generate the invoice?

hasty drum
#

depends on what value you pass for proration_behavior on the call

dreamy breach
#

for the Subscription.update request?

hasty drum
#

yep. Make sure to the read the docs, the page I linked links to a detailed page on proration and the API reference