#zig.balthazar

1 messages · Page 1 of 1 (latest)

tall craterBOT
tribal gyro
#

you would just use mode:subscription and pass two line_items, one is a recurring Price(the $100), and the other is a non-recurring Price for $30

polar jewel
tribal gyro
#

yep

#

what is wrong with that/what do you want it to be instead?

polar jewel
# tribal gyro yep

I want the user to pay only $30 for the first time on the checkout page, and $100 in the subsequent months. However, in the image above, it deducts $30 and $100 as two separate items from the user for the first time, and only deducts $100 in the following months.

tribal gyro
#

then I would say keep it the same but add a one-time coupon for $100 off

#
const session = await stripe.checkout.sessions.create({
  success_url: 'https://example.com/success',
  discounts:[{coupon:"Q90ztQlv"}],
  line_items: [
    {price: "price_1NGJ9CJoUivz182DDiWBdXEt", quantity: 1},
    {price: "price_1NGJ9UJoUivz182D7e97U2QP", quantity: 1},
    
  ],
  mode: 'subscription',
});
#

it deducts $30 and $100 as two separate items from the user for the first time
to be clear, it charges them the "total due today" as one combined payment(that's what happens when they complete the Checkout form), and then for subsequent recurring payments, the recurring Price is what is charged, in case that was not clear

polar jewel
#

I understand that due to the system's implementation logic, you cannot use a coupon in this scenario.

However, according to the documentation, it states: "For subscription mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only."

Regarding the image you provided, I must clarify that the initial amount to be charged from the user is dynamic and determined after calculation, so it is not possible to use a discount code or similar in this case.

tribal gyro
#

there isn't really another easy approach then

polar jewel
tribal gyro
#

you can create a coupon dynamically in the API for a specific amount as part of the process of setting up the session, I don't see what the problem there would be

tribal gyro