This package exposes a scheduleSubscriptionUpdates
function that will build the array of phases required to achieve the desired scheduling.
Example:
const schedule = await stripe.subscriptionSchedules.retrieve(scheduleId)
const updatedPhases = scheduleSubscriptionUpdates({
existingPhases: schedule.phases,
propertyUpdates: [
{
newQuantity: 6,
scheduled_at: 1739538925,
},
{
newQuantity: 42,
scheduled_at: 1747221323,
},
],
});
await stripe.subscriptionSchedules.update(schedule.id, phases: updatedPhases)
To install dependencies:
bun install
To test:
bun test
To build:
bun run build