#db1900
1 messages ยท Page 1 of 1 (latest)
a Customer object's id like cus_1234
Like the Customer object associated with the individual transaction?
yess
Yep okay thanks for clarifying
So what you want to do is expand the source for the balance transaction: https://stripe.com/docs/api/balance_transactions/object#balance_transaction_object-source
Are you familiar with expansion?
so when we use the source (which is a payout obj) it doesnt have the customer info on it
Sorry, let me clarify
When you receive a Payout webhook you are going to want to list balance transactions for the Payout using https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout. When you do that, you expand the source for each Balance Transaction so you can see the actual object which the Customer will be associated with
is there a way to expand it using the Stripe CLI?
or would i have to curl it to use "expand"?
Hello ๐
Expand is supported by CLI too
Example
https://stripe.com/docs/api/expanding_objects?lang=cli
so that source expands the payout which doesnt have the customer obj/data
What objects are you seeing in the source property when you list the Balance Transactions?
"data": [
{
"id": "txn_1NmnhIKA296nhejwedsVoq0i",
"object": "balance_transaction",
"amount": -9601,
"available_on": 1693958400,
"created": 1693875891,
"currency": "usd",
"description": "STRIPE PAYOUT",
"exchange_rate": null,
"fee": 0,
"fee_details": [],
"net": -9601,
"reporting_category": "payout",
"source": {
"id": "po_1NmnhHKA296nhejwfAe99wWa",
"object": "payout",
"amount": 9601,
"arrival_date": 1693872000,
"automatic": true,
"balance_transaction": "txn_1NmnhIKA296nhejwedsVoq0i",
"created": 1693875891,
"currency": "usd",
"description": "STRIPE PAYOUT",
"destination": "ba_1NiJU7KA296nhejwp5trEcy1",
"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",
"type": "bank_account"
},
"status": "pending",
"type": "payout"
},
is that the only balance transaction you're seeing?
Typically you should be seeing the charges included in the payout (ch_xxx)
The charge objects should have the customer listed
https://stripe.com/docs/expand/use-cases#charges-in-payout
https://stripe.com/docs/api/charges/object#charge_object-customer
@amber folio you are mixing up the balance transaction for the Payout itself with the balance transactions that make up the Payout.
You need to list the balance transactions for the Payout using https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout which I linked above. Ignore the specific balance transaction that you see within the Webhook.
hmm i am using the same info you linked. im calling it like this: curl -G https://api.stripe.com/v1/balance_transactions \ -u sk_test_your_key: \ -d limit=3 -d"expand[]"=source
i am seeing multiple balance transactions but the others dont have a valid source so they are not expanded
@amber folio did you try the example mentioned in our docs here? It filters BalanceTransactions by setting type to charge
https://stripe.com/docs/expand/use-cases#charges-in-payout
-u sk_test_123: \
-d payout=po_xxx \
-d type=charge \
-d "expand[]"="data.source" \
aha, that did it
The code above will list all the charges (charge objects ch_xx) included in the payout.
The charges themselves should have a customer (cus_xx) linked
the type=charge was the secret ingredient ๐งโ๐ณ