#nathan_webhooks
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/1267821920745689119
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi, let me help you with this.
py_ is usually the transactions on the Connected account, which come from Transfers from the Platform.
But transfer.created event type always contains a Transfer, so you should never see a py_xxx object in it.
Indeed I don't see a py_xxx object in the transfer.created body.
I see the py_xxx ID in the transfer_group property of the event (as you can see on the screenshot)
transfer_group can be an arbitrary string value that you provide yourself, or is generated automatically. You shouldn't refer to it except for matching to other transfer_group values
In my case it is generated automatically and according to the docs (https://docs.stripe.com/connect/separate-charges-and-transfers?platform=web&ui=stripe-hosted#transfer-availability) it should have the following shape: group_pi_xxxx
Again, it shouldn't matter for your integration. You need to expect an arbitrary string. What are you using it for exactly?
Indeed it makes sense
I'm using the paymentIntend ID
- to retrieve the paymentIntent object
- access the invoiceId of the paymentIntent object
- retrieve the invoice to get its tax rate
If there is a more robust approach to get the tax rate I'd be glad to use it
You should be able to use out Expand function,https://docs.stripe.com/api/expanding_objects when you retrieve the PaymentIntent, https://docs.stripe.com/api/payment_intents/object#payment_intent_object-invoice to expand the invoice to attain the data.
Thanks for the docs.
However I'm looking at an other approach to avoid using the paymentIntent ID int he first place.
I'm getting the paymentIntent ID from the transfer_group property of the transfer.created event. @wanton pagoda told me that I shouldn't use the transfer_group property as the value can be arbitrary.
So my problem is the following:
How can I get an invoice from the data of a transfer.created event?
Thanks for your help
Thank you for privding this context. Given that you're attempting to get more granular data from the invoice, you'd want to use the PaymentIntent ID and use the expand function to expand the invoice to get the tax data.
Indeed, but how can I get the PaymentIntent ID if I cannot read it from the transfer_group?
You can track that on your end
Could you elaborate more please?
You're using Separate Charges and Transfers. Before you make the request to Transfer the funds, you can keep track of what payment intents/invoices are 'included' in that transfer. Then you have that data to inspect the tax rates on those invoices.
I'm not manually creating the Transfer. I'm updating the Subscription object with a transfer_data property and then Stripe sends me a transfer.created event automatically
You already have the subscription object so I think getting the tax information before you even make the transfer makes sense here. For instance, you can listen to invoice.paid event and inspect the tax data from there. Then, you create the transfer.