#sandy.nozaki

1 messages · Page 1 of 1 (latest)

deft edgeBOT
honest field
sudden carbon
#

What do you mean by multiple charges with a single transfer?

honest field
#

Separate Charges & Transfers

sudden carbon
#

You can do this, but you'll need to have a sufficient available balance on your platform for the transfer, as the transaction_source approach supports only a single pending charge

#

You can have charge 1,2,3 for say 10 USD each, then create a transfer for 25 USD

honest field
#

can i see a sample API for that?

#

In the current API documentation, there is only one sample with only one input data in source_transaction and amount.
However, we wonder if the data should be included in this way [{amount, source_transaction}...{amount, source_transaction}] to transfer multiple charges with a single transfer.

sudden carbon
#

There's nothing in the docs showing exactly that, but it would be the same as what you see on that page except there's be two payment intent calls

#
const paymentIntent1 = await stripe.paymentIntents.create({
  amount: 10000,
  currency: 'usd',
  transfer_group: 'ORDER10',
});

const paymentIntent2 = await stripe.paymentIntents.create({
  amount: 10000,
  currency: 'usd',
  transfer_group: 'ORDER10',
});

const transfer = await stripe.transfers.create({
  amount: 18000,
  currency: 'usd',
  destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
  transfer_group: 'ORDER10',
});

#

like that

honest field
#

so the above is what multiple charges with a single transfer would look like?

sudden carbon
#

At a high level, that's an example, yes. Do you have something more specific in mind?

honest field
#

In the current API documentation, there is only one sample with only one input data in source_transaction and amount.
However, we wonder if the data would be included in this way [{amount, source_transaction}...{amount, source_transaction}] to transfer multiple charges with a single transfer.

sudden carbon
#

No, that's not something supported in the API. source_transaction is for a single charge only in the case of transferring a pending charge amount.

honest field
#

so for SC&T, multiple charges and transfers will just show however many payment intent calls based on however many charges?

sudden carbon
#

What do you mean by that?

#

show in what context?

honest field
#

im assuming if there are 2 charges itll show 2 payment intent calls

sudden carbon
#

What will show that?

#

Can you explain a specific scenario you're considering and where you're looking at data?

honest field
#

what would multiple charges to 1 transfer API call look like

#

we want to see what the API call would look like for multiple charges to 1 transfer. The stripe doc only shows 1 charge and not multiple

sudden carbon
#

This is the same as 1 charge 1 transfer, but the amount would presumably be based on the sum of multiple charges

#

These calls are up to you, you pick that amount

#

If you're asking about how to use source_transaction when there are multiple charges, I'm telling you that you can't do that. It only supports a single charge id.

#

Instead you need to have sufficient available balance to cover the transfer amount

honest field
honest field
honest field
honest field
sudden carbon
honest field
#

well you said its 1 charge 1 transfer. and you said that those multiple charges would be summed to 1 transfer..but im asking about when its multiple charges to 1 transfer

sudden carbon
sudden carbon
honest field
#

sorry im so confused

#

maybe we can start fresh

sudden carbon
#

Sure, go ahead

honest field
#

so a sample of the multiple charges w single transfer is :
const paymentIntent1 = await stripe.paymentIntents.create({
amount: 10000,
currency: 'usd',
transfer_group: 'ORDER10',
});

const paymentIntent2 = await stripe.paymentIntents.create({
amount: 10000,
currency: 'usd',
transfer_group: 'ORDER10',
});

const transfer = await stripe.transfers.create({
amount: 18000,
currency: 'usd',
destination: '{{CONNECTED_STRIPE_ACCOUNT_ID}}',
transfer_group: 'ORDER10',
});

#

can you explain why we see 2 payment intents? is it because there were 2 charges?

sudden carbon
#

Yes, that's right

#

Your integration might look different in where those payments come from, but this is a simplified example

#

Sorry, that was a mistake, didnt mean to lock this

honest field
#

ah no worries

#

can you explain why we see 2 payment intents in the API sample? is it because there were 2 charges?

sudden carbon
#

In this simplified example yes

honest field
#

so if there were 3 charges, it will show 3 payment intents?

sudden carbon
#

Sure, again in this simplified model

honest field
#

got it, thats what i was asking in the beginning

#

depending on however many charges the same amount of payment intents will display

sudden carbon
#

Sure, again this is just a simplified example. The payments that comprise a transfer are entirely under your control. There might be 1, 2, 3 or 20 of them, and the transfer amount can be whatever calculation from those payment amounts you want.

honest field
#

yep understood

#

thank you

sudden carbon
#

👍