#samip_api
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1239387741977055312
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
billing_address_collection: 'required',
line_items: [
{
price: priceId,
quantity: 1,
},
],
customer: customerId,
mode: 'subscription',
success_url: `someURL`,
cancel_url: `someURL `,
allow_promotion_codes: true,
customer_update: {
address: 'auto',
name: 'auto',
},
subscription_data: {
// billing_cycle_anchor: Math.floor(Date.now() / 1000) + 30,
proration_behavior: 'none',
},
})```
This is my code currently for reference
Can you share the request ID (req_xxx) of your request? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_Sa3li5toKca3cf
This was my last failed attempt
I have given my code for reference too
If I set the billing cycle anchor, it shows me that 0.00$ is due today and 0.10$ (product price) will be charged in the same date.
With reference to the Checkout Session creation request: https://dashboard.stripe.com/test/logs/req_Id5BKcxX9rLPmF, it's different from the code you showed. For example, I don't see subscription_data.proration_behavior in your actual request
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Let me create a new request right now and give you a new request I.
req_yGPgxJUQliSfhZ
The post body now has both billing cycle and the proration behaviour
https://dashboard.stripe.com/test/logs/req_yGPgxJUQliSfhZ showed the billing_cycle_anchor to be 1715564032 (2024-05-13 01:33:52) which was ~30 seconds seconds after the creation request at 1715564003 (2024-05-13 01:33:23)
https://dashboard.stripe.com/test/subscriptions/sub_1PFnluGei7MrDZax1ZdsssLM looks expected to me.
The billing cycle is set to a few seconds later, i.e. the next invoice will be billed only the specified timestamp with reference to billing_cycle_anchor. The initial checkout session will show the amount at the time of creation, i.e. $0 at that point
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
If I want it to be charged immediately as the customer enters their card on the screen and charge monthly thereafter. How do I configure my payload ?
If I send an empty subscription_data object it will add today's invoice and the next month's invoice and bill it to the customer.
Whereas, I want the customer to pay $0.10 today and then get charged in a recurring manner
This is what I see when I send an empty subscription object:
For your reference : req_WtH7Et4gYHvOr9
I want to charge the customer's card then and there?
If you want to charge the customer today and charge month afterwards, there is no need to set subscription_data.billing_cycle_anchor and subscription_data.proration_behavior
https://dashboard.stripe.com/test/logs/req_WtH7Et4gYHvOr9 looks fine to me
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Customer will be billed $0.10 every month afterwards
The customer should be billed 0.10 today as well
I'd recommend using test clock https://docs.stripe.com/billing/testing/test-clocks to advance the time and check how the subscription works
That is what I am not being able to configure
It shows me 0.00 was paid today when I navigate to the customer
Can you try a larger amount (more than $0.50) for your price? If the minimum amount is not met, it'll be billed to the next invoice: https://docs.stripe.com/currencies#minimum-and-maximum-charge-amounts
This was it
Is this mentioned anywhere in the checkout session page and I missed ?
This isn't explicit mentioned for Checkout Session specifically. The minimum amount is applied to all payment integrations by Stripe
Thank you very much. Solves this issue.