#theory_invoice-manual

1 messages · Page 1 of 1 (latest)

fierce quartzBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1253364110649987214

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

tropic swallow
dim hull
#

We don't use the Subscription API, though. Only the Invoice APIs.

#

(We have our own way of managing subscriptions, we just use Stripe for the invoice)

tropic swallow
#

Sorry

#

Moving too fast and am handling a lot of threads

dim hull
#

no worries!

tropic swallow
#

Ok so do you want the user to be charged for the proration on their renewal date? Or do you want the proration to be billed immediately?

dim hull
#

On their renewal date

tropic swallow
#

Got it. For prorations, I would just create a separate invoice item for them. No need to create a new price object. You can just pass amount in: https://docs.stripe.com/api/invoiceitems/create#create_invoiceitem-amount. I think managing that many price objects would be kind of messy, and if I were you I'd only create prices objects for the actual items you're billing for and handle prorations with additional invoice items w/ amount

dim hull
#

I see. So, for our prorated line items, we basically can't use price parameter, we need to use e.g. amount / description ?

tropic swallow
#

You don't have to

#

You can use price if you want

#

I just recommend passing in amount so you don't have to manage all those prices

dim hull
#

so like, if my price ID is price_foobar and it's configured as $100/year, what kind of API request would I construct to create a prorated invoice item?

#

if I do this API request, I'll get an error:

curl https://api.stripe.com/v1/invoiceitems \
-u sk_test_whatever \
-d invoice=in_xyz \
-d customer=cus_xyz \
-d price=price_foobar \
-d amount=5000 \
-d currency=usd

leads to

{
  "error": {
    "message": "You may only specify one of these parameters: amount, price.",
    "param": "amount",
    "request_log_url": "https://dashboard.stripe.com/test/logs/req_xA0QmRqe3t9OU4?t=1718896883",
    "type": "invalid_request_error"
  }
}
#

I'd have to either:
(a) create a special price for $50, since that's the prorated amount in this example
(b) remove the price param and use the description param instead

fierce quartzBOT
tropic swallow
#

Yeah you don't pass both amount and price

#

Just for the prorated invoice item

dim hull
#

Yeah that’s what I figured too. There’s not a way to link it back to the original Product / Price objects, so our data is messy.

tropic swallow
#

You could set the description

#

So it's clear what price you're prorating

dim hull
#

Right, yeah. That gets our invoice to look correctly, but when the data syncs (e.g. to Salesforce or NetSuite) it'll be dirty

tropic swallow
#

You could also use metadata

lethal tiger
#

theory_invoice-manual

dim hull
#

Ok, yeah that's what I had thought too. Thanks, I think you answered all my questions.