#drprofsgtmrj

1 messages · Page 1 of 1 (latest)

sand coralBOT
robust plume
#

Hello! Nope, you can add a one-time payment. Do you want to add a one-time payment when you first create the Subscription, or do you want to add one to an existing Subscription?

sudden solar
#

Hm. Either one. I just was curious. I notice that it shows up as the invoice item.

I'll have to check to see if it comes back as an item in the subscription itself

robust plume
#

It shows up as a separate line item on the Invoice the Subscription generates.

sudden solar
#

But if I wanted to modify the existing one would I be able to include a single time payment in it?

robust plume
#

Yes.

#

For example, let's say you had a $10/month Subscription that's been going for three months.

#

You can add a one-time $20 charge to the next Invoice for that Subscription, which will be created when the next $10 payment is due, meaning $30 total will be due at that time.

#

That would be the fourth Invoice.

#

The fifth Invoice would not be impacted; it will be for $10 again.

sudden solar
#

But I'm saying using the subscription.modify endpoint

#

Plus, I just tested using the subscription.retrieve, and the single payment doesn't show up in the items (data)

robust plume
#

That's not how it works.

#

You add an Invoice Item to the Customer, you don't modify the Subscription.

#

When the Subscription generates the next Invoice outstanding Invoice Items on the Customer will be swept up and included on that Invoice.

#

Thus you'll have a single Invoice with the normal Subscription charges plus the one-time item you added.

sudden solar
#

I think there is a misunderstanding

#

I'm not really asking HOW to do it. I'm asking, if we use the subscription.modify endpoint is it POSSIBLE to add a single time payment

#

If not, that's OK because then the assumption that all items have to have the same interval is fully correct.

robust plume
#

Not using that endpoint, no. Why would you be limited to using that endpoint though?

#

Oh, wait!

#

But it sounds like you're really asking if you can add something using the items parameter? I'm not sure why though?

sudden solar
#

Well. In our use case we plan on modifying the whole subscription to add or remove items.

They need go be all the same interval as the endpoint rejects things otherwise.

#

So I have a validation method that makes sure things are the same interval.

robust plume
#

Okay, but why? What are you trying to do at a high level?

sudden solar
#

Take from our database and update stripe accordingly.

#

Basically, if we want to allow for single time payment items, we need to add extra logic to add them too

#

Rather than just assuming we can use the subscription modify

robust plume
#

Sure, I guess? You would need new logic regardless of what endpoint you used?

sudden solar
#

I guess to clarify

#

I have a method that validates our abstracted items

#

Loops over each one and makes sure they are the same interval.

#

So if we COULD pass items into subscription modify that are both monthly and single time payment, then the validation needs to account for that.

However, in this case, the validation just needs to make sure that all items are monthly (or some other same interval)

#

Does that make sense?

robust plume
#

If you're specifically talking about setting/modifying the items parameter when modifying a Subscription, yes, that makes sense.

sudden solar
#

Right. Additionally, when we retrieve the subscription back from the subscription retrieve, we can assume that the items will all have the same interval (and not having a single time payment)

#

And thus we need some other method to get them

robust plume
#

Again, if you're talking about the items in the Subscription's items property, that is correct.

sudden solar
#

Sorry. I know that was confusing

robust plume
#

No worries! We're here to help, and making sure you have the right info and understanding is part of that. 🙂

sudden solar
#

One last question

#

So I basically would need to get the invoice items if I want to capture the single time payment items as well

robust plume
#

Yes.

sudden solar
#

Should I grab the next pending invoice?

robust plume
sudden solar
#

Ah that's good thanks