#ibgoldbergs

1 messages · Page 1 of 1 (latest)

dawn zenithBOT
wise bear
#

Hi there

flat coyote
#

can we use upcoming invoices if there is no subscription yet?

#

oddly, we are using upcoming invoices already in the case of a subscription update (such as upgrade or downgrade) to show to amount due to the client

wise bear
#

Yep you can

#

You can simulate creating a Sub with that endpoint

flat coyote
#

Oh got it. So if I just pass in for example:

  • Coupon
  • Customer
  • subscription_items[0][price]
  • subscription_items[0][tax_rates][0]
  • subscription_proration_behavior

It should output how much the client would be charged upon creation of subscription?

wise bear
#

Yep that looks right to me

flat coyote
#

doh. Seems like we are pretty close then

#

thanks for the help

#

Another question... How do we do this if we don't yet have a customer? We typically create the customer upon signup

#

When trying to hit the endpoint without a customer or subscription, I receive an error:

{
"error": {
"message": "You must either provide a customer or a subscription to the upcoming invoice endpoint.",

barren cloak
#

You can just create a placeholder Customer and then update the customer upon signup

#

Customers aren't required to have any particular information, so you can essentially just instantiate a blank one to be updated later with things like name, DOB, email, et.c

flat coyote
#

and if we don't need the customer, should we delete it? Or is a placeholder customer not actually created yet?

barren cloak
#

You need a Customer in order to have Subscriptions, so you have to keep it