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

# Track Conversion

> Track a conversion event via pixel

## Request Body

<ParamField body="pixelId" type="string">
  Pixel ID (if using managed pixels)
</ParamField>

<ParamField body="clickId" type="string" required>
  The click ID (`lw_cid`) from the URL
</ParamField>

<ParamField body="event" type="string" default="conversion">
  Conversion event type (e.g., `purchase`, `lead`, `signup`)
</ParamField>

<ParamField body="value" type="number">
  Conversion value/amount
</ParamField>

<ParamField body="currency" type="string" default="USD">
  ISO currency code
</ParamField>

<ParamField body="orderId" type="string">
  Your unique order/transaction ID
</ParamField>

<ParamField body="metadata" type="object">
  Additional custom data
</ParamField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.linquid.io/api/conversions/track \
    -H "X-API-Key: lw_your_api_key_here" \
    -H "Content-Type: application/json" \
    -d '{
      "clickId": "abc123xyz789",
      "event": "purchase",
      "value": 99.99,
      "currency": "USD",
      "orderId": "ORD-12345"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.linquid.io/api/conversions/track', {
    method: 'POST',
    headers: {
      'X-API-Key': 'lw_your_api_key_here',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      clickId: 'abc123xyz789',
      event: 'purchase',
      value: 99.99,
      currency: 'USD',
      orderId: 'ORD-12345',
    }),
  });
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.linquid.io/api/conversions/track',
      headers={
          'X-API-Key': 'lw_your_api_key_here',
          'Content-Type': 'application/json',
      },
      json={
          'clickId': 'abc123xyz789',
          'event': 'purchase',
          'value': 99.99,
          'currency': 'USD',
          'orderId': 'ORD-12345',
      }
  )
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "data": {
      "conversionId": "conv_def456",
      "clickId": "abc123xyz789",
      "event": "purchase",
      "value": 99.99,
      "currency": "USD",
      "orderId": "ORD-12345",
      "tracked": true,
      "timestamp": "2024-01-15T14:30:00.000Z"
    }
  }
  ```
</ResponseExample>

## Notes

* The `clickId` must be valid and within the attribution window (default: 30 days)
* Duplicate conversions with the same `orderId` are rejected
* Values are automatically converted to USD for reporting
