#remrem_balance-transactions

1 messages ¡ Page 1 of 1 (latest)

steep coralBOT
#

👋 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/1220420597256028182

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

grim shadowBOT
mystic pasture
#

Hello! If you list the Balance Transactions and expand 'data.source' you should see the charge/payment that generated that balance transaction and I belive that'll include your metadata. You can read more about metadata at https://docs.stripe.com/expand if you haven't worked with it yet

Learn how to reduce the number of requests you make to the Stripe API by expanding objects in responses.

terse galleon
#

even with data.source it return me the same
{
id: 'txn_1OwnZkQsyM1cbkpxwg5eWYZO',
object: 'balance_transaction',
amount: -2300,
available_on: 1711035039,
created: 1711035039,
currency: 'gbp',
description: null,
exchange_rate: null,
fee: 0,
fee_details: [],
net: -2300,
reporting_category: 'transfer',
source: 'tr_1OwnZjQsyM1cbkpxyZp9aLJU',
status: 'available',
type: 'transfer'
}

mystic pasture
#

You didn't expand it though - if you expanded it you'd see the full source object in your response

terse galleon
#

here is my code:
const result = await stripe.balanceTransactions.list({
type: "payment",
stripeAccount: "acct_1OqdV9QsyM1cbkpx",
expand: ["data.source"],
});

mystic pasture
#

I checked the most recent List Balance Transactions requests on your account and they're still not passing in expand - are you sure you're running the code you just updated?

steep coralBOT
#

remrem_balance-transactions

terse galleon
#

yes, i am preatty sure that i've updated the code

mystic pasture
#

Let me try it really quick on my end to make sure it's behaving as expected

#

Aha! Try this instead:

const result = await stripe.balanceTransactions.list({
    type: "payment",
    expand: ["data.source"],
  },
  {
    stripeAccount: "acct_1OqdV9QsyM1cbkpx",
  });
terse galleon
#

Now the source is expanded

"source": {
          "id": "acct_1EvKWYJCb8GR4OWr",
          "object": "account",
          "application_icon": "https://files.stripe.com/links/MDB8YWNjdF8xRXZLV1lKQ2I4R1I0T1dyfGZsX2xpdmVfczd3MzNUQjhoZXBJeVZjNDc2ck1mOU8100tBPtfhMG",
          "application_logo": "https://files.stripe.com/links/MDB8YWNjdF8xRXZLV1lKQ2I4R1I0T1dyfGZsX2xpdmVfUHlrWERObHZnOHNWbUN5UHN4d3ljbHNQ00kSBgpxQo",
          "application_name": "By Rotation",
          "application_url": "https://byrotation.com"
        },
#

but it doesn't have any metadata or transfer_group

#

my bad, it seems like i do have it

mystic pasture
#

Ah awesome! I was just about to ask if you had the transaction ID if you weren't seeing it

terse galleon
#

I have one more question. What would you recommend to create in order to take money from someone connected account. Create charge or create a transfer? I think charge make more sense

mystic pasture