#warhost_best-practices

1 messages ยท Page 1 of 1 (latest)

raven schoonerBOT
#

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

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

Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

rapid flare
#

Hey there, you can access those details for automatic payouts by starting from Balance Transactions, following the exmaple here:

#
curl https://api.stripe.com/v1/balance_transactions \
  -u sk_test_123: \
  -d payout=po_4242 \
  -d type=charge \
  -d "expand[]"="data.source" \
  -G
raven schoonerBOT
grim harness
#

Hmm I'm not sure I'm following. I have the dashboard open for the payout "po_1QQf6TQHZ2cyZE3nQhK12CZ2". There is a transaction list on that view. But even when expanding as you said, I don't see how I can build that view my self because I can't find the Transactions in that response.

vagrant harbor
#

Hello! I'm taking over and catching up...

grim harness
#

Hei @vagrant harbor ๐Ÿ™‚ nice to meet you

vagrant harbor
#

When you got the response from the API you're not seeing the Charges in the response, under data?

grim harness
#
        {
            "id": "txn_1QQf6TQHZ2cyZE3nYxUBCZBZ",
            "object": "balance_transaction",
            "amount": -60885,
            "available_on": 1733356800,
            "created": 1732928649,
            "currency": "eur",
            "description": "STRIPE PAYOUT",
            "exchange_rate": null,
            "fee": 0,
            "fee_details": [],
            "net": -60885,
            "reporting_category": "payout",
            "source": {
                "id": "po_1QQf6TQHZ2cyZE3nQhK12CZ2",
                "object": "payout",
                "amount": 60885,
                "application_fee": null,
                "application_fee_amount": null,
                "arrival_date": 1733097600,
                "automatic": true,
                "balance_transaction": "txn_1QQf6TQHZ2cyZE3nYxUBCZBZ",
                "created": 1732928649,
                "currency": "eur",
                "description": "STRIPE PAYOUT",
                "destination": "ba_1QPp3FQHZ2cyZE3nJnYfF7nQ",
                "failure_balance_transaction": null,
                "failure_code": null,
                "failure_message": null,
                "livemode": false,
                "metadata": {},
                "method": "standard",
                "original_payout": null,
                "reconciliation_status": "completed",
                "reversed_by": null,
                "source_type": "card",
                "statement_descriptor": null,
                "status": "paid",
                "trace_id": {
                    "status": "supported",
                    "value": "7UF6L35Pl6o25c94ok3M38544bj7LV6wd3H84U60o"
                },
                "type": "bank_account"
            },
            "status": "pending",
            "type": "payout"
        },
#

curl --location --request GET 'https://api.stripe.com/v1/balance_transactions'
--header 'Stripe-Account: acct_XXX'
--header 'Authorization: Bearer sk_test_XXX'
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'expand[]=data.source'

vagrant harbor
#

Ah, so you didn't make the correct request. You need to specify the payout, type, and expand parameters when making that request. You only specified expand in that request.

grim harness
#

Ahh I think I get it now. If I omit type then I should get everything you show under "Transactions" on that view.

#

(Using the dashboard in German, not sure if it's also called Transactions in English)

vagrant harbor
#

No, you don't want to omit type, you want to set type to charge so you get all the Charges for the specified Payout.

grim harness
#

Not sure yet. If I do set it, only 1 result is returned for po_1QQf6TQHZ2cyZE3nQhK12CZ2

#

What I need is basically for my customer to view all Payments/Application Fees that are part of a payout.

vagrant harbor
#

Can you share the curl request for your latest attempt with your API key redacted?

grim harness
#

curl --location --request GET 'https://api.stripe.com/v1/balance_transactions'
--header 'Stripe-Account: acct_1QPow6QHZ2cyZE3n'
--header 'Authorization: Bearer sk_test_xxx
--header 'Content-Type: application/x-www-form-urlencoded'
--data-urlencode 'expand[]=data.source'
--data-urlencode 'type=charge'
--data-urlencode 'payout=po_1QQf6TQHZ2cyZE3nQhK12CZ2'
--data-urlencode 'limit=100'

vagrant harbor
#

Yeah, that looks correct. You should have received up to 100 Balance Transactions in the response, and inside each of those Balance Transactions the source should be one of the Charges in the Payout.

grim harness
#

type is a filter right? I would assume the same.

#

Ahh no of course. There is only 1 charge, the others are "payments"

vagrant harbor
#

Payments as in py_ objects?

grim harness
#

But that's good, that means I should be able to get all payments for a payout, and from those all application fee's

vagrant harbor
#

Yep. Note that "payment" py_ objects are Charges just like ch_ objects.

#

It's expected that you're seeing both in the results, because they're the same type of object.

grim harness
#

Great! Thanks for the help ๐Ÿ™‚

#

10/10 support and API