#gordon-macmaster_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/1301636592456171603
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐ are you using Destination Charges or Direct Charges for your Connect flow?
Let me check
Okay, direct charges. So then, if you're using Automatic Payouts, you can use the approach shown in this guide to find all Balance Transactions in a Payout:
https://docs.stripe.com/payouts/reconciliation
Then check to see if Payment/Charge you're looking for is associated with one of those Balance Transactions.
When creating the payment intent I use the transfer data object
transfer_data: {
destination: stripeAccountID,
},
You can't do it the other way around, where you start with a Payment Intent or Charge ID and retrieve the ID of the Payout it's included in.
Are you sure? That's not what I saw in the Subscription creation request associated with the ID you shared
https://dashboard.stripe.com/logs/req_ri8J5XroyvZ019
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Ah, sorry, I seem to have gotten some IDs mixed up.
Oh I see, I was looking at the Charge you were retrieving in the request you shared.
Yup, that must be for the SAAS fees we charge. For context we're building abitility for grocers to have an online storefront. We charge them a monthly fee. The flow I'm trying to figure out is thier customers
For example, I'm trying to figure out how to get the payout for this payment:
https://dashboard.stripe.com/acct_1No41MGfXU4j4BOe/payments/py_1QFiSGGfXU4j4BOeYi5aA3Lz
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I can see the payout on that page, so I figured it's possible
This is more tricky with Destination Charges, because the Balance Transactions for them are all for the Transfers they receive from your Platform account. So there are more objects to step through to get back to what you're looking for.
So far I have gone:
- Payment intent
- Latest Charge
- Transfer
- Destination payment
- Stuck where to go next
You can still use the approach I shared to find the Balance Transactions in each Payout, and the Payment (technically a Charge) object that created that Balance Transaction.
Then you can look at the source_transfer field on those Charge/Payment objects to find the Transfer on your Platform account that they're associated with:
https://docs.stripe.com/api/charges/object#charge_object-source_transfer
Then from the Transfer on your Platform account find the related Charge and Payment Intent.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
So I have to start with payout and work backwards?
Yup
Got it. So given I have a customer charge on 10/1/24 would it make sense to pull payouts on 10/1, 10/2, 10/3, etc until I find the one that it's in?
Yeah, you can do something like that. For card payments you can use this table to get an idea of how long it takes payments to settle, to get an idea of when it may be included in a payout:
https://docs.stripe.com/payouts#standard-payout-timing
Some payment method types, like ACH payments, may take longer to settle and become available.
You could also listen to payout.created Events for your Connected Account. Find all related payments, and store them in your database. That way you can more quickly find the Payout a payment is associated with rather than making a bunch of API calls for each lookup.