#yelseW

1 messages · Page 1 of 1 (latest)

karmic meteorBOT
trail summit
#

hello! can you share your current code snippet where you're creating the subscription?

clear ermine
#
  curl https://api.stripe.com/v1/subscriptions \
  -u sk_test_x: \
  -d customer=cus_y \
  -d "items[0][price]"=price_z
trail summit
#

pass in payment_behavior=default_incomplete

clear ermine
#

Cheers!

#

That worked (no error) but the pending_setup_intent is still returning null

trail summit
#

the pending_setup_intent is returning null, cause the subscription has a non-zero amount to pay

#

if you're looking for the client_secret to collect payment for a non-zero subscription, you should look at the payment_intent

clear ermine
#

I'm looking to create a "draft" with that first incomplete subscription, which I can then continue to update, so that amount is not yet finalised

trail summit
#

is there a reason why the amount is not yet finalized?

clear ermine
#

Because we want to be able to update it if customer intends to upgrade/get something else

trail summit
#

the general idea is to have finalized everything already, then create the subscription

clear ermine
#

I initially tried to do that using an invoice, but I can't add a subscription price id to an invoice. Is there another way for that?

I was planning to use the subscription/invoice object stripe provides to get the pricing summary instead of a manual calculation outside of stripe

trail summit
clear ermine
#

But the subscription product already has a price, I just want to add that to a draft invoice

trail summit
#

you cannot add a first payment for a Subscription to a draft invoice

clear ermine
#

And there are no drafting capabilities for a subscription?

trail summit
#

then once the user has confirmed what they want, you would create a Subscription

clear ermine
#

With a customer that has no existing subscription, there isn't an upcoming invoice I can use though, am I understanding it wrongly?

trail summit
clear ermine
#

Sorry, could I get an example for using subscription_item with GET /invoices/upcoming?

trail summit
#

what language are you using?

clear ermine
#

This was my guess, but it gave an error of "No such invoice: 'upcoming'"

curl https://api.stripe.com/v1/invoices/upcoming\?customer=cus_x \ 
  -u sk_test_y \
-d "subscription_items[]"=prod_z
#

Just curl for now

trail summit
#
curl https://api.stripe.com/v1/invoices/upcoming \
  -u sk_test_xxx: \
  -d subscription_items[0][price]=price_xxx \
  -d customer=cus_xxx \
  -X GET
clear ermine
#

And to create an actual subscription can I leverage that, or should I just create a Subscription with the same subscription items?

trail summit
clear ermine
#

Yup, I understand creating an actual subscription separately, but will we be able to create an actual subscription from the earlier upcoming-invoice-subscription?

trail summit
#

upcoming invoice subscription is a preview, i don't understand what you mean by creating an actual subscription from the earlier upcoming invoice subscription

clear ermine
#

If we want to go from preview to actual, is there a create_subscription_from_preview or do I just create a subscription normally, independent from the preview, using the same subscription items?

trail summit
#

you create a subscription normally, independent from the preview, using the same subscription items