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

# Authentication

> Authenticate requests using your Channel3 partner ID and Standard Webhooks HMAC-SHA256 signatures.

Every request to the Product Ingestion API must identify your partner account and include a valid [Standard Webhooks](https://www.standardwebhooks.com/) HMAC-SHA256 signature.

## Request Headers

```http theme={null}
Content-Type: application/json
X-Channel3-Partner-Id: <your partner id>
webhook-id: <unique id, reused on retry>
webhook-timestamp: <unix seconds>
webhook-signature: v1,<base64 signature>
```

| Header | Description |
| - | - |
| `X-Channel3-Partner-Id` | Partner identifier assigned by Channel3 (e.g., `feedonomics`, `productsup`). |
| `webhook-id` | Unique message identifier generated by the sender. **Reuse the same ID across retries** for deduplication. |
| `webhook-timestamp` | Unix timestamp in **seconds** when the request was signed. Requests more than **5 minutes** off are rejected with `401`. |
| `webhook-signature` | One or more space-separated `v1,<base64>` HMAC-SHA256 signatures. |

## Signing Method

The signature is computed over the exact bytes of:

```text theme={null}
{webhook-id}.{webhook-timestamp}.{raw body}
```

Signing secrets consist of a `whsec_` prefix followed by a base64-encoded key.

To compute `webhook-signature`:

1. Strip the `whsec_` prefix from your signing secret.
2. Base64-decode the remaining string to obtain the raw key bytes.
3. Compute `HMAC-SHA256` over the UTF-8 bytes of `{webhook-id}.{webhook-timestamp}.{raw body}`.
4. Base64-encode the raw digest.
5. Prefix the result with `v1,` and send it in the `webhook-signature` header.

> [!WARNING]
>
> Sign the **exact raw bytes** transmitted over the wire. Re-serializing or reformatting JSON after signing will invalidate the signature.

## Code Examples

```python Python theme={null}
import base64
import hashlib
import hmac
import json
import time
import uuid
import requests

PARTNER_ID = "your_partner_id"
SECRET = "whsec_..."  # Sandbox or production secret from Channel3
ENDPOINT = "https://feeds.channel3.ai/v1/sandbox/products"

payload = {
    "type": "product.created",
    "merchant": {"id": "merchant_123", "domain": "example.com"},
    "product": {
        "offerId": "SKU12345",
        "contentLanguage": "en",
        "feedLabel": "US",
        "productAttributes": {
            "title": "Classic Cotton T-Shirt",
            "link": "https://www.example.com/p/SKU12345",
            "imageLink": "https://www.example.com/img/SKU12345.jpg",
            "availability": "IN_STOCK",
            "price": {"amountMicros": "15990000", "currencyCode": "USD"},
        },
    },
}

raw_body = json.dumps(payload, separators=(",", ":")).encode("utf-8")
webhook_id = f"msg_{uuid.uuid4().hex}"
timestamp = str(int(time.time()))

key = base64.b64decode(SECRET.removeprefix("whsec_"))
signed_payload = f"{webhook_id}.{timestamp}.".encode("utf-8") + raw_body
digest = hmac.new(key, signed_payload, hashlib.sha256).digest()
signature = f"v1,{base64.b64encode(digest).decode('utf-8')}"

response = requests.post(
    ENDPOINT,
    data=raw_body,
    headers={
        "Content-Type": "application/json",
        "X-Channel3-Partner-Id": PARTNER_ID,
        "webhook-id": webhook_id,
        "webhook-timestamp": timestamp,
        "webhook-signature": signature,
    },
)
print(response.status_code, response.json())
```

```typescript TypeScript / Node.js theme={null}
import crypto from "node:crypto";

const PARTNER_ID = "your_partner_id";
const SECRET = "whsec_..."; // Sandbox or production secret from Channel3
const ENDPOINT = "https://feeds.channel3.ai/v1/sandbox/products";

const rawBody = JSON.stringify({
  type: "product.created",
  merchant: { id: "merchant_123", domain: "example.com" },
  product: {
    offerId: "SKU12345",
    contentLanguage: "en",
    feedLabel: "US",
    productAttributes: {
      title: "Classic Cotton T-Shirt",
      link: "https://www.example.com/p/SKU12345",
      imageLink: "https://www.example.com/img/SKU12345.jpg",
      availability: "IN_STOCK",
      price: { amountMicros: "15990000", currencyCode: "USD" },
    },
  },
});

const webhookId = `msg_${crypto.randomUUID()}`;
const timestamp = String(Math.floor(Date.now() / 1000));
const key = Buffer.from(SECRET.replace(/^whsec_/, ""), "base64");

const digest = crypto
  .createHmac("sha256", key)
  .update(`${webhookId}.${timestamp}.${rawBody}`, "utf8")
  .digest("base64");

const response = await fetch(ENDPOINT, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "X-Channel3-Partner-Id": PARTNER_ID,
    "webhook-id": webhookId,
    "webhook-timestamp": timestamp,
    "webhook-signature": `v1,${digest}`,
  },
  body: rawBody,
});

console.log(response.status, await response.json());
```

## Key Rotation

There is no separate key ID header. During key rotation, Channel3 issues a new secret while continuing to accept your current secret for an overlap window.

Sign the payload with every active secret and separate the signatures with spaces:

```http theme={null}
webhook-signature: v1,<current signature> v1,<next signature>
```

Channel3 accepts the request if **any** signature matches an active secret for that environment. After the overlap window closes, the old secret stops verifying.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.