## TL;DR

Stripe says no such payment_intent because the code used a test-mode ID against live keys (or vice versa). Match the key mode to the ID's mode: test IDs only work with test keys.

## Error

```text
No such payment_intent: pi_123
```

## Steps

1. Check which key the code is using (pk_test/live, sk_test/live) Expected: you know the mode.
2. Check where the payment intent ID came from Expected: you know its mode.
3. Use test keys with test IDs and live keys with live IDs Expected: the lookup succeeds.
4. Separate test and live config so they cannot mix Expected: it cannot regress.

## When to use

- No such payment_intent on confirm
- Test/live keys are mixed

## When not to use

- The intent genuinely does not exist (then check creation succeeded)
- Wrong Stripe account entirely (then check the account)

## Tool compatibility

- Stripe test vs live mode
- Payment integrations

## Variant phrasings

### no such payment_intent

Test/live mismatch. Match the key mode to the ID's mode.

### pi_123 not found stripe

Same: test IDs only work with test keys.

## Why it happens

Test IDs look real, and config copy-paste mixes modes silently. Stripe scopes every object to its mode.

## Edge cases

- Webhooks also carry mode; verify webhook signatures against the matching endpoint secret
- Never use live keys in development

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_KhpCWhogLy5jqyJgHUThHw
