#sandy.nozaki

1 messages · Page 1 of 1 (latest)

lucid edgeBOT
frail fossil
#

Order 1 (charge $100, Date: 4/12), Order 2 (Charge $200, Date: 4/13) => Both shipped on same date => How to use multiple charges with a single transfer?

light hawk
frail fossil
#

so are you saying that we can set the transfer group whenever we want and doesnt have to be when the payment occurs?

light hawk
#

Correct.

frail fossil
#

can we set transfer_group for multiple paymentintents at once?

#

or do we have to set transfer_group one by one?

light hawk
#

You would need to make multiple requests; one for each Payment Intent

frail fossil
#

so that wouldnt be multiple charges with a single transfer then? wouldnt that be just 1 charge 1 transfer?

light hawk
#

That could still be multiple charges for a single transfer. Just because you add a payment intent to the transfer group, doesn't mean that transfer will automatically be created. You have to create the transfer yourself once all the payments are in the transfer group

frail fossil
#

so then the transfer should be created once we are ready to transfer?

light hawk
#

Correct

frail fossil
#

mutiple charges => mutilpe update request for paymentintent => single transfer with transfer_group

#

is this correct?

light hawk
#

Yup! Assuming you don't know the transfer group at the time of creation, that's how it would work

frail fossil
#

do you think you can provide me a sample API for this

light hawk
frail fossil
#

the sample only shows 1 charge with 1 transfer

#

what would it look for 2 charges with 1 transfer?

light hawk
#

Yeah. You would need to code your own function to make multiple calls

frail fossil
#

i see there is only one call for the charge...if there is 2...would there be 2 instead?

frail fossil
#

2 charge with a single transfer:

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

paymentIntent1 = 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',
});

light hawk
#

You could do it that way, sure.

frail fossil
#

what other way is there?

light hawk
#

You could nest them in a for-loop as well. Just depends on what you're trying to do.

lucid edgeBOT
frail fossil
#

since we have to set transfer_group in each paymentintent, is it impossible with only one transfer request for multiple charges?

cobalt rampart
#

stepping in for my teammate! not sure I follow, is what impossible?

frail fossil
#

can we set transfer_group for multiple payment intent at once or have to set it one by one?

cobalt rampart
#

You can set it for multiple PIs at once

frail fossil
#

twoshoes said otherwise

cobalt rampart
#

okay, let's take a step back. I think we might be misunderstanding each other. what do you mean by "multiple payment intent at once"?

frail fossil
#

paymentintent would be the charges, no?

#

so we need to set the transfer_group in each paymentintent?

#

therefore wouldnt it be impossible with only one transfer request for multiple charges?

cobalt rampart
#

can you clarify what your end goal is for separate charges and transfers? an explicit example of what you're trying to do would be helpful

frail fossil
#

Since the transfer date is determined based on the proof of shipment of the order(21days after or next day), so we're saying that we cannot designate a transfer group in advance at the time of payment.

#

i think two-shoes said we can set the transfer_group at a later time

#

so if there is:
Order 1 (charge $100 on 4/12)
Oder 2 (charge $200 on 4/13)
confirmed the shipment on 4/15

how can we use multiple charges with a single transfer?

#

so do we create the transfer_group and add charges in that group and when we are ready for the transfer for a specific date?

cobalt rampart
#

yes, the transfer_group value can be set at a later time. note that it cannot be changed if it has already been set

frail fossil
#

so it doesnt have to be set with the payment intent ?

cobalt rampart
#

transfer_group doesn't have to be set when creating a PaymentIntent

#

also, using transfer groups is just a way for you to keep track of which charge or charges map to which transfer. you can also just keep track of this information on your end (e.g. which PaymentIntent IDs map to which Transfer IDs)

frail fossil
#

yeah we prefer to use stripes tracking lol

#

so if transfer_group doesnt have to be set at the tim eof creating pymentintent

#

can we just create it like at the end of the day when we know all the charges that need to be included in that specific transfer_group?

cobalt rampart
#

yes, i believe that should be okay. i recommend simulating this in test mode to confirm it fits your team's needs

frail fossil
#

example:

Order 1 (charge $100 on 4/12)
Oder 2 (charge $200 on 4/13)
confirmed the shipment on 4/15

so transfer_group created on 4/15 for transfer

#

so if we want to transfer 1,000 charges at once, do we have to request the transfer_group set 1000 times?

#

since it wasnt set at the time of paymentintent, it would need to right?

cobalt rampart
#

I think I follow but it's really hard to understand with one-off messages like this

#

If 1000 charges need to be part of the same transfer group then yes, you'd need to set each of the PaymentIntents' transfer_group values individually

frail fossil
#

thank you so much

frail fossil
cobalt rampart
#

wouldn't know the final amount for what exactly?

frail fossil
#

well since there will be charges refunds etc

#

and if the transfer_group is created when we want to which is right before the transfer...we wouldnt know the actual amount that will be transferred until we create the transfer_group no?

cobalt rampart
#

transfer_group is not required to make a transfer. you can make a transfer without an associated charge or transfer_group

frail fossil
#

yeah i understand that

#

i think i just confused us more sorry

#

i was just worried about whether or not we would know the actual transfer amount before we tie all the charges to 1 transfer_group but im guessing that calculation needs to be done on our side

cobalt rampart
#

right, yep. or, as you mentioned, you could determine the transfer amount until all charges are accounted for

frail fossil
#

ok thank you again!