#Huzaifa

1 messages · Page 1 of 1 (latest)

mossy snowBOT
idle mantle
#

So that error is saying that some of your prices have different intervals. Basically every price on your subscription needs to renew at the same cadance. For example you can't have a monthly price with a yearly price, they would both need to be monthly or both need to be yearly

#

Have you double checked that all of your prices have the same interval?

sleek valley
#

yes

thats the thing

i am building an eccommerce

customer can add one yearly subscription product and one monthly subscription product

and then checkout

is there any api for that

idle mantle
#

We don't have anything pre-made for that. You would either need to make two subscriptions or you would have to make a monthly subscription, track how many months go by, and add a one time charge representing the yearly rate every 12 months.

sleek valley
#

but what for weekly

#

0.25 month would not be an option

idle mantle
#

You can make weekly prices via the dashboard or API

sleek valley
#

i want to do it from api

idle mantle
#

Have you looked in the API reference?

sleek valley
#

for all in single transaction

for weekly, monthly, year

idle mantle
#

You cannot do that unless you track the time yourself

#

So it would be a weekly subscription, every time a month passes you add the monthly price, every time 52 weeks pass you add the yearly charge

#

The month charge wouldn't quite line up but that is the closest you can get on one subscription

sleek valley
#

i can track year

like if customer select 1 year it will be like 12 months

but how can i track weeks like if customer select 1 week , what it will be 0.25 month ???

idle mantle
#

No, it is only whole values.

#

Also there is an option in the dashboard when creating prices

sleek valley
#

i have created the price

#

i want to use multiple interval price in same subscription api

#

which i cant do because interval should be same

#

so now how can i use multiple interval now

#

thats my question

idle mantle
#

Stripe does not support multiple intervals on the same subscription

#

The thing I suggested is a workaround so that you can charge like that, but it will take custom code on your side

sleek valley
#

i want to make a single charge

#

i am a coder

i can code

#

i just want to understand how can i do it

idle mantle
#

I think we might be talking past each other a bit here. Is it clear what I suggested with my workaround of one weekly subscription that you add one time prices to?

sleek valley
#

ok tell me is there any limit for prices per order ?

idle mantle
#

Oh and to be clear, to do that, you would listen for the invoice.created webhook event, that will be sent out when the invoice is first created. Invoices will stay in a draft state for one hour after creation and you can add invoice items to them during that time. Will look for a doc on this

sleek valley
#

ok

#

what about search subscription by email

wraith parrot
sleek valley
#

const subscription = await stripe.subscriptions.create({
customer: customer.id,
items: [obj],
default_payment_method: paymentMethod.id,
metadata: {
email: req.body.email,
orderid: req.body.orderid,
},
});

#

is the above code is correct to create subscription with metadata

wraith parrot
#

Looks alright to me, provided all the variables have what the API is expecting.

sleek valley
#

giving no error on api but empty when viewing on dashboard

#

in logs i can see the metadata but its not displaying on dashboard

wraith parrot
sleek valley
#

ah

got it

its inside billings > subscription

#

is there any webhook which notify me 3 days before the next subscription delivery date ??

sleek valley
#

????