#ian-goldberg_error

1 messages ¡ Page 1 of 1 (latest)

hearty haloBOT
#

👋 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/1412428624757391431

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

hexed kernel
#

Hey there, where did you get the il_tmp_123 id from initially?

supple lantern
#

hey i just went to the dashboard, tried to delete a proroation invoice line item, and it said the line item doesnt exist

hexed kernel
#

I suspect this is on a preview of an upcoming invoice, and is not a real object you can delete

supple lantern
#

yeah it is -- so how do i delete unwanted prorations?

hexed kernel
supple lantern
#

sub_1S2YngGOiDu6jfguJgLynTE8

#

so if a bunch of subscriptions were accidentally updated with a proration behavior, and i meant to do none, what can i do?

hexed kernel
#

I see three subscription item calls adding items to this sub after creation. What was the result you were trying to achieve / what do you want to end state to be?

supple lantern
#

Really like this. But it happened to more than one subscription. 164 total i think.

hexed kernel
#

On this example sub, it appears that the initial invoice in_1S2YngGOiDu6jfguq3xToVso is still unpaid

supple lantern
#

happy to handle it via API if possible

hexed kernel
#

What do you want to happen with the existing initial invoice? Are you saying you want the new items invoices at the renewal at the end of the period, or right away?

supple lantern
#

let me give backstory.

We have a stripe account that was handling two types of customers, and im trying to migrate one type of customer to a dedicated stripe account. Lots of nuances with it

#

I think the open invoices on the account, i will mark as void since we cant delete them

#

the first billing period should be sept 1 - oct 1, billing at oct 1

hexed kernel
#

If these are all on new subscriptions, you might be better of cancelling and re-creating to get the billing period you want.

supple lantern
#

i created them all via the API and set the backdate start to be sept 1 at midnight UTC and set billing anchor to be oct1 midnight UTC.

That seems correct?

#

Example:

{
"auth": {
"none": null
},
"follow_redirect": false,
"follow_keep_method": false,
"reject_unauthorized": true,
"follow_authorization_header": false,
"parse_response": "true",
"status_code": {
"range": {
"from": 200,
"to": 299
}
},
"case_sensitive_headers": false,
"url": "https://api.stripe.com/v1/subscriptions",
"headers": [
{
"key": "Authorization",
"value": "Bearer xxx"
}
],
"queries": [],
"body": {
"form_urlencoded": {
"metadata": {
"type": "Partner",
"partner_id": 2373
},
"customer": "cus_SyVpIztlUIjpZ0",
"days_until_due": 10,
"items": [
{
"price": "price_1RqyBMGOiDu6jfguBTxVdQ6E",
"quantity": 0
},
{
"price": "price_1RqyjoGOiDu6jfguRL4j02Bb",
"quantity": 1
}
],
"off_session": true,
"payment_behavior": "error_if_incomplete",
"collection_method": "send_invoice",
"billing_cycle_anchor": 1759276800,
"backdate_start_date": 1756684800
}
}
}

hexed kernel
#

The billing anchor is for setting the next invoice cycle, but with backdating you're still invoicing for the prorated september period

#

Are you saying you don't want the prorated lines for september at all?

#

And you only want to start invoicing/charging Oct 1?

supple lantern
#

i want to create the subscription with existing data that was on subscription in the old account's equivalent subscription. No prorations here. And then over the course of the month the subscription may change and those changes MAY incur prorations

hexed kernel
#

Hmm I was going to suggest creating with a trial using trial_end set to Oct 1, to defer payment until then, but that wouldn't let you optionally prorate other changes

supple lantern
#

yeah i considered that route, but didnt go with it because of what you said

hexed kernel
#

If you use for backdate to Sept 1, anchor set to Oct 1, using proration_behavior=none, do you get an initial invoice like you want?

supple lantern
#

well it seems like it generates an invoice due on sept 11th, which i dont want

#

i want first invoice to be oct 1

#

because the old stripe account has the invoice from sept 1

hexed kernel
#

The prorated changes before the new sub starts is a temporary/transient condition, right?

#

I'm thinking that either using the trial approach or a subscription schedule to set up the Oct 1 start is the way to go for a clean cutover.

but then you'll need to manage prorated changes during that period manually adding invoice items to the customer to get invoices with the next renewal

supple lantern
#

what will happen is we start with x quantity of a price on the first of the month, and then throughout the month the quantity will change and we prorate

#

i was really trying to cut over sept 1 to this new account.

in the dashboard i can create a subscription that starts sept 1 and first bills oct 1, and i think thats what anchor and backdate does, but maybe i am wrong?

hearty haloBOT
supple lantern
#

Example post body that is made from dashboard:

{
"backdate_start_date": "1756684800",
"billing_cycle_anchor": "1759276800",
"billing_mode": {
"type": "classic"
},
"collection_method": "send_invoice",
"currency": "usd",
"customer": "cus_SuM9aBX8HYBpzG",
"days_until_due": "10",
"invoice_settings": {
"send_hosted_payment_email": "false",
"supported_payment_methods": {
"affirm": "true",
"amazon_pay": "true",
"card": "true",
"us_bank_account": "true"
}
},
"items": {
"0": {
"price": "price_1RyXWHGOiDu6jfgu592fkmXT",
"quantity": "1"
}
},
"off_session": "true",
"payment_behavior": "error_if_incomplete",
"proration_behavior": "none"
}

hearty haloBOT
fiery carbon
#

hi there, taking over this thread, give me a minute to catch up

supple lantern
#

thanks

fiery carbon
#

looking at your requirements, I think that synthrider has given the best options that we currently have

supple lantern
#

does the API from dashboard not translate to my usecase to use outside of dashboard?

#

trying to figure out if i need to manually create 164 subscriptions.

fiery carbon
#

can you send me two different subscription IDs, one created with the dashboard that's working for you and one created with the API that isn't? that way I can compare

supple lantern
#

This was created via dashboard and got results i wanted: sub_1RyazPGOiDu6jfguidoGyzFN

#

via API: sub_1S2YnHGOiDu6jfgugpMqtGBT

fiery carbon
supple lantern
#

erm use this one:

#

sub_1S2v0CGOiDu6jfguywTtaavf

fiery carbon
#

ah ok. yeah, that one was created with proration_behavior: none

#

while the API didn't pass a proration_behavior, so it defaulted to create_prorations

supple lantern
#

i think what im not understanding is this:

  • When i create via dashboard, the first invoice is Oct1.
  • When i create via API it immediately generates an invoice, due in 10 days, and then has upcoming for oct 1
#

when i create the subscription, i dont want to invoice until oct1.

#

if its not possible, then i guess ill re-create the subscriptions with proration_behavior = none and then mark all the sept 1 invoices as null

fiery carbon
#

both of them should generate an invoice due in 10 days, let me look into that a bit

supple lantern
#

thanks

fiery carbon
#

ok yeah, you're right, if I make an API call with those exact parameters from the dashboard call, it does not generate an invoice. so it likely comes down to the proration_behavior setting

supple lantern
#

what can i do to emulate dashboard via API?

fiery carbon
supple lantern
#

hm what was i missing then

fiery carbon
#

proration_behavior: none

supple lantern
#

hmm @fiery carbon i created via API and seems to have generated the initial invoice sept 1 due sept 11th

sub_1S2w3IGOiDu6jfguqXh5tyUy

#

actually nvm! those are old ones that are open

#

thats great. thanks for your help

#

i just have to mark current open invoices as void