#josula_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/1331669366185660428
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- josula_api, 6 days ago, 18 messages
Hello! Have you tried updating the custom_fields on the Invoice? I don't think that will work, but I want to make sure you've ruled it out as an option: https://docs.stripe.com/api/invoices/update#update_invoice-custom_fields
Yes we tried that first thing. Does not work because the invoice is paid / finalised
Maybe footer? But yeah, I doubt what you want to do is possible, really...
Do you have an idea how we could restructure our checkout flow to make this happen?
Well, wait, here's a thought... not sure if this will work, but maybe try creating a $0 credit note with a memo or something for the Invoice? https://docs.stripe.com/api/credit_notes
I don't think so, but you said you tried it, right? The PDF was unchanged?
type: 'StripeInvalidRequestError',
raw: {
code: 'parameter_missing',
doc_url: 'https://stripe.com/docs/error-codes/parameter-missing',
message: 'Missing required param: amount or lines or shipping_cost.',
param: 'amount or lines or shipping_cost',
request_log_url: 'https://dashboard.stripe.com/test/logs/req_TPEM2aE3idfGzJ?t=1737565430',
type: 'invalid_request_error',
headers: {
This is what I get when I try to create a credit note for the invoice like this:
const creditNote = await stripe.creditNotes.create({
invoice: invoiceId,
memo: `Order ID: ${order[0].display_id}`,
});
What if you set amount to 0?
๐ค
Well, it's probably not a viable path forward anyway, and would be a bit of a hack. Let's go back to the core problem...
Ok mhmm
Let me type something out...
ok
So this is your current flow:
- Customer clicks "buy now"
- We create the customer in stripe
- We create a new invoice
- we add the items to the invoice
- we finalise the invoice to receive the payment intent
- we pay the payment intent with the chosen payment method from the customer
- we placeOrder in our shopsystem and redirect to "Order has been successful".
What if instead of creating the Invoice at step #3 you instead created a Payment Intent for the amount due instead? Then you could get that Payment Intent paid, at which point you could add the amount to the Customer's balance. Then you'd create the Invoice with the order number on it and pay it. The Customer's balance would automatically be used on their next Invoice.