> For the complete documentation index, see [llms.txt](https://docs.uppercut.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.uppercut.co/guides/test-your-integration.md).

# Test your integration

Verify the full affiliate attribution flow (click → signup email → sale → commission) before going live – without charging customers your real product price.

### 1. Click an affiliate link

Open a tracking link in a private window. Confirm the click shows up in Uppercut.

### 2. Bind the visitor (browser console)

With the cookie still set on your site, paste one of these:

```javascript
// Email only
Uppercut.signup('test@example.com')
```

```javascript
// User ID only
Uppercut.signup({ userId: 'user_123' })
```

```javascript
// Both (recommended)
Uppercut.signup({ email: 'test@example.com', userId: 'user_123' })
```

### 3. Simulate a sale (no Stripe charge)

Create an API key under [**API keys**](https://app.uppercut.co/a/twosided/api-keys), then paste:

```bash
# Email only
curl -X POST https://app.uppercut.co/api/track-sale \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event_id": "test_001",
    "amount": 99.00,
    "currency": "usd",
    "email": "test@example.com"
  }'
```

```bash
# User ID only
curl -X POST https://app.uppercut.co/api/track-sale \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event_id": "test_001",
    "amount": 99.00,
    "currency": "usd",
    "userId": "user_123"
  }'
```

```bash
# Both (recommended)
curl -X POST https://app.uppercut.co/api/track-sale \
  -H "Authorization: Api-Key YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "event_id": "test_001",
    "amount": 99.00,
    "currency": "usd",
    "email": "test@example.com",
    "userId": "user_123"
  }'
```

Use the same `email` / `userId` as step 2. Change `event_id` if you run the test again.

### 4. Check the commission

A commission should appear for the test affiliate. Reject it so it is never paid out.

If nothing appears, signup was missing or the identifiers did not match.

### Optional: Stripe smoke test

After step 2 works:

**Email:** checkout with the same email (`customer_email` on Checkout).

**User ID:** set the same ID on Stripe:

```javascript
const session = await stripe.checkout.sessions.create({
  customer_email: 'test@example.com',
  metadata: { uppercut_user_id: 'user_123' },
  line_items: [/* ... */],
  mode: 'payment',
  success_url: 'https://yoursite.com/success',
})
```

```javascript
await stripe.customers.update('cus_xxx', {
  metadata: { uppercut_user_id: 'user_123' },
})
```

Use a $1 live Payment Link. Stripe test mode charges will not arrive correctly.
