#Hamza-Metadata
1 messages · Page 1 of 1 (latest)
Hi! Can you share the request ID (req_xxx)? Here's how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center 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.
Hamza-Metadata
Thanks for the ID. I can see that you have successfully attached metadata to both the checkout session object and the paymentIntent object.
the problem i'm having is that, metadata isn't showing up in transfer object or the connected account payment object
The transfer is a different object, and that's why the metadata is not there.
You need to explicitly set the metadata on this Transfer object.
okay can you guide me about that?
The first step is to get the id of the transfer associated with the charge which is in the transfer property on the charge object. Then, you can call the Transfer update API to update its metadata (https://stripe.com/docs/api/transfers/update?lang=php#update_transfer-metadata)
isn't there a way to directly attach metadata at the time of creating the transfer?
You mean at the time when you create the destination charge?
yes you can see the code in the initial picture.
Not possible, CheckoutSession API doesn't have a param for you to propagate the metadata to a transfer object.
okay but what about the connected account payment object?
is it possible to attach metadata to that?
Sure you can do that
Once you've retrieved that transfer and you’d see the destination_payment property corresponding to the payment on the connected account (py_XXX).
You can get all of this in one API call by using the expand feature and passing transfer to get the transfer property expanded in the response. This gives you access to the payment id (py_XXX) directly in that API call.
Then, once you get this, you’d call the Update Charge API using the Stripe-Account header so that you can set the description or metadata you want on that payment.
I retrieved the payment id of the connected account but i'm still unsure as to how i can update the metadata to this payment.
?
You call the Update Charge API using the Stripe-Account header so that you can set the description or metadata you want on that payment.
The payment object is created in the connected account, and that's why you need to use the Stripe-Account header https://stripe.com/docs/connect/authentication
is this possible with php? the documentation you provided don't have php example
Yes, it's available in all language, you can select the PHP example code in the same page
Thank you for your help. Issue has been resolved.
No problem!
one more thing is there a way to directly access transfer id from payment intent id?
or will i have to access the charge data to get the transfer id?
you need to access charge first and get the transfer ID from the charge object
okay thanks.