0
votes

I'm using Stripe to charge customers for a subscription. The subscribed customer pays 10$ setup fee (immediately) and then 10$ at the 1st of each month. I tried different configurations with Stripe, and got different results but none of which is what I want. Currently by setting the prorate=false I get a bill of 20$ total, but for the 1st of February.

Thank you!

1

1 Answers

0
votes

You can use an invoice item to charge for the setup fee : https://stripe.com/docs/billing/invoices/subscription#first-invoice-extra and then set a trial period to the 1st of the month in order to delay the plan payment until then. Here's an example in Node :

// create customer and payment method
let customer = await stripe.customers.create({
    email: "[email protected]",
});
let pm = await stripe.paymentMethods.attach("pm_card_visa", {customer: customer.id});

// add a floating item for the setup fee, will be charged in the first invoice
let item = await stripe.invoiceItems.create({
    customer: customer.id,
    amount : 1000,
    currency : "usd",
    description: "Setup fee"
})

let subscription = await stripe.subscriptions.create({
    customer: customer.id,
    default_payment_method : pm.id,
    //set the subscription plan on trial until start of next month
    trial_end : moment().add(1, 'months').startOf('day').unix(),
    items: [
        {
            plan: "plan_GVHFF1ESMXZ7CN", // $10 plan
        },
    ],
    expand : ["latest_invoice"]
}); 

You can see it charges the customer a $10 invoice now, and then the upcoming one in February is the $10 of the pricing plan.

enter image description here