#mac_balancetransaction-filter

1 messages ยท Page 1 of 1 (latest)

vivid basinBOT
#

๐Ÿ‘‹ 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/1241124897711849533

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

thin crystal
#

Hey there, these requests appear to be for a payout, with and without a limit=10 param (the default)

#

Are you saying that you only get 9 results?

#

Are you sure there are more transactions that should be included here?

#

What do you get if you set limit=20 for example

stone hatch
#

Correct

#

I get 10 results

#

With a limit of 20

#

There are 10 transactions in the payout

#

Appears as if theres a bug where actual # of returned results is limit minus 1

thin crystal
#

Can you share your response body with limit=10? or even 5? This seems unexpected.

stone hatch
#

does this API return anything sensitive I should scrub?

thin crystal
#

It should not without expansion, but review it first. Use limit=2 to keep it shorter.

#

Stripe IDs are all safe to share

stone hatch
#

transactions = stripe.BalanceTransaction.list(
... payout="po_1PGX6oCRwhG6C2hGRqJTpjIE",
... api_key="redacted",
... stripe_account="acct_1N0QXECRwhG6C2hG",
... limit=2,
... )

print(transactions)
{
"data": [
{
"amount": -521612,
"available_on": 1715817600,
"created": 1715738302,
"currency": "usd",
"description": "STRIPE PAYOUT",
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"id": "txn_1PGX6oCRwhG6C2hGwWWseG1q",
"net": -521612,
"object": "balance_transaction",
"reporting_category": "payout",
"source": "po_1PGX6oCRwhG6C2hGRqJTpjIE",
"status": "available",
"type": "payout"
},
{
"amount": 40000,
"available_on": 1715817600,
"created": 1715724725,
"currency": "usd",
"description": null,
"exchange_rate": null,
"fee": 1190,
"fee_details": [
{
"amount": 1190,
"application": null,
"currency": "usd",
"description": "Stripe processing fees",
"type": "stripe_fee"
}
],
"id": "txn_3PGTYWCRwhG6C2hG0zCwWW1A",
"net": 38810,
"object": "balance_transaction",
"reporting_category": "charge",
"source": "ch_3PGTYWCRwhG6C2hG0w7Col5L",
"status": "available",
"type": "charge"
}
],
"has_more": true,
"object": "list",
"url": "/v1/balance_transactions"
}

#

Ah I guess is the issue that the payout itself always occupies a balance transaction

thin crystal
#

That looks like 2 txn to me, right?

#

Yea, you might want to filter to type=charge

vivid basinBOT
stone hatch
#

Got it, I think that is the issue then

#

Nvm and thank you ๐Ÿ™‚