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

# Testing and troubleshooting

> Verify consent, browser delivery, checkout identity, order retries, and refunds.

## End-to-end checklist

1. Use an isolated test store/campaign. There is no Orders API dry-run flag. Use `isSample: true` to test ingestion without commissions; a sample cannot later be converted into an earning order by replay.
2. Open an approved submission's generated tracking link. Preserve `ss` through redirects.
3. Before consent, confirm `getVisitorId()` returns `null` and the pixel has not sent events.
4. Grant analytics and marketing consent. Confirm a visitor ID and successful browser requests to `/api/commerce/pixel/YOUR_PIXEL_CODE`. Exercise product, cart, and checkout-start actions.
5. Save that visitor ID with your checkout on the server. If using a SideShift-provided account, also capture the optional advertising context.
6. Verify payment through your payment system, then send the confirmed order. Check HTTP 200 and the store's tracking diagnostics. Acceptance alone does not guarantee attribution.
7. Replay the same order. Expect `duplicate: true`. Send a cumulative partial refund using the original order ID, payment timestamp, and amount. Confirm the existing order updates without creating another order.
8. Withdraw consent. Confirm the visitor ID is cleared and no new SideShift events or retries occur.

Testing actual commissions requires a deliberately authorized non-sample order, eligible accepted creator terms, and a qualifying click. Testing advertising purchase delivery additionally requires a qualifying live destination and purchase; a successful page validation is not proof of that flow.

## Troubleshooting

| Symptom | Check |
| - | - |
| `window.sideshift` is undefined | Script URL, CSP, script readiness, blockers, and installation on this page. |
| Visitor ID is `null` | Consent has not been granted or was revoked. Never invent a shared fallback ID. |
| Browser request rejected | Pixel code, configured storefront domain, origin, event fields, and whether the store is connected. |
| Advertising context is `null` | No managed destination is connected, consent is absent, or the optional SDK is blocked/not ready. Independent tracking can still work. |
| Order returns 401 | Wrong, rotated, or disconnected-store Orders API key; platform API keys cannot be used. |
| Order returns 400 | Required visitor ID, ISO payment time, currency, integer money, and refund bounds. |
| Order returns 409 | A replay changed original purchase fields or checkout identity. |
| Order accepted but unattributed | Missing creator click, different visitor/store, expired seven-day window, ineligible submission/contract, or asynchronous processing. |
| Commission missing | Sample/cancelled order, attribution/terms/store not eligible, cap reached, or payout/reconciliation still pending. |
| Custom domain stops working | DNS and ownership verification. Replace the snippet with the standard origin while repairing it. |
| Browser checkout visible but no purchase | Your server must send a verified order; browser events never substitute for payment confirmation. |

The browser has bounded delivery retries, not guaranteed delivery. Use a durable retry queue for server orders and honor rate limits. Keep your own payment/order records as the source of truth.
