dub icon indicating copy to clipboard operation
dub copied to clipboard

Stripe integration webhook support

Open zlwaterfield opened this issue 4 months ago • 2 comments

This is a spike for the Stripe integration. Basically, we want the ability to:

  1. Update a customer with additional metadata if they came to a customer application through a Dub link
  2. Tracks conversions (payments/revenue) that are from those customers - so we can handle analytics + payouts.

This builds upon our analytics SDK + affiliate features we will be releasing.

Process for a customer to set up:

  1. Create a Webhook Endpoint in the Dub dashboard - they are returned a Webhook Endpoint then a form is shown with 2 inputs - Stripe Webhook Secret and Stripe Restricted API Key
  2. Create a Stripe Webhook in the Stripe dashboard with 2 event types - customer.created, charge.succeeded.
  3. Get the Stripe Webhook Secret and put it in the input in the Dub dashboard
  4. Create a Stripe Restricted API Key in Stripe with the persmissions set to Charges:READ and Customers:WRITE.
  5. Take the Stripe Restricted API key and put it in the input in the Dub dashboard
  6. Submit the form in Dub dashboard.

Then the customer will need to update their Stripe integration so they send the necessary ID in the metadata of the customer to Stripe. More on this later when we launch the analytics SDK.

Once that is all done, the Dub API will be able to monitor customers created in the customers Stripe account that came from Dub links and charges that originated from those users. It will append more information to the customer metadata in Stripe like what link they came from and if it was an affiliate, who the affiliate was. It will also be able to monitor charges and attribute that revenue to users that came from Dub links and if it was an affiliate, who the affiliate was. All this will be available in the Dub dashboard.

Notes 🗒️

  • The UI still needs to be designed/built
  • This is an MVP attempt, in the future we will support a Stripe Partner app that does most of this automatically.

zlwaterfield avatar Feb 28 '24 16:02 zlwaterfield