I am trying to access a payout object (https://stripe.com/docs/api#payouts) from a charge object (https://stripe.com/docs/api#charges). The problem is that I do not know what ID to use for the payout. I tried using the transfer ID from payouts but I get the error:
No such payout: tr_1Bxxxxxxxxxx
I also know that the ID of the payout is in the format po_xxxxxxxxxxxxxxx but I can't find any from the charge, the transfer and the balanced_transaction. How is the payout related to the charge?
There's not a direct way to get the Payout from a Charge object ch_xxxyyyzzz, but if your account is setup to make automatic payouts, you can get a list of charges and any other balance transactions (refunds, adjustments, etc) that make up a specific payout object.
https://stripe.com/docs/api#balance_history-payout
stripe.balance.listTransactions({payout:"po_xxxyyyyyyzzz",limit: 100 },
function(err, transactions) {
// asynchronously called
});
Payouts and Transfers are two separate types of Objects. A Payout always refers to when moving funds from your balance to your bank account. A Transfer refers to funds moving between Stripe accounts, typically in the context of Stripe's Connect.
https://stripe.com/docs/transfer-payout-split
Related
Pretty new to Stripe, we're building an online marketplace. Each user can buy assets from any other user. We also take fees for each payment.
We go with connected accounts. Seller goes through the onboarding flow (create connected account, create account link etc), while buyer is registered as a customer of our platform on Stripe.
Now, whenever buyer makes a payment we create a payment intent to pay to us (amount + 20% fee via):
stripe.paymentIntents.create(params)
Then we create new payout to seller (amount) using source transaction from payment intent above:
await stripe.transfers.create({
amount: payment.amount * 100,
currency: payment.currency,
destination: seller.stripeAccountId,
source_transaction: sourceTransaction,
});
Is this the preferred and best way of handling this? In terms of time, we need first to wait for payment to settle to our bank account to be able to payout seller?
Is there any better way of doing this instead of manual payouts?
Is there a way to make direct transfer to connected account when user does payment?
I tried with payment intent, specifying connected account id in request, but API is complaining that customer id is on our platform but account id is specified, so it's not possible obviously.
Also, manual payouts would come handy to simulate payment escrow/deposit. When user create a request for some asset, we would immediately transfer certain amount to our account, like reserving that amount. And if the seller accepts the offer, we would do a payout. If seller rejects the offer, we would do payout to the buyer, giving him back his money.
Does this make sense?
Thanks in advance
You don't need Payout (yet) in your use case. You are doing Separate Charges and Transfers, and fund simply moves from your Account's balance to Connected Account's balance. It hasn't been out of your Connected Account's balance to your Connected Account's bank account yet, which is called "Payout".
In another word, Payout is separated process than Charges and Transfers. Charges and Transfers can happen immediately, and Payouts normally happen later on a daily basis or manually.
Find more explanation on Connect Balance.
There is also Destination Charge which is simpler than Separate Charges and Transfers. I recommend Destination Charge unless you have specific reason to use Separate Charges and Transfers, ie. you need to transfer to multiple Connected Accounts on one payment.
I am looking for a way to make payment to a customer like a business do.
for eg. a business will ask you to fill the form with bank name, acoount number IFSC code etc.
so customer can receive a payment.
I have user who is having a digital wallet with some amount.
I want to transfer the amount to user's provided bank account on the request.
I saw stripe documentation but I am not sure if stripe support custom payment.
Stripe provides refund as per below method where I have to provide charge id string
and because of charge id stripe will refund only the amount which was charged earlier and this is linked to particular charge only.
const stripe = require('stripe')('your_stripe_key');
const refund = await stripe.refunds.create({
charge: 'charge_id_string',
amount: 100,
});
I want to make custom payment/refund so I can transfer users wallet available balance to bank account.
Any suggestion will be appreciated.
I don't think you should use Refund because you can only create a refund based on an existing charge.
You should probably look at Transfer, which allows you to send funds from your Stripe account to a connected account. In your use case, you should create a connected account for your customer so that you can transfer refunds to your customer and eventually payout to their bank account.
Visit here to learn more about Stripe Connect.
Is it possible with Stripe to perform a test transaction to ensure that an account is funded?
I would like to :
take the Credit Card ID at the moment of the booking (but no payment at that moment)
make the customer pay AFTER the service has been done
What you likely want is to place a hold on the card for the given amount, and then capture the funds later after the service has completed. When placing a hold the given amount is authorized and guaranteed by the cardholder's bank. You'll often see these types of transactions show up on your online bank statement when renting a car or when checking-in to a hotel room. When processing your payment with Stripe you would set the capture_method on the PaymentIntent to manual which tells Stripe to only authorize the given amount. Then, once the service is rendered you would capture the funds. The following guide covers the approach in detail:
https://stripe.com/docs/payments/capture-later
I need to figure out which transfers are part of custom connected account payouts!
I'm using Stripe and creating transfers to pass money from my platform to different custom connected accounts. One custom connected account might receive 300+ different transfers with amounts. When Stripe pays out to the connected account, I receive a couple of webhooks (payout.created, payout.paid) and these contain a balance transaction id, which looks like it is the only id that can be used to fetch any transfers from that payout, but how? or is this not how you would do it?
FYI - I need a way to update each connected account transfer to show they are now paid, instead of pending...
When you have a payout ID(po_xxx), you can filter balance transactions on the connected account by that ID — this returns all the transactions that were paid out in that payout object: https://stripe.com/docs/api/balance/balance_history#balance_history-payout
From these transactions, you can find the source of the transaction : https://stripe.com/docs/api/balance/balance_transaction#balance_transaction_object-source
When you make a transfer to a connected account, a py_xxx object is created on the connected account, representing the payment, and this would be the source of the balance transactions. This payment object has a source_transfer field which is the ID of the transfer(tr_xxx).
Putting this all together, if you want to know which transfers were paid out in a given payout, you would combine a list payout call with the expanding objects feature of the API to retrieve all the information at once. It's something like this in Node:
await stripe.balance.listTransactions({
payout: "po_xxx",
expand : ["data.source.source_transfer"]
}, {stripe_account : "{CONNECTED_ACCOUNT_ID"}).autoPagingEach(function(transaction) {
console.log(transaction.source.source_transfer.id); // the tr_xx transfer object
});
I am using Stripe Api to create a customer and then charge it.
What i wanted is to charge my customer whenever it create a sell or charge.
I want 7% of total amount to be credited in my stripe account.
I have tried the Application fee when creating charge with customer Id , but it requires destination to be passed, which requires merchant ID, which always throws error that "No Merchant Found with provided ID".
How the documentation say, there are two way to create a charge: Charging directly and Charging through the platform.
Which of these are you using? (Can I suppose the second since you were talking about the "destination"? ).
They both require connected accounts to do charge, ect.
In the case of Charging through the platform, you need that the account is connected to the platform to be visible from the "destination" (Connecting_Account_Documentation).
If it is not so, explains better the situation in which you find.
application_fee:
A fee in cents that will be applied to the charge and transferred to the application owner's Stripe account. To use an application fee, the request must be made on behalf of another account, using the Stripe-Account header, an OAuth key, or the destination parameter. For more information, see the application fees documentation.
destination:
An account to make the charge on behalf of. If specified, the charge will be attributed to the destination account for tax reporting, and the funds from the charge will be transferred to the destination account. The ID of the resulting transfer will be returned in the transfer field of the response. See the documentation for details.