# Channel identities

Link your app's own IDs to the store's products and variants.

Channel identities link your app's own IDs to the store's products and variants. They are for any installed app whose release declares identities: a sales channel that sends products to a marketplace or ad platform, or an app that keeps products in sync from elsewhere, such as a dropshipping supplier. Only that app's token can use these endpoints.

Your app release declares each identity: its key, whether it belongs to products or variants, and the sources the merchant may choose from. Your app then picks a source for each identity, for the whole installation or for one catalog context, and reads the values with Resolve.

**Generated**: a code Tringify derives from the binding and the product or variant ID; it never changes. **Canonical ID**: the Tringify product or variant ID. **SKU** and **Metafield**: read from the merchant's catalog, and follow it when the merchant edits the value. **App-assigned**: your app sets each value. A source never falls back to another one, and a value in use is only replaced when your app asks for it with Rekey.

Everything is scoped to your app's installation in the token's store; no request names a store, app or installation.

## Endpoints

## Get identity contract

`GET /api/2025-01/channel-identities/contract`

Returns the identities your app's installed release declares, each with the sources the merchant may pick for it. Channel identities link your app's own IDs to the store's products and variants, and stay the same when the merchant edits a product, its SKU included. When the merchant deletes a product or variant, its identities are deleted with it and your app receives products/delete or variants/delete; those values then name nothing, and the next product or variant your app creates or links with one of them takes it. Orders keep their own copy of what was bought, so they never need a deleted product's identity. Any installed app whose release declares identities can use these endpoints: a sales channel that publishes products, or an app that keeps products in sync from elsewhere, such as a dropshipping supplier. `sales_channel_id` is null for an app that is not a sales channel. `source_labels` and `reason_labels` are English names for sources and gap reasons, to show merchants.

Scope: `read_products`

```curl
curl 'https://api-store.tringify.com/api/2025-01/channel-identities/contract' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"installation_id":"29973fa8-b84b-446d-9117-7cd0e59a13f9","sales_channel_id":"3800d5a6-5a98-4895-a13a-17441b81aded","app_name":"Google & YouTube","declarations":[{"key":"item_id","label":"Provider item ID","role":"catalog_item","owner_type":"variant","allowed_sources":["generated","sku","metafield","app_assigned"],"required":true},{"key":"item_group_id","label":"Item group ID","role":"catalog_group","owner_type":"product","allowed_sources":["canonical_id"],"required":true}],"source_labels":{"generated":"Code made by Tringify","canonical_id":"Tringify product ID","sku":"SKU","metafield":"Metafield","app_assigned":"Set by the app"},"reason_labels":{"missing":"No value","too_long":"Longer than 255 characters","duplicate":"Same as another product"}}}
```

## List catalog contexts

`GET /api/2025-01/channel-identities/catalog-contexts`

A catalog context is a part of the catalog your app keeps apart, such as one provider account or one catalog. Tringify stores it for your installation and never reads its metadata. A binding can apply to the whole installation or to one context.

Scope: `read_products`

```curl
curl 'https://api-store.tringify.com/api/2025-01/channel-identities/catalog-contexts' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"items":[{"id":"140d86ca-85a7-4b12-95f2-c4db5f694ec3","key":"merchant_center","label":"Google Merchant Center","status":"active","metadata":{"account_id":"123456"}}]}}
```

## Create a catalog context

`POST /api/2025-01/channel-identities/catalog-contexts`

`key` is a stable name your app uses for the context: lowercase letters, digits and underscores, starting with a letter, up to 100 characters. `label` is what merchants see, up to 150 characters. `metadata` is any JSON object your app wants to keep with it.

Scope: `write_products`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/channel-identities/catalog-contexts' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "key": "merchant_center",
  "label": "Google Merchant Center",
  "metadata": {
    "account_id": "123456"
  }
}'
```

Response:

```json
{"success":true,"data":{"id":"140d86ca-85a7-4b12-95f2-c4db5f694ec3","key":"merchant_center","label":"Google Merchant Center","status":"active","metadata":{"account_id":"123456"}}}
```

## Delete a catalog context

`DELETE /api/2025-01/channel-identities/catalog-contexts/{id}`

A context that an identity binding or a feed unit still uses cannot be deleted; delete those feed units first. A binding keeps its context for as long as your app is installed.

Scope: `write_products`

```curl
curl -X DELETE 'https://api-store.tringify.com/api/2025-01/channel-identities/catalog-contexts/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"deleted":true}}
```

## List identity bindings

`GET /api/2025-01/channel-identities/bindings`

A binding chooses the source of one declared identity, for the whole installation or inside one catalog context. `rekey_policy` is `explicit` when a value can be replaced with Rekey, and `forbidden` for generated and canonical IDs.

Scope: `read_products`

```curl
curl 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"items":[{"id":"fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c","declaration_key":"item_id","role":"catalog_item","owner_type":"variant","source_strategy":"sku","rekey_policy":"explicit","status":"active"}]}}
```

## Configure an identity binding

`PUT /api/2025-01/channel-identities/bindings/{declarationKey}`

Sets which source a declared identity reads, for the whole installation or, with `catalog_context_id`, inside one context. The source must be one the declaration allows. `generated` gives each product or variant a code Tringify derives from the binding and its ID, such as `ci_3f2a9c…`; it never changes. `canonical_id` uses the Tringify product or variant ID. `sku` and `metafield` read the merchant's catalog: when the merchant changes that value, the identity changes with it in the same save, and the old value is kept as history. `app_assigned` means your app supplies each value with Assign identity values. Resolve the current value before you send a product, and compare it with the one your app stored. A binding can change its source only while it has no saved identities; the first Resolve, Assign or Rekey saves them, and from then on the binding keeps its source, because the channel already knows those values. To use another source, bind the identity in another catalog context.

Scope: `write_products`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/item_id' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "catalog_context_id": "140d86ca-85a7-4b12-95f2-c4db5f694ec3",
  "source": "sku"
}'
```

Response:

```json
{"success":true,"data":{"id":"fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c","declaration_key":"item_id","role":"catalog_item","owner_type":"variant","source_strategy":"sku","rekey_policy":"explicit","status":"active"}}
```

## List eligible metafield sources

`GET /api/2025-01/channel-identities/eligible-metafields`

Returns the store's metafield definitions that can be an identity source for products or variants: text (`string`) definitions that are not translatable, so every language shares one value.

Scope: `read_products`

```curl
curl 'https://api-store.tringify.com/api/2025-01/channel-identities/eligible-metafields' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"items":[{"id":"e687a8f3-2c66-4999-b954-32fc9879eb40","namespace":"custom","key":"gtin","name":"GTIN","owner_type":"variant"}],"pagination":{"page":1,"limit":20,"total":1}}}
```

## Assign identity values

`PUT /api/2025-01/channel-identities/bindings/{id}/values`

Sets up to 200 product or variant values in one transaction: all are saved or none. A value already assigned to another product or variant in the binding is refused, and an owner's existing value is never replaced here; use Rekey for that. Values hold at most 255 characters. The response lists each owner's value in request order.

Scope: `write_products`

```curl
curl -X PUT 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c/values' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "values": [
    {
      "owner_id": 326,
      "value": "g_123"
    }
  ]
}'
```

Response:

```json
{"success":true,"data":{"items":[{"owner_id":326,"value":"g_123","status":"resolved"}]}}
```

## Resolve identity values

`POST /api/2025-01/channel-identities/bindings/{id}/resolve`

Returns the identity of up to 200 products or variants from the binding's source, in request order. `status` is `resolved` with the `value`, or `missing` when the source has no value or the product or variant has been deleted. A generated ID, or the first value read from a SKU or metafield, is saved the first time it is resolved, which is why this needs write_products.

Scope: `write_products`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c/resolve' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "owner_ids": [
    326,
    331
  ]
}'
```

Response:

```json
{"success":true,"data":{"items":[{"owner_id":326,"value":"LS-326-S","status":"resolved"},{"owner_id":331,"status":"missing"}]}}
```

## Look up identity values

`POST /api/2025-01/channel-identities/bindings/{id}/lookup`

The reverse of Resolve: for up to 200 values, in request order, `status` is `resolved` with the `owner_id` that holds the value in the binding, or `missing` (no `owner_id`), also when that product or variant has been deleted. Use it to find the store's record for an ID your app knows, for example after a reinstall. It only reads.

Scope: `read_products`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c/lookup' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "values": [
    "FS-012",
    "FS-013"
  ]
}'
```

Response:

```json
{"success":true,"data":{"items":[{"owner_id":326,"value":"FS-012","status":"resolved"},{"value":"FS-013","status":"missing"}]}}
```

## Rekey an identity value

`POST /api/2025-01/channel-identities/bindings/{id}/rekey`

Replaces the identity of one product or variant in one step and keeps the old value as history. For an `app_assigned` binding send the new `value`; for a `sku` or `metafield` binding the current SKU or metafield value is used and `value` is ignored. Generated and canonical IDs never change and cannot be rekeyed.

Scope: `write_products`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c/rekey' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "owner_id": 326,
  "value": "g_124"
}'
```

Response:

```json
{"success":true,"data":{"owner_id":326,"value":"g_124","status":"resolved"}}
```

## Rekey identity values from source

`POST /api/2025-01/channel-identities/bindings/{id}/rekey-from-source`

For a `metafield` binding only: replaces the identity of up to 200 products or variants with their current metafield values, all or none, keeping the old values as history. You cannot send replacement values. For other sources use Rekey.

Scope: `write_products`

```curl
curl -X POST 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c/rekey-from-source' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "owner_ids": [
    326,
    331
  ]
}'
```

Response:

```json
{"success":true,"data":{"items":[{"owner_id":326,"value":"0123456789012","status":"resolved"}]}}
```

## Get identity diagnostics

`GET /api/2025-01/channel-identities/diagnostics`

Returns one row per binding, with its `binding_id` and, for a binding inside a catalog context, `catalog_context_id`, then one row for each declared identity that has no binding at all. Each row has the merchant-facing `label`, whether the identity is `required` and `configured`, the chosen `source_strategy`, and counts: `total` products or variants in scope (variants for a variant identity; simple products for a product `catalog_item`; variable products for a `catalog_group`), `resolved`, `missing` (the source has no value) and `conflicts` (a value longer than 255 characters, or one that another product or variant also has). Treat a required row that is not configured as a setup step the merchant must finish before your app sends products. The counts read the whole catalog each time, so call it for a setup or status screen, not before every sync.

Scope: `read_products`

```curl
curl 'https://api-store.tringify.com/api/2025-01/channel-identities/diagnostics' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"items":[{"binding_id":"fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c","declaration_key":"item_id","label":"Provider item ID","owner_type":"variant","source_strategy":"sku","required":true,"configured":true,"total":49,"resolved":47,"missing":2,"conflicts":0},{"declaration_key":"item_group_id","label":"Item group ID","owner_type":"product","required":true,"configured":false,"total":16,"resolved":0,"missing":16,"conflicts":0}]}}
```

## List identity gaps

`GET /api/2025-01/channel-identities/bindings/{id}/gaps`

Lists, in ID order, the products or variants in the binding's scope whose identity cannot be sent: the source has no value (`missing`), the value is longer than 255 characters (`too_long`), or another product or variant in the scope has the same value (`duplicate`). The counts in Get identity diagnostics come from the same data, so the two agree. Show the list to merchants so they can fill in or correct the source, such as the metafield the binding reads. Pass `next_cursor` as `cursor` for the next page; it is empty on the last page. Generated, canonical, SKU and app-assigned values never repeat, so only a metafield binding can list `duplicate`; with a metafield binding, every page checks the whole catalog for repeated values.

Scope: `read_products`

```curl
curl 'https://api-store.tringify.com/api/2025-01/channel-identities/bindings/fca4ce80-d62c-4c56-a8fb-4eedbd4aa91c/gaps?reason=missing,duplicate&search=die-cut' \
  -H "Authorization: Bearer YOUR_STORE_API_TOKEN"
```

Response:

```json
{"success":true,"data":{"items":[{"owner_type":"variant","owner_id":14492,"product_id":4142,"product_title":"Custom Die-Cut Stickers","variant_title":"1 Inch","sku":"CUSTOMDIECUT1","product_status":"active","value":null,"reason":"missing"},{"owner_type":"variant","owner_id":14501,"product_id":4150,"product_title":"Neon Owl Sticker","variant_title":"3 Inch","sku":"OWL3","product_status":"active","value":"OWL","reason":"duplicate"}],"next_cursor":"14501"}}
```

