---
title: "Handle Stripe Webhook"
method: POST
path: "/api/v1/webhooks/stripe"
tags: ["webhooks"]
---

# Handle Stripe Webhook

`POST /api/v1/webhooks/stripe`

## Request

- Base URL: `https://geo.sig.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://geo.sig.ai/api/v1/webhooks/stripe`
- Auth: none declared

Handle Stripe webhook events for automatic conversion recording.

**Supported Events:**
- `checkout.session.completed` - One-time purchase completed
- `invoice.payment_succeeded` - Subscription payment succeeded
- `charge.refunded` - Refund processed (negative conversion)

**Metadata Requirements:**
Include `session_id` in Stripe metadata to link conversion to attribution:

```javascript
// In your checkout code:
const sessionId = AIVisibility.getSessionId();

const checkout = await stripe.checkout.sessions.create({
  // ... other params
  metadata: {
    session_id: sessionId,  // Required for attribution
    query_id: "optional"     // Optional
  }
});
```

**Response:**
- 200: Event processed successfully
- 400: Invalid payload or signature
- 500: Error processing event

## Headers

- `Stripe-Signature` string

## Response `200`

Successful Response

- unknown

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sig/apis/ai-visibility-intelligence-api.md) · [All operations](https://skmtc.dev/sig/apis/ai-visibility-intelligence-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sig/apis/ai-visibility-intelligence-api/revisions/3ec39f9be9e0?raw)
