# When Stripe won't let you connect

Stripe refuses two kinds of account on the Connect screen: your own, and one another platform already controls. Here is why, and the two steps that work instead.

Most merchants connect AffiliateRail by pressing **Connect Stripe** and signing in. For a small
number of accounts that button will not work, and Stripe is the reason rather than us.

This page is for you if you pressed Connect Stripe and your account was listed but could not be
picked.

## Why Connect refuses it

Stripe turns down two kinds of account on that screen.

**An account cannot connect to itself.** If the Stripe account you are connecting is the same one
your AffiliateRail business runs on, Stripe says "Your account cannot connect to itself."

**An account another platform already controls cannot connect either.** Stripe's own words:
"platforms using OAuth with `read_write` scope can't connect to accounts that are controlled by
another platform." If your Stripe account was set up through some other software that manages it
for you, that is your case, even though it is your account and your money.

Both are rules inside Stripe. There is no setting that changes either, and it is not a sign that
anything is wrong with your account.

The way in is the **Stripe App** instead. Stripe's guidance for app developers puts it plainly:
an app can be installed on most Stripe accounts, whatever platform they are connected to.

## Step 1: install the app

<Steps>

<Step>
Open **Settings**, then **Connections**, in AffiliateRail.
</Step>

<Step>
Press **Connect Stripe**. Stripe shows you the eight things we ask to read, all of them reads and
none of them writes.
</Step>

<Step>
Approve it. You land back on the Connections tab, and the Stripe card now names your account.
</Step>

</Steps>

That gives us permission to read your sales. It does not yet tell us when one happens.

## Step 2: send us your events

Stripe forwards events to an app for *other people's* accounts. For your own account it sends
nothing, because the events belong to the account that owns the connection rather than to a
connected one. So you add one endpoint by hand.

<Steps>

<Step>
In AffiliateRail, on the Stripe card, find **Is this your own Stripe account?** Copy the URL it
shows you. It ends in your program id, which is how we know an event is yours.
</Step>

<Step>
In Stripe, go to the Developers area and add a webhook endpoint. Set **Events from** to **Your
account**, not Connected accounts. Paste the URL as the destination.
</Step>

<Step>
Choose these events:

- `checkout.session.completed`
- `invoice.paid`
- `charge.refunded`
- `customer.subscription.updated`
- `customer.subscription.deleted`
</Step>

<Step>
Save it. Stripe shows the endpoint's **signing secret**, which starts with `whsec_`. Copy it.
</Step>

<Step>
Back in AffiliateRail, press **Add signing secret**, paste it and save.
</Step>

</Steps>

## Checking it worked

Make a payment on your own account, or wait for a real one. On the Connections tab the Stripe
card's **Last event** line moves to today, and the sale appears in your commissions queue if the
buyer arrived through a partner link.

If nothing arrives, the three usual causes, in the order worth checking:

1. The endpoint was created with **Events from** set to Connected accounts. It has to be Your
   account.
2. The URL is missing the program id at the end, or has a different program's id.
3. The signing secret belongs to a different endpoint. Copy it again from the endpoint you made.

## What we can and cannot do with this

The same as for every other merchant. We read. The app grants eight read permissions and no write
permissions, so Stripe itself refuses us a write whatever we ask for, and your money never moves
through us. Your partners are paid from your own PayPal or Wise account, or by your own bank
transfer, and never from a balance we hold.

<Callout>
The signing secret you paste is stored encrypted and never shown again, in AffiliateRail or
anywhere else. If you lose track of it, roll it in Stripe and paste the new one.
</Callout>
