#sebastian_api
1 messages Β· Page 1 of 1 (latest)
π 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/1292892141064032398
π 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.
- sebastian_webhook-testing, 18 minutes ago, 34 messages
- sebastian_api, 1 hour ago, 17 messages
hey @bold wave
HI π
Can you provide more details on your question?
Yeah. So right now I built my webhook and deployed it to a vercel link which I then registered on Stripe to listen to payouts.
I am then on Stripe browser built in CLI imitating a payout but I am not seeing it appear as something that has registered on the webhook dashboard on Stripe
I am basically trying to test my webhook to make sure its reacting correctly b4 I put it in production
Can you look in the Events tab in the Developer section and find the payout.created eventID?
These will only show up in test mode
You can see the Test Mode banner in the Stripe Shell
Yeah they are showing for the default 11 dollar payout
So the stripe cli is showing here. Just trying to figure out how I can make the stripe CLI in browser point to my webhook
So I can make sure the code is working
For that, you can use stripe listen and forward events to your Vercel hosted endpoint
https://docs.stripe.com/cli/listen
We recommend doing it in a terminal on your computer
oh ok. So the browser CLI isnt meant for that.
Right. Ideally, what you would do is have a copy of your webhook code running locally on your maching and then forward the webhook events to it using something like
stripe listen --forward-to=http://localhost:4242/
ok let me give that a go
That way, you can test and change your code locally. Once everything is working as you expect, you copy your code over to your Vercel hosting platform.
Running stripe listen generates it's own Webhook signing secret. You will need to use the one from stripe listen for testing locally but use the one associated with your registered webhook endpoint when you are using your hosted code.
Where are the docs on this? Once I listen, what commands do I invoke to do a payout.create event
Just logged onto my Stripe CLI locally
You do that in two separate windows, each running their own process
First window: Run stripe listen https://docs.stripe.com/cli/listen
https://docs.stripe.com/webhooks#test-webhook
Second window, call stripe trigger payout.created
Ok so open one window to invoke stripe listen and point to the right local endpoint. THEN, it would give me the webhook signing secret.
Got it... then second window call trigger
okay doing it now
ok so I have one more question
I managed to get my local webhook to show dummy data of a payout event.
{
id: 'evt_1Q7KrcEu5lL8dZr6mtlfwsUR',
object: 'event',
api_version: '2024-06-20',
created: 1728322616,
data: {
object: {
id: 'po_1Q7KrcEu5lL8dZr6Kqt1tMX5',
object: 'payout',
amount: 1100,
application_fee: null,
application_fee_amount: null,
arrival_date: 1728259200,
automatic: false,
balance_transaction: 'txn_1Q7KrcEu5lL8dZr6Q9ZYsU1p',
created: 1728322616,
currency: 'usd',
description: '(created by Stripe CLI)',
destination: 'ba_1PZcFjEu5lL8dZr6e080vGJU',
failure_balance_transaction: null,
failure_code: null,
failure_message: null,
livemode: false,
metadata: {},
method: 'standard',
original_payout: null,
reconciliation_status: 'not_applicable',
reversed_by: null,
source_type: 'card',
statement_descriptor: null,
status: 'paid',
type: 'bank_account'
}
},
livemode: false,
pending_webhooks: 2,
request: {
id: 'req_PuaCVrj3LWCu2D',
idempotency_key: '32ed5b8a-9b49-4bf7-b5c3-e63419c96779'
},
type: 'payout.paid'
}
But I am trying to see how I can monitor someones money step by step.
so the way it works in my app is that I do a transfer.
The transfer lands the money in the person's account.
Then later that day, the payout starts. I am trying to see if there is a shared txid to reflect that money.
Each transfer should have a destination payment ID - https://docs.stripe.com/api/transfers/object#transfer_object-destination_payment
and you can also check what charges were included in the payouts like: https://docs.stripe.com/expand/use-cases#charges-in-payout
So is the destination property in the payload I shared above the destination payment?
the above example is for a payout object. Destination payment ID property lives on a Transfer object..
I guess the only way to associate a transfer with a payout would be the match the dollar value being moved.
Bc I do a transfer, and then there is the payout but I am trying to communicate with my end users on what part of the journey their money is on if that makes sense
Either/Or works for me. Right now its automatic on my dashboard but I am more than happy to do it manually if it gives me that control I need to document where the money is at on its way to my user's bank account
Comparing the dollar value won't work as automatic payouts basically moves 100% balance that the stripe account has. If you're using automatic payouts, you can do - https://docs.stripe.com/expand/use-cases#charges-in-payout:~:text=If youβre using,property%3A
source.source_transfer on a payout should give you the "transfer" to the connected account & you can look at source_transaction to find the actual/originating charge on platform.
This way you can track backwards from payout -> transfer -> originating charge
With manual payouts, you basically control everything so you'd need to track everything yourself
I dont see a source _* anywhere on the payout object
Check the example in the URL I shared above.. BalanceTransaction object would have the source.. You'd pass payout as a parameter
Ok so lets start with step 1.. Below is a real transfer object from my dashboard
{
"id": "tr_1Q2yKJEu5lL8dZr6WGrSscNI",
"object": "transfer",
"amount": 13211,
"amount_reversed": 0,
"balance_transaction": "txn_1Q2yKJEu5lL8dZr6Urfe9nMK",
"created": 1727282671,
"currency": "usd",
"description": null,
"destination": "acct_1Q1sa1IV3eXVgtcs",
"destination_payment": "py_1Q2yKJIV3eXVgtcsBB9rvi0O",
"livemode": true,
"metadata": {
},
"reversals": {
"object": "list",
"data": [
],
"has_more": false,
"total_count": 0,
"url": "/v1/transfers/tr_1Q2yKJEu5lL8dZr6WGrSscNI/reversals"
},
"reversed": false,
"source_transaction": null,
"source_type": "card",
"transfer_group": "FIRST_PAYOUT"
}
source_transaction here is null
so I am wondering what property can I grab that I can use to connect it to the respective payout once this money goes to their bank
tr_xxx object is created on the platform but destination_payment -> py_xxx is created on the connected account
When a payout is created, this py_xxx should be listed as source on one of the payment type BalanceTransaction objects (txn_xxx)
Since there's no payout created right after a transfer, there's no way to connect tr_xxx to a future payout po_xxx
Instead, when you receive a payout.created event, you'd retrieve the balance transactions and map it to the transfer. So going the other way around/in reverse.
Are you telling me there is a way for me to manually create a payout right after a successful transfer?
Once the balance is available after a transfer, yeah you can create a payout manually
Automatic payouts are created based on the payout schedule of the account
okay so you are recommending just looking up the BalanceTransaction object to see what money is sitting in the persons account.
or at least what transactions are actively sitting there right?
You can listen to webhook events. As a platform, you can create a connect type webhook endpoint and listen to balance.available events..
When you create a transfer and the funds settle on the connected account, you'd receive the above event - after which you can call the API to create the payout manually
NP! π Happy to help