#ael
1 messages · Page 1 of 1 (latest)
I think you can update them using this API endpoint: https://stripe.com/docs/api/charges/update#update_charge-metadata
I tried, but I got a response of "No such charge"
I don't see a way to update the payment only the transfer.
const transfer = await stripe.transfers.create({
amount: Number((parseFloat(invoiceAmount) * 100).toFixed(2)),
currency: 'usd',
destination: accountId,
metadata: {
shoot_id: compact(shootId).join(", "),
shoot_company_date: compact(shootName).join(", "),
representative: compact(repName).join(", "),
solo_invoice: compact(invoiceId).join(", ")
},
});
That creates the transfer with the metadata.
Right, but can you supply the py_ to the Transfers Update API? I thought you could, but your initial question led me to believe you tried that already
Oh.... I did not try that.
Okay, let's try that first. I think that's the actual intended path for those objects, as they represent inbound transfers
"No such transfer" 😦
I'm using the destination_payment prop from the create Transfer response.
Okay, let me see. Just a minute
I think you have to get the source_transfer from the py_ in this case and use the metadata you set from that Transfer instead. I don't think there's a way to update this on the py_ itself.
If that doesn't work, can we back up a little bit and talk about what you're actually wanting to do with metadata on the py_? Is there a reason the metadata from the Transfer cannot be used?
When our customer receives a payout they need to see the metadata from the transfer on the payment.
Otherwise they don't know what it is for.
I do want to use the exact same metadata form the Transfer
Here is a transfer with Metadata. I want to have that same metadata end up on py_1MRh0TCiTgaUmHZK1Hg1x8Lc
Hello! I'm taking over and catching up...
The original approach suggested above (https://stripe.com/docs/api/charges/update#update_charge-metadata) should work to update the metadata on any py_ object. However, because the py_ object exists on a connected account you need to make a Connect API request to update the metadata: https://stripe.com/docs/connect/authentication
Okay... Is the destination prop on the Transfer response the correct account ID to use.
Yes.
Thank you for your help.
Did that work? Were you able to update the py_ object's metadata?
Trying to get the syntax right -- I'll report back.
Sorry, I'm not quite understanding the doc. Do you have an example of what I need to do?
Hi there. What exactly don't you understand? You will need to pass the Stripe account header to make the request on your connect account, so you'll need:
{stripeAccount: '{{CONNECTED_ACCOUNT_ID}}'}
But a py_123 id is, for all intents, the same as a ch_123 id, so you can use this api call: https://stripe.com/docs/api/charges/update?lang=node#update_charge-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.
If you look to the right at the above link, you can see an example call. You just need to make sure you're passing both metadata and the stripe account header
const charge = await stripe.charges.update(
'ch_1IsGLLEBp2JLhp8ECyfY5xhg',
{metadata: {order_id: '6735'}},
{stripeAccount: '{{CONNECTED_ACCOUNT_ID}}'
);
like that but with the py_ instead?
correct
Thank you - that worked.