#Stone.D-
1 messages · Page 1 of 1 (latest)
It's the Customer Portal Session: https://stripe.com/docs/billing/subscriptions/integrating-customer-portal
Yes, That's customer portal not for Subscription.
I need a link to manage Subscription.
It's the Customer Portal allows the customer to manager their Subscriptions
It looks like all of Customer's Subscriptions, Could specify subscription to manage?
You can only limit a Product or Price in a configuration: https://stripe.com/docs/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Could i set configuration to prohibit to downgrade?
No, not that specifically. You can achieve somewhat similar behavior by limiting the price id can be updated to, in a product
There is a parameter on the link above!
Could i custormize prorations calculate rules? e.g. calculate without factor remaining days. i.e. from $1 to $5 , charge customer $4 .
It would be completely disable Stripe proration, and implement a proration calculation logic yourself, and charge your customer on a separated Invoice Item
Ok, Could i modify invoice on webhook invoice.upcoming event?e.g. add More invoice item to charge customer
Should be possible. See this section https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items
How to? what's the guide code as your opinion?
You would need to set proration_behavior = none to disable Stripe proration completely when you make the update call: https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Then write your own logic by calculating the price diff, then create an Invoice Item like the above link
Could this Invoice append to the Invoice of next cycle subscription invoice?
Like "id": "evt_1LV9i8IXF5VHSVPpXung6V24", How to append an invoice Item on it?
Yes. It's an Invoice Item and meant to be added to the next billing cycle Invoice:
These one-off items are added to the next invoice created for this customer. To make sure this is added to a specific subscription, use the optional subscription parameter to apply it to that subscription.
If i do that, does the invoice of next of next cycle include this invoice item appended?
Yes
That's not what i want.
What i want is The invoice of next of next cycle does not include this invoice item appended.
Could i only modify this invoice in the upcoming.invoice?
Sorry I may misunderstand your previous question, do you mean "next of next cycle"? No the added item will be in the next cycle, aka the upcoming Invoice
If you add a manual invoice item, or make a change that creates proration items, that item "floats" on the customer. The next invoice for that customer (whenever it is) will pull in that floating item and consume it and charge for it. It's pretty simple.
Sorry, how to add add a manual invoice item in a invoice returned in the upcoming.invoice?
I confused.
https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items , you can do that at any time including when handling that event
Is it implemented with one of the two options of Invoice Item?
https://dashboard.stripe.com/apikeys// Set your secret key. Remember to switch to your live secret key in production.
// See your keys here: https://dashboard.stripe.com/apikeys
const stripe = require('stripe')('sk_test_51IqYnZIXF5VHSVPpqQ3KhEWa4ckfLMRIvMryPLUlwfB6JHChDmTxTZ8g2SIdeOeTDIKD8fBrfJgkv4EC42KZ101r008EYvLkWL');
const invoiceItem = await stripe.invoiceItems.create({
price: 'price_CBb6IXqvTLXp3f',
customer: 'cus_4fdAW5ftNQow1a',
invoice: 'xxxxxxxxxxxxxx'
});
Follow this.
Yes, The sample code does not explain how to associate an Invoice or subscription
what does "associate" mean? What happened when you actually tried to run the code?
like the sample is really simple and complete, I don't know what is blocking you
Should it be like this: const invoiceItem = await stripe.invoiceItems.create({
price: 'price_CBb6IXqvTLXp3f',
customer: 'cus_4fdAW5ftNQow1a',
invoice: 'xxxxxxxxxxxxxxx'
});
Add the invoice id option?
you don't have to, since it works the way I said earlier where the item floats
If you add a manual invoice item, or make a change that creates proration items, that item "floats" on the customer. The next invoice for that customer (whenever it is) will pull in that floating item and consume it and charge for it.
const invoiceItem = await stripe.invoiceItems.create({
price: 'price_CBb6IXqvTLXp3f',
customer: 'cus_4fdAW5ftNQow1a',
});
adds a floating item and that item will be automatically included in the next invoice when it happens.
InvoiceItem in sample just work for customer, But I need more precise control over Invoice or subscription.
Because in my scenario, one user may subscribe to multiple
then yes you can pass the optional subscription or invoice parameters too, absolutely. You looked at the API reference and took a screenshot of it, which explains it in detail.
About code:
Map<String, Object> params = new HashMap<>();
params.put("customer", "cus_MDab9HWGlImsW1");
params.put(
"price",
"price_1LV5lMIXF5VHSVPp0mQjDzHR"
);
InvoiceItem invoiceItem =
InvoiceItem.create(params);
Can the price use a temporary price generated temporarily?
It ok tested.
Picture A is the invoice format I tested, and I want to get the format of picture B. How to achieve this?
the second screenshot comes from updating the subscription in a way that generates proration.
so do that (as you already did?) instead of creating manual invoice items for custom amounts if that's what you want.
Below the date of each item in picture A is a product name (I need a detailed description of the item, but this is not available). In Figure B, the description of the item is on the date....
I mean your screenshots are two different things.
Picture B is what I want
One is from your Dashboard, the other I think is a PDF from the Invoice
I know, you did say that. Like I said, picture B is what gets generated when you use our proration feature. If you don't use it then you get other results.
Yes,you are right.We observe the B chart, his spread is not calculated according to the daily calculation method of Prorations
Please reference the each Date in invoice。
I can't understand you sorry, language barrier.
this thread has been ongoing for 4 hours now, can I ask you to take some time to experiment with the API, read some docs and come back later?
Our B picture is different from the Invoice format in Prorations mode. The date of each entry in B picture is the same. In fact, I modified the subscription package a week ago.
can you ask that to https://support.stripe.com/?contact=true as a new question, sharing the Invoice ID in_xxx the screenshot is from and the details of the updates you made?
sorry, it's exhausting and unfair to us to just ask so many questions here on this channel for hours
ok
@languid forge let's continue chatting here
ok
it's not possible to change the format of the invoice template if that's what you're looking for
This invoice may be just an appearance. The logic behind it is how to upgrade Subscription and achieve: the price difference is not calculated according to the day (Prorations calculation method), only the difference between the two packages is calculated.
e.g Subscribe to $5 package from August 1st to September 1st, upgrade to $10 package on August 15th, the difference should be $10-$5
have you had the chance to read this guide https://stripe.com/docs/billing/subscriptions/upgrade-downgrade ?
combine proration_behaviour: "create_prorations" with billing_cycle_anchor: "unchanged" to achieve what you're expecting
this will make the prorations take place without having to change the billing cycle
The differece is calculated by Prorations. as pic, Upgade from $5 to $15
The difference is $10 I want
do you have the subscription update request id so I could look at it please?
subId:sub_1LV9YkIXF5VHSVPp7kWEUZeU and evtId of customer.subscription.updated in webhook evt_1LVBzgIXF5VHSVPpoZrNJfuU
What's the request id, how to get?
no worries, I'll get there, but for next time you can find it like this https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center 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_WGNcInluuT1OyZ
yes I found it
could you please try the same request but instead of create_prorations use always_invoice?
what do you mean exactly?
The invoice format looks very similar to pic B, but the difference calculation is still calculated according to Prorations, not a simple subtraction
yep, since you're using our proration logic, so of course it is :"calculated according to Prorations".
we don't do a 'simple subtraction', that's not how Stripe's proration works.
it prorates down to the exact second-based timestamp for when the update is done.
Yes, How to archive the result like pic B?
not sure I understand what you mean, can you elaborate?
The picture is that I sent my invoice on August 7th after operating on an APP that's not mine.
I want to achieve the same functionality as it - upgrade
analyze:
Basic package is $5 , Standard package is $10 , Premium is $15 in Picture .
Package period from July 7th to August 7th,
On August 1st, the upgrade from Basic to Standard package resulted in two records of 1 and 2,
A few hours later, the upgrade from the Standard plan to the Premium plan produced two records of 3 and 4
As can be seen from the figure, the difference calculated each time is not calculated according to the remaining days, but simply subtracted.
can you write an email to https://support.stripe.com/?contact=true with the specific Invoice ID and a clear description of the exact actions and API request you made so we can look at your account instead of trying to help on any anonymous Discord thread?
How to get Invoice ID?
When you're looking at an Invoice in the dashboard it's in the top right. (in_xxxx)
or the id field of the Invoice object in the API.
I told you to write to our support team over email with that information. This is an anonymous unauthenticated channel so we can't help as well as they can if you write in.
Deeply investigating specific examples of real invoices on your account is a lot of work and not something we can do here
ok
what you posted is NOT the Invoice ID, no.
The invoice ID looks like in_xxx and I told you how to get it.
what you posted is the invoice number, which is not something I can use(but our support team can since they'd know what Stripe account you're using automatically and could look it up that way; here I don't know anything about your account at all).
I have not Invoice ID.
that's fine if you don't — like I said, the number is enough if you contact our support team with it.
I don't have an invoiceId because this invoice was sent to me after I used it on other merchant APPs
can I close this thread?
like are you saying, that screenshot you posted is not even your account, it's some other invoice that you as a private individual received from a different Stripe merchant?
Yes
if so, we have no way to tell you how they created that Invoice, they might have made it entirely custom themselves and not used our proration, maybe they don't even use Stripe, who knows
it's impossible for me to help you understand what that other merchant did
sorry but this thread is going nowhere and you've been here asking questions for days.
are you finished? can I close this thread?