# Troubleshooting

> Fixes for the common InfluTo problems — the SDK not connecting, installs counted as organic, codes rejected, purchases not attributed, campaigns that won't activate and payouts that didn't arrive.

Find your symptom below. Most problems show up first in the dashboard: **Setup & SDK** shows whether the SDK has connected and whether RevenueCat calls were rejected, its **Integration log** shows every SDK event and purchase as it arrives, and **Activity** shows who was credited for each install and payment. With an AI agent connected, `influto_integration_status` lists what's still missing.

## The SDK doesn't connect

**`initialize` throws.** It's one of only two calls that throw. A `401` means the API key is wrong — copy it again from **Setup & SDK** (it starts with `it_`; agent keys starting with `it_mcp_` don't work in the SDK). Other errors are usually network problems on the device.

**Setup & SDK never shows a connection.** `initialize` isn't running. On Android, `initialize` is a suspend function — call it inside a coroutine or use the callback overload, otherwise it doesn't compile or never runs. On web apps built with Cordova, the default Content Security Policy blocks requests to `https://influ.to` — allow it.

## Installs show as organic

- **The tap and the first launch happened on different networks**, or more than 72 hours apart. Link-click matching only connects an install to a tap from the last 72 hours on the same network. A typed code always works.
- **The campaign isn't active.** Codes and links only attribute for active campaigns.
- **`checkAttribution` isn't called at launch**, or is called before `initialize` finished.
- **You're re-testing on the same device.** The result is stored once per install; call `clearAttribution()` or reinstall.

## A code is rejected

| Error | Meaning |
|---|---|
| `INVALID_FORMAT` | Not 4–20 characters of letters, digits, `_` or `-` |
| `CODE_NOT_FOUND` | No active creator has this code for this app — check the spelling and that the creator's campaign is active |
| `CODE_EXPIRED` | A free-access code past its expiry date |
| `NETWORK_ERROR` | The device couldn't reach InfluTo |

Codes are trimmed and uppercased before they're checked, so case and stray spaces don't matter. Free-access codes (`INFLU-…`) need manual code entry turned on in **Settings → Advanced**.

## RevenueCat purchases don't arrive

- **Setup & SDK says RevenueCat is sending a wrong Authorization value.** Generate the secret again and paste it into RevenueCat's *Authorization header value* field exactly as shown, including `Bearer`. Or connect automatically with a v2 secret key.
- **Nothing arrives at all.** Check the webhook URL contains this app's ID, the environment is "Both Production and Sandbox", and the events filter is "All events". RevenueCat's **Send Test Event** should appear in the **Integration log** within seconds. **Simulate a purchase** on **Setup & SDK** only checks InfluTo's side; it doesn't test your RevenueCat connection.

## Purchases arrive but aren't attributed

- **The subscriber has no `influto_code` attribute.** On iOS, Flutter and web, the SDK can only write it if you pass the RevenueCat setter, hook or binding. On React Native, `react-native-purchases` must be configured before `checkAttribution` or `applyCode` runs.
- **`identifyUser` isn't called.** It's InfluTo's fallback for events without the attribute.
- **The user was already attributed to another creator.** The first creator to bring a paying user keeps them.
- **It was a free trial.** Trials are recorded but only earn once they convert to paid.
- **The code matched nothing.** A purchase whose code isn't an active code of a live campaign shows in **Activity** as "Code … matched no campaign", and the **Overview** lists such purchases under **Needs attention**.

## Store-direct problems

| Symptom | Fix |
|---|---|
| `reportPurchase` answers `400` | The credentials aren't green yet, or the platform isn't switched to store-direct in **Settings → Validation** |
| TestFlight purchases fail verification | The Apple environment is set to Production — use Sandbox while testing |
| Google validation stuck on "propagating" | New Play Console permissions take up to 48 hours to reach the API |
| `409` on Android | The one-time purchase is still pending; report it once it's PURCHASED |
| `503` | The exchange rate wasn't available — retry; reports are idempotent |
| Nothing is captured automatically | The platform's capture code is missing (`expo-iap`/`react-native-iap`, `android-sdk-billing`, `influto_iap` with `enable()`, or a web `purchaseSource`), or `autoCapture` is false |
| Android one-time purchases fail | Add their product IDs to `oneTimeProductIds`, or pass `productId` to `reportPurchase` |

## Campaigns and money

- **A campaign won't activate.** Activation needs at least $50 available in the wallet (balance minus what's already reserved). Add funds under **Money → Wallet**.
- **A campaign paused itself.** The wallet ran too low. Conversions still count for 72 hours after the pause and referral links keep working; add funds and resume the campaign.
- **A creator wasn't paid.** **Money → Payouts** shows each payout's status, and **Why it failed** for a failed one. Payouts run on the 1st for the previous month and need at least $20, a completed Stripe Connect account, and a country InfluTo can pay (33: the US, Canada, the UK, Switzerland, Norway, Liechtenstein and the EU). Smaller balances roll over. Failed payouts are retried daily.
- **A commission disappeared.** The purchase was refunded; refunds reverse the commission, and if it was already paid it's deducted from the creator's next payout.

## Still stuck?

Email [hello@influ.to](mailto:hello@influ.to) with your app slug, the platform, the SDK version and what you see in the Integration log. If you use an AI agent, include the output of `influto_doctor`.
