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

# POST /{integrationId}/sync/trigger

> Trigger an immediate full catalog sync. Seyaha will call your GET /products and POST /availability endpoints right away.

Call this endpoint when your catalog changes in a way that requires a full re-fetch —
new products, removed products, updated pricing, or changed option metadata. Seyaha will
call your `GET /products` endpoint immediately and process all changes.

<Note>
  For single-slot availability changes (capacity, vacancies, status) use
  `POST /{integrationId}/availability/notify` instead — it's faster and avoids
  re-fetching your entire catalog.
</Note>

***

## Endpoint

```
POST https://api.seyaha.net/api/v1/partner-integrations/{integrationId}/sync/trigger
```

### Path parameter

| Parameter       | Description                                     |
| --------------- | ----------------------------------------------- |
| `integrationId` | Your integration ID, issued when you registered |

***

## Authentication

Authenticate using your `webhook_secret` in the `x-webhook-secret` header.
This endpoint does **not** use the `Authorization` header or your `auth_key`.

```http theme={null}
POST /api/v1/partner-integrations/{integrationId}/sync/trigger
x-webhook-secret: <your-webhook-secret>
```

No request body is needed.

***

## Response

```http theme={null}
200 OK
Content-Type: application/json

{
  "success": 1,
  "data": {
    "synced": 12,
    "skipped": false
  }
}
```

| Field     | Type    | Description                                                                                            |
| --------- | ------- | ------------------------------------------------------------------------------------------------------ |
| `synced`  | integer | Number of products processed in this sync                                                              |
| `skipped` | boolean | `true` if Seyaha's hash matched the previous sync — your catalog was identical, no DB writes performed |

### Error responses

| HTTP  | Condition                                                          |
| ----- | ------------------------------------------------------------------ |
| `400` | Missing `x-webhook-secret` header                                  |
| `401` | `x-webhook-secret` does not match your integration's stored secret |

***

## How hash deduplication works

Seyaha hashes the full response body from your `GET /products` call. If the hash matches
the previous sync, it skips all DB writes and returns `skipped: true`. This means you
can call `sync/trigger` freely — if nothing changed on your side, it completes instantly
with no side effects.

```
Scenario A — catalog changed:
  Seyaha → GET /products → hash differs from previous → upsert activities → { synced: 12, skipped: false }

Scenario B — catalog unchanged:
  Seyaha → GET /products → hash matches → skip DB writes → { synced: 0, skipped: true }
```

***

## Full example

A new product was added to your catalog. Notify Seyaha:

```http theme={null}
POST https://api.seyaha.net/api/v1/partner-integrations/64a1b2c3d4e5f67890abcdef/sync/trigger
x-webhook-secret: whsec_a1b2c3d4e5f6
```

Response when new products were found:

```json theme={null}
{ "success": 1, "data": { "synced": 13, "skipped": false } }
```

Response when nothing changed:

```json theme={null}
{ "success": 1, "data": { "synced": 0, "skipped": true } }
```
