#redbluesock_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/1416030769276784690
๐ 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.
- redbluesock_api, 1 hour ago, 10 messages
๐ happy to help
a credit note can refer to many refunds so in order to get the one that is related to the refund of the charge in question you would still need to do the same steps
charge -> list invoices of payment intent -> list credit notes for invoice
but then you would need to loop over them and check whether therefundslist has any object in them with the refund ID from that event you shared https://docs.stripe.com/api/credit_notes/object?api-version=2025-05-28.basil#credit_note_object-refunds-refund
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hi, google pay not showing in my embedded checkout even I opened it up, how can I debug or solve this problem?
@slate pulsar looks like you're in the wrong place, this thread is for someone else's question.
- If you have your own thread please chat there.
- If you have a question or a followup to a closed thread use one of the buttons in https://discord.com/channels/841573134531821608/842637025524842496 to get help (we don't reopen closed threads).
Note that posting inappropriate messages in other people's threads is against the rules. No worries if this was just an honest mistake, but anyone who violates the rules multiple times will be removed from this server.
sorry i am new here, so where can I issue my problem?
@slate pulsar If you have a question or a followup to a closed thread use one of the buttons in #help to get help (we don't reopen closed threads).
Okay, I'll try: charge event -> get invoice based on charge.payment_intent AND get refund based on charge.id and/or charge.payment_intent -> get credit notes based on invoice.id and filter by refund.id.
I think this sounds plausible. If you don't have any objections I'll try this and ask again if I need further help.
Thank you very much!
sure
@waxen maple unfortunately this doesn't seem to work. It seems like there's a charge 1-* refund relationship.
When getting refunds based on charge.id or payment.intent I get
{
"object": "list",
"count": 2,
"data": [
{
"id": "re_3S5NbaINxfzIe4Tv0nzbGpJw",
"object": "refund",
"amount": 122451,
"balance_transaction": "txn_3S5NbaINxfzIe4Tv0qN2gctL",
"charge": "ch_3S5NbaINxfzIe4Tv0QmmzWey",
"created": 1757677131,
"currency": "eur",
"destination_details": {
"card": {
"reference": "5155730866824802",
"reference_status": "available",
"reference_type": "acquirer_reference_number",
"type": "refund"
},
"type": "card"
},
"metadata": {},
"payment_intent": "pi_3S5NbaINxfzIe4Tv0M4pGXbc",
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": null
},
{
"id": "re_3S5NbaINxfzIe4Tv02XoYsCl",
"object": "refund",
"amount": 5950,
"balance_transaction": "txn_3S5NbaINxfzIe4Tv08BUqHUK",
"charge": "ch_3S5NbaINxfzIe4Tv0QmmzWey",
"created": 1757677113,
"currency": "eur",
"destination_details": {
"card": {
"reference": "3900606290041274",
"reference_status": "available",
"reference_type": "acquirer_reference_number",
"type": "refund"
},
"type": "card"
},
"metadata": {},
"payment_intent": "pi_3S5NbaINxfzIe4Tv0M4pGXbc",
"reason": null,
"receipt_number": null,
"source_transfer_reversal": null,
"status": "succeeded",
"transfer_reversal": null
}
],
"has_more": false,
"url": "/v1/refunds"
}
So I still can't identify for which refund/credit note this charge.refunded object is or do I miss something?
I'm not sure I understand where were you stuck
would you mind sharing the IDs (not the whole objects) from start to end?
Yes sure, give me moment.
I mean in each step what object you're using as input and what you're getting
I get the following object via webhook: ch_3S5NbaINxfzIe4Tv0QmmzWey (Event: evt_3S5NbaINxfzIe4Tv0zxJffTd).
Then I use the charge.payment_intent (pi_3S5NbaINxfzIe4Tv0M4pGXbc) to query /v1/invoice_payments and get the invoice (in_1S5NboINxfzIe4Tvambr7YUz).
The invoice ID is used to get the credit note(s) via /v1/credit_notes which results in multiple entries (cn_1S6VJXINxfzIe4TvNW761Hqo, cn_1S6VJEINxfzIe4TvHDhhuWOG).
Furthermore I query /v1/refunds to geht the refunds for the charge.id (ch_3S5NbaINxfzIe4Tv0QmmzWey) but this also results in multiple entries (re_3S5NbaINxfzIe4Tv0nzbGpJw, re_3S5NbaINxfzIe4Tv02XoYsCl).
Since /v1/credit_notes and /v1/refunds give me 2 results each, I can't map my initial charge to only one credit note.
Furthermore I query /v1/refunds to geht the refunds for the charge.id (ch_3S5NbaINxfzIe4Tv0QmmzWey) but this also results in multiple entries (re_3S5NbaINxfzIe4Tv0nzbGpJw, re_3S5NbaINxfzIe4Tv02XoYsCl)
you shouldn't do that
you should get the refund id from the event
ie evt_3S5NbaINxfzIe4Tv0zxJffTd
oh sorry just saw the API version you're using
so the refunds list won't be returned
but what you can check is the amount of the refund right?
in the event you have the previous_attributes with the amount_refunded
which is the amount of the previous refunds. and you can filter which refund is in question by doing amount.refunded - previous_attributes.amount_refunded
which gives you the amount of the refund in question
and then you can filter the refunds list
Since /v1/credit_notes and /v1/refunds give me 2 results each, I can't map my initial charge to only one credit note.
but that's expected since you can have multiple refunds on the same charge, and each credit note can have multiple refunds coming from different charges