#sumeet_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/1298970484951748618
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Generally if you're applying a credit for an invoice you'd assign the line item ID on creation: https://docs.stripe.com/api/credit_notes/create#create_credit_note-lines-invoice_line_item
And that would infer a relationship to the Proice/Product of that item
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I thought of that,
But for that I should have an invoice item linked to that product price in that invoice, right?
Which in my case I does not have
Yes, you'd need that
Otherwise you cannot directly tie the Credit Note to a Product no
You'd just need to reference it in metadata or something: https://docs.stripe.com/api/credit_notes/create#create_credit_note-metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This is the case in detail.
I have a subscription based model, where customer is charged at the end of month. But for security reasons we charge account deposit at the start of month. This account deposit is linked to a product. And when customer cancelled the subscription we need to return that account deposit in last invoice and this negative invoice item should be linked to account deposit product.
Do you have any way in stripe to achieve this?
Product linking is necessary for accounting purpose
If you're using a Subscription then there is likely an invoice that references a prod_xxx ID
Can you share the ID of the subscription or something?
This account deposit is linked to a product
An example of how you charge this too
Sure
2 min
cus_R4pGwvYTJXzGsb
in_1QCfbXHJgsdx4qPxrMU0Beco
This is the invoice where we charge account deposit
This item: Account Deposit?
Yes
Does have a Product association (prod_MIsjqGB1lY8Ny4). So why can't you just use that line item ID when creating the Credit Note?
And that will infer the association as I noted
Sorry
I may not be clear.
Above invoice is first invoice of customer where we charge account deposit
This invoice is the last one where we need to refund that amount.
in_1QDPVMHJgsdx4qPxdQFBPBhi
OK, but you mentioned creating a Credit Note which will apply a credit for the refund
Otherwise, you can't 'refund' an item via a negative line item if you mean returning the funds back to the customer's payment method
If you want to refund the payment then you'd use the Refunds API: https://docs.stripe.com/refunds?dashboard-or-api=api#issuing
And you can use a Credit Note on the new invoice (as I described) to reflect that refund for accounting purposes
If you see this last invoice, there is a line item called prepayment credit refund, I want that to be linked with the same product "account deposit",
It may be credit note or invoice item. What we need a line in invoice linked to that product, which currently I am not able to
Ok
Is it possible to create credit note on the last invoice linked to invoice line id from the first invoice ?
hi! I'm taking over this thread.
Is it possible to create credit note on the last invoice linked to invoice line id from the first invoice ?
A credit note can only apply to one Invoice. It cannot reference a different Invoice.
Ok
So there is no way I can have a negative amount line item in an invoice linked to a particular product unless I have a positive amount line item linked to that product in same invoice , right?
that's my understanding yes.
Thank you, @leaden knot and @tawdry sundial for the deep dive into my query. I really appreciate it.