#idhruv
1 messages ยท Page 1 of 1 (latest)
i am also trying to retrieve subscription object from subscription schedule object via subscription = await stripe.subscriptions.retrieve(subscriptionSchedule.subscription); but this also results in null
๐ happy to help
basically you haven't created the subscription schedule from_subscription https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-from_subscription
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
so your schedule isn't bound to a subscription
let me check plz
sure
it basically says Migrate an existing subscription to be managed by a subscription schedule but i don't have a subscription to begin with. In our case when user choose to go with monthly payment, we create subscription schedule
sure, for our particular scenario subscription schedule suits very well. I had asked plenty of questions regarding subscriptions here and as far as I roughly remember there were certain things subscription object was not supporting us and hence we decided to go with subscripton schedules
i dont exactly remember exact details but subscription was not supporting us with some extended features that we currently use
ok I see
i vaguely remember right now that it was regarding start_Date and end_Date
but why do you need the subscription id then?
in subscription we are not able to custom choose the start_date
something related to this we had faced problems
our workflow depends on this, we fetch subscription from schedule and then fetch invoice
and ultimately, we finalize that invoice by calling the api
you can fetch the invoice from the Schedule
actually let me go back at this maybe you can't I'm double checking
nope i cannot:
{ subscriptionSchedule: { id: 'sub_sched_1Ls3vtGdNldKu1zm98HIxcR7', object: 'subscription_schedule', application: null, canceled_at: null, completed_at: null, created: 1665577269, current_phase: null, customer: 'cus_M080M5PhdKNibp', default_settings: { application_fee_percent: 7.74, automatic_tax: [Object], billing_cycle_anchor: 'automatic', billing_thresholds: null, collection_method: 'charge_automatically', default_payment_method: 'pm_1LI7kHGdNldKu1zmacV0AJsB', default_source: null, description: null, invoice_settings: null, transfer_data: [Object] }, end_behavior: 'release', livemode: false, metadata: { bookingId: 'xxx' }, phases: [ [Object] ], released_at: null, released_subscription: null, renewal_interval: null, status: 'not_started', subscription: null, test_clock: null } }
this has never happened with any other users, its completely new for us.
your subscription schedule is suppose to start in December
that's why the subscription hasn't been created yet
that's not possible coz start date is mentioned as october 12 i.e. today in my case
and from date is december, so this subscription is for 2 months starting today
if you check the code object above, created date has the timestamp as per the pic:
no actually the subscription starts on December
created date isn't the phase startDate
it was created today I agree but you meant it to start in 8 weeks time
no i want it to start today actually, i am not passing any future date param in phases
let subscriptionObj:any = {
customer: userData.stripeCustomerId.toString(),
start_date: fromDateSec,
// start_date: 'now',
end_behavior: 'release',
default_settings: {
application_fee_percent: adminPercentWithTax,
collection_method: "charge_automatically",
default_payment_method: payload.cardId,
transfer_data: {
destination: hostStripeAccId?.stripeAccountId
}
},
metadata: {'bookingId': String(bookingArr[i]?._id)},
phases: [
{
items: [
{
price: price.id,
quantity: 1,
}
],
iterations: monthlyIterations,
proration_behavior: 'none'
},
]
}`
in your creation request you mentioned start_date : 1670610600
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
where exactly are you seeing 1670610600? see i marked the created date in red
okay i found it, this figure is in post body
thats just not possible
let me check again plz
it's not the created timestamp it's the start_date
these are 2 different values
created is the timestamp when you sent the request to Stripe to create the Subscription Schedule
start_date is the Start Date of the Schedule and could be in the future
this is basically why you needed Subscription Schedules in the first place
you are right, i am confirming this internally
but let me ask you one more thing
if we apply date in the future, how can we then get invoice for that subscription schedule?
i feel in that scenario my program will stop working completely as my further steps depend on finalizing the invoice
you won't be able to get an invoice that hasn't been created for a subscription that hasn't started yet
or even was created
you would have to wait until the subscription gets created to get the invoice
which is in 2 months time
okay
let me know if you need any more help
let me know if you need any more help