#Geico - connect invoice

1 messages · Page 1 of 1 (latest)

bold bolt
#

Hi đź‘‹
So just the first invoice? Not successive ones?

sacred herald
#

Yes, it’s for an affiliate platform where the person referring only gets say 20% of the first subscription payment and the user subscribing gets 20% off

bold bolt
#

In that case you will want to use a Webhook listener and listen for the invoice.created event. That invoice stays in draft mode for 1 hour, allowing you to make updates to it before it is finalized. During that window you update in the invoice and set the transfer_data property to the correct Account (destination) and Amount
https://stripe.com/docs/webhooks
https://stripe.com/docs/api/invoices/update

sacred herald
#

Hmm alright, I’ll see if I can make this work! Thanks!

bold bolt
#

Sure thing 👍

#

You'll need to know it's the first invoice

#

For that you'll want to check the billing_reason property

#

if it's subscription_create, that's the first invoice of a new subscription

sacred herald
#

One more question, the stripe account that’s actually taking the payments is also a connected standard account. How would I be able to handle refunds and chargebacks on the payments that have already been divvied to the express account

bold bolt
#

Hmmm...how are the charges being created? Are you using Direct, Destination, or Separate Charge & Transfer?

sacred herald
#

They are being created as a subscription

#

Or by a subscription I should say

bold bolt
sacred herald
#

Is it possible to change which type is used for a subscription?

#

I was under the impression it’s not

bold bolt