#akii-Subscription

1 messages · Page 1 of 1 (latest)

chilly wyvern
#

Hi there, you can create a product/price with 0 cost, use the subscription API to create a subscription for a customer.

cosmic totem
#

Its giving error, customer needs to have some Payment Method before adding any subscription.

chilly wyvern
#

can you share with me the request ID?

cosmic totem
#

SubscriptionCreateParams subCreateParams = SubscriptionCreateParams
.builder()
.setCustomer(customerId)
.addItem(
SubscriptionCreateParams
.Item.builder()
.setPrice(priceId)
.build()
)
.setPaymentBehavior(SubscriptionCreateParams.PaymentBehavior.ALLOW_INCOMPLETE)
.addAllExpand(Arrays.asList("latest_invoice.payment_intent"))
.build();

    Subscription subscription = Subscription.create(subCreateParams);
#

Pass the priceId as any price id and customer which has no Payment method added

chilly wyvern
chilly wyvern
#

I need to step away so I’m going to archive this thread. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact

cosmic totem
#

Hi, the request id is req_ciTHevDyynvYGO

ornate rune
#

Taking a look!

cosmic totem
#

Okay thanks

ornate rune
#

Yep, the issue is the Price object you're using (price_1KsKMAGLOO5b7AOMcU0Zv1sU) requires an immediate payment

cosmic totem
#

Ohh

#

What should i do now..?

ornate rune
#

What are you trying to achieve?

cosmic totem
#

I have some paid plans, and i have a few free plan, i want my customer to be able to subscribe to free plans without having to save a payment method first.

ornate rune
#

Have you tried to subscribe to a free plan? The example request ID you provided was for a paid plan