#marcus_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/1397891888618541087
📝 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.
- marcus_api, 1 hour ago, 55 messages
- marcus_api, 18 hours ago, 43 messages
- marcus_api, 1 day ago, 27 messages
- marcus_api, 1 day ago, 34 messages
Two days ago, as a test on prod, I paid my own subscription:
stripeEventId": "evt_1RnlVgAfQ68zM8anRC6TCfWO" - I paid 14 Dollar plus 2 266 cents of tax. tax_rate": "txr_1HwVi5AfQ68zM8anHf3Zr456"
Then, for testing, I made several refunds formt eh stripe dashboard, of 1 USD and tried to create a credit note for it, automatically from my backend.
Todau, I created the refund: evt_3RnlVbAfQ68zM8an0XUuPKRQ
Then, the credit note was created, but it does not state any tax? How can this correct? Whenever I do a refund, then legally, there should also be tax involved, in case the customer did pay tax.. which I did originally.
"evt_1Ro9jjAfQ68zM8anrkQYUTSG"
Two days ago, as a test on prod, I paid my own subscription:
stripeEventId": "evt_1RnlVgAfQ68zM8anRC6TCfWO" - I paid 14 Dollar plus 2 266 cents of tax. tax_rate": "txr_1HwVi5AfQ68zM8anHf3Zr456"
Then, for testing, I made several refunds formt eh stripe dashboard, of 1 USD and tried to create a credit note for it, automatically from my backend.
Todau, I created the refund: evt_3RnlVbAfQ68zM8an0XUuPKRQ
Then, the credit note was created, but it does not state any tax? How can this correct? Whenever I do a refund, then legally, there should also be tax involved, in case the customer did pay tax.. which I did originally.
"evt_1Ro9jjAfQ68zM8anrkQYUTSG"
- evt_1RnlVgAfQ68zM8anRC6TCfWO
- evt_3RnlVbAfQ68zM8an0XUuPKRQ
- evt_1Ro9jjAfQ68zM8anrkQYUTSG
Sorry, I'm not sure what part of the credit note you want to update exactly ?
Are you looking for this API?
https://docs.stripe.com/api/credit_notes/update
hi! I'm taking over this thread.
you wrote a lot of words, and some of it seems to be duplicate. so it's hard to follow.
you want the refunds to include tax? what does that mean concretely? can you share a concrete example of what you were expecting to see, and what you saw instead?
I gave a refund from the ui to a customer that is marked as tax required. So he paid instance 100usd plus 19% tax. That makes 119 usd.
Now if I give him a full refund of 119 usd in the stripe dashboard. There is just an amount no field for tax or whatever... It's the gross amount as far as I know...including the tax
Right?
Now if I give him a full refund of 119 usd in the stripe dashboard. There is just an amount no field for tax or whatever... It's the gross amount as far as I know...including the tax
are you talking about the Refund object itself? If so, yes it has an amount property: https://docs.stripe.com/api/refunds/object?api-version=2025-05-28.basil&lang=curl#refund_object-amount
Then I create a credit note referencing the refund. I want to link them, I want to "encapsulate" the refund with a credit note
So if the refund is gross. And the credit note shows tax .. I would expect to see like 100 usd plus 19 tax
But it did not work this way. In the above examples... I did follow these steps as described. Just I used partial refunds.. But I would expect that to behave in exactly the same way regarding the tax amounts
I gave 1 dollar refund and this created a credit card for note of 1 dollar without any tax... But what should my tax accountant do with that? So the customer paid one dollar less so also less tax is due...
But I would expect that to behave in exactly the same way regarding the tax amounts
Again, can you share a concrete example? Like a specific Credit Note you created, and then highlight which part is "wrong"?
I did
Right in the ticket description
3 event ids
Why do we create them if no one reads them?
can you share just one ID, so we can look at it together?
It's a process
and why are you sharing Event ID? I thought the issue was the Credit Note itself?
Not just one event
Well the event Id is what I see in the webhooks
So I hope it will allow you to find it
ok. so looking at thte first event you shared: evt_1RnlVgAfQ68zM8anRC6TCfWO
what is the issue exactly here?
evt_1RnlVgAfQ68zM8anRC6TCfWO, evt_3RnlVbAfQ68zM8an0XUuPKRQ, evt_1Ro9jjAfQ68zM8anrkQYUTSG
this is the start. no issue yet. It just shows how the customer bought a service
and it includes tax
19%
right
yes I see
there in the stripe dashboard, you are asked for the amount, the total amount including tax
so I said 1 USD
since that must be GROSS
I would epect it to be something like 95 cents or so plus 15 cents tax or so
there in the stripe dashboard, you are asked for the amount, the total amount including tax
you mean when you create the Refund?
(math is wrong but I hope you get it 🙂 )
yes
and then.. there is a lonely refund
and my processes requires credit notes
so I wrote some code that is suppoed to mantel the refund into a credit note to fix that
well teh credit note is the last event
it also has no tax amounts shown
and the credit note that results in.. also shows no tax
@ApplicationScoped
public class RefundHandler implements StripeEventHandler {
@Inject
StripeCreditNoteEnsurer creditNoteEnsurer;
@Override
public void handle(StripeObject stripeObject) {
creditNoteEnsurer.handle((Refund) stripeObject);
}
@Override
public StripeEventType type() {
return REFUND_CREATED;
}
}
then..
public void handle(Refund refund) {
String refundId = refund.getId();
String invoiceId = findInvoiceIdForRefund(refund);
if (!creditNoteClient.existsForRefundOnInvoice(refundId, invoiceId)) {
creditNoteClient.createCreditNote(refund, invoiceId);
}
}
/////
can you try to create the Credit Note not based on the Refund object, but the specific Invoice Item you want to refund using the lineproperty? https://docs.stripe.com/api/credit_notes/create?api-version=2025-05-28.basil&lang=curl#create_credit_note-lines
Hm. But that's the whole idea here?
What should I do with the refund?
I can't kill it can I?
I don't really get your last question, sorry.
OK so a refund means - for whatever reason just give back some money to the customer
Right?
like you said earlier, a refund doesn't have any "tax" information, only an amount. so if you create a credit note based on a refund, I think that's expected that the credit note doesn't use tax.
And the credit note is the proper way to bring the amount credited into a proper accounting context
Not so sure as...as you can see in my code, I gave it all the required tax info and it accepted that
Here's your requet to create the Credit Note: https://dashboard.stripe.com/logs/req_JdCttEhY3PWuoo
You only gave it a Refund object. Instead can you try setting the line peoperty with a specific Invoice Item?
Yes, you’re right. With the invoice ID, which I also have, I can create a new credit note. And I’m sure that would work just fine. But that’s not what I need in this case.
In our example, the customer bought a product for 100 dollars plus 19 dollars tax – so a gross amount of 119 dollars. Let’s say I want to give a refund, for example 19 dollars – that would be 10 dollars net plus 9 dollars tax – then I refund 19 dollars.
If I now create another credit note for 19 dollars, the customer ends up getting 38 dollars back – two times 19. That would be too much.
And if I do a full refund – meaning I give the full 119 dollars back – then there’s no credit left. In that case, I couldn’t create a credit note anymore.
What I actually want: I should never have made a refund without a credit note. Unfortunately, that keeps happening to me in your UI, because your interface is a bit confusing. At least for me.
Now I want to fix this: If this ever happens again – either to me or one of my team members – I want to detect through the webhook that a refund was made, check whether there’s a credit note for that refund, and if not, I want to automatically create one afterwards. This credit note should act like a kind of wrapper – a protective layer around the refund – so that I can properly and legally handle the refund in my invoicing and accounting systems.
you can always use metadata to link the Credit Note to the original Refund.
The credit note should be done just for tax and account and invoicing reasons. No further money should be given to the customer. Just acting as a virtual wrapper
Will the credit note then physically credit further money to the customer or realize that it is already settled by the refund?
the metadata would have no impact on the actual logic, it's just for you to track things.
It should only be a logical wrapper for legal reasons
so the credit note may update the customer balance to give them some money back. but you can always undo that by directly re-setting the customer balance to 0.
That sounds like a hack?
which part? resetting the customer balance?
you are trying to "fix a mistake", so what I suggested is a way to fix that mistake.
But back to my original question... Why can I set up everything as I did... And still it's not working properly?
Because if that would just be working.... All would be perfect. Otherwise I would expect an exception telling me that this won't work and I would have to look for alternatives
Why can I set up everything as I did... And still it's not working properly?
I'm not sure I follow your question. can you clarify?
Why can I create a refund that obviously includes tax and attach it to a credit note which is missing the tax
Seems like a bug to me
if you want to send a feature request, you could using Stripe support: https://support.stripe.com/contact
This is not answering my question. It seems you don't know?
no I'm not very familiar with this API. did you saw a different behavior in the past?
no, I am implementing this just now
how can you not be familar with the stripe api but work here?
I am familiar with the Stripe API, but not very familiar with the Credit Note API.
hm.
Is there someone who does? Becaue if you dont knwo the credit note api.. then you can't possibly help me here, I guess?
Hi can you please help me here?
@lucid cloud please contact https://support.stripe.com/?contact=true
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
actually, it seems that you already did
and someone is looking into your issue as we speak
if you don't mind I will close this thread and we'll get back to you with a response as soon as we have one