> ## Documentation Index
> Fetch the complete documentation index at: https://learn.biq.li/llms.txt
> Use this file to discover all available pages before exploring further.

# Troubleshoot the Stripe App

> Diagnose missing Stripe conversions, event retries, identity issues, and connection problems.

Start with the earliest missing step. A delivered Stripe event cannot create an attributed conversion if the website never captured a Biqli click or never registered the Checkout Session.

## Connection checklist

Confirm all of the following:

1. **Workspace settings → Integrations → Stripe** shows **Manage**, not **Enable**.
2. The Stripe App shows **Connected** to the expected Biqli workspace.
3. The connection environment matches the Checkout Session: live for `cs_live_...`, test or sandbox for `cs_test_...`.
4. Conversion tracking is enabled in the workspace.
5. Your website hostname is allowed and the browser SDK uses an active `biqli_pk_...` publishable key from the same workspace.
6. The visitor arrived through a conversion-enabled Biqli link and the SDK has a valid `bq_id`.
7. Your site registered the Stripe Checkout Session before redirecting to Stripe.

## A sale is missing

Check the customer journey in this order:

* Open the destination through the exact short link you are testing.
* In the browser, verify `Biqli.getClickId()` returns a click ID.
* Confirm `storeStripeSession()` succeeded before navigation to Checkout.
* Complete payment in the same Stripe account and environment that is connected to the workspace.
* In Stripe Workbench, open the event destination and inspect the delivery for `checkout.session.completed` or `invoice.paid`.
* Allow a short period for webhook delivery, then refresh the Biqli customer or conversion report.

Do not press a manual “record click” button after arriving through a Biqli short link. The redirect already captured the real click. A manual click is useful only for an isolated SDK test.

## Interpret Stripe delivery responses

| Response                | Meaning                                                                                                                                                           | Action                                                                                                    |
| :---------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------------------------- |
| `200 processed`         | Biqli accepted and processed the supported event.                                                                                                                 | Refresh the corresponding Biqli report.                                                                   |
| `200 ignored`           | The event was valid but did not qualify for a conversion, such as an unpaid Checkout, zero-value invoice, non-trialing subscription, or missing safe attribution. | Inspect the event and the earlier Checkout mapping. Do not repeatedly resend an ineligible event.         |
| `200 duplicate`         | Biqli already completed this exact Stripe event ID.                                                                                                               | No action. Totals should remain unchanged.                                                                |
| `500 processing_failed` | Processing failed or an earlier attribution event has not arrived yet.                                                                                            | Let Stripe retry. If the failure persists, inspect the event order and contact support with the event ID. |
| `503 retry_later`       | Biqli intentionally backed off a recently failed event.                                                                                                           | Wait for the `Retry-After` period before another attempt.                                                 |
| `400`                   | Signature, environment, or immutable event identity validation failed.                                                                                            | Verify the destination and environment. Do not edit and reuse an existing event ID.                       |

Biqli stores one immutable ledger entry per Stripe event ID and environment. Replaying the same event is safe. Reusing an event ID with materially different event data is rejected.

## A trial event failed before succeeding

Stripe can deliver `customer.subscription.created` before `checkout.session.completed`. The subscription event does not yet have the exact Checkout attribution, so Biqli can return `500 processing_failed` with a pending-attribution condition.

This is recoverable. The expected sequence is:

1. the early subscription event is temporarily failed;
2. `checkout.session.completed` establishes the Checkout, customer, and subscription mapping;
3. Stripe retries the original subscription event;
4. Biqli processes one **Stripe Free Trial** lead.

Do not create a second Checkout or a duplicate customer just to repair this ordering. If Stripe does not retry, use **Resend** from the event destination's delivery view after the Checkout completion delivery is processed.

## Checkout was canceled or the card was declined

These outcomes should not change sales or revenue:

* Returning through your cancel URL records no conversion.
* A declined payment records no sale.
* A failed 3DS authentication records no sale.
* An abandoned Checkout mapping expires and cannot create a late sale after its attribution window.

Test a later successful payment with a new Checkout Session. Do not reuse a failed session as proof of a new purchase.

## The customer is unknown

A Stripe subscription event may contain only a customer ID, while the later Checkout event contains name and email. Biqli first creates the account-scoped Stripe identity, then enriches it when trusted identity fields arrive.

If the customer stays unknown:

* confirm Checkout has `customer_details.email` or an expanded Stripe customer with an email;
* confirm `checkout.session.completed` was delivered and processed;
* confirm your signup lead uses the same Stripe customer ID as its external identity;
* do not substitute an email-only identity if a Stripe customer ID exists.

## Country differs from Stripe billing details

Biqli's customer country is the country of the attributed first-touch click. Stripe billing or card country is payment data and does not replace marketing attribution geography. The customer list and customer detail should display the same attributed-click country.

## A refund did not change revenue

Verify that:

* the original attributed sale exists;
* the refund status is `succeeded`;
* Stripe delivered `refund.created` or `refund.updated`;
* the refund uses the same currency as the sale;
* the Stripe charge or PaymentIntent can be linked to the original sale.

A pending, failed, or canceled refund does not change revenue. A successful refund delivered before its original sale can temporarily fail and then succeed on retry after the sale exists.

## Reconnect or remove the app

If the wrong workspace is connected, disconnect it from **Workspace settings → Integrations → Stripe**, then reconnect from the Stripe App and choose the intended workspace.

Disconnecting revokes the Biqli workspace authorization but does not uninstall the app. Remove the app separately from Stripe app settings when you want a complete uninstall.

When contacting support, provide the Stripe event ID, event type, environment, approximate time, and Biqli request ID if one was returned. Never send a Stripe secret key, Biqli API key, publishable key, or webhook signing secret.
