# View Product Online & Image Links for Feed Integrations

### Using NCompass View Product Online / Image Link for Feed Compatibility

For sales placed online via a **3rd party integration website**, certain fields are required by most feed providers. These fields are submitted from **NCompass once orders have been invoiced** and are commonly required by providers such as **AWIN**, **Trustpilot**, and similar affiliate or review platforms.

To support these feeds, we include **two configurable URL fields** which allow third parties to link directly to the relevant product information on the website.

The two fields provided in the feed are:

**View Product Online URL**

```
www.mywebsite.com/showproduct.php?sku=!LIWCODE!
```

**Product Main Image URL**

```
www.mywebsite.com/showimage.php?sku=!LIWCODE!
```

##### Dynamic SKU Replacement

The most important part of the above URLs is the token:

```
!LIWCODE!
```

This value is dynamically rendered within the feed by NCompass using the product's SKU field.

The SKU in this context represents the primary numeric identifier of the product on the website. This identifier is used by the core integration (either via a direct API integration or the NCompass Web Sync Utility) to link products between the website and NCompass.

This identifier is what maintains the relationship between the product in NCompass and the corresponding product on the website.

While the base URL structure can be anything defined by the website developer, NCompass will always append the product identifier in place of !LIWCODE!

##### View Product Online URL Behaviour

For the following example URL:

```
www.mywebsite.com/showproduct.php?sku=!LIWCODE!
```

When the SKU value is substituted, opening the link **should take the user directly to the product page on the website**.

Example:

```
www.mywebsite.com/showproduct.php?sku=12345
```

This should load the product page corresponding to that SKU.

##### Product Image URL Behaviour

For the image URL:

```
www.mywebsite.com/showimage.php?sku=!LIWCODE!
```

This endpoint must return **only the main product image**.

The response from this URL **should contain no HTML page structure**, navigation, or layout elements. Instead, the response body should directly output the image itself.

Effectively, the response should behave as though the browser has directly loaded an image file.

Example expected behaviour:

```
www.mywebsite.com/showimage.php?sku=12345
```

This should return the product’s primary image in a format similar to:

```
https://www.mywebsite.com/images/products/12345.jpg
```

The page output should <span style="text-decoration: underline;">strictly be the image content itself</span>, allowing third party feed processors to retrieve the product image reliably.

[![image.png](https://kb.findesolutions.com/uploads/images/gallery/2026-03/scaled-1680-/2HJchccmET3fGhXb-image.png)](https://kb.findesolutions.com/uploads/images/gallery/2026-03/2HJchccmET3fGhXb-image.png)

[![image.png](https://kb.findesolutions.com/uploads/images/gallery/2026-03/scaled-1680-/5Nrfa3HQNM6rsl8q-image.png)](https://kb.findesolutions.com/uploads/images/gallery/2026-03/5Nrfa3HQNM6rsl8q-image.png)

#### Example PHP implementation;

##### Example – View Product Online URL

This example accepts the SKU from the query string and redirects the user to the matching product page

```php
<?php

$sku = isset($_GET['sku']) ? trim($_GET['sku']) : '';

if ($sku === '') {
    http_response_code(400);
    exit('Missing sku');
}

/*
 * Example only:
 * Replace this lookup logic with the website's actual product lookup method.
 */
$productUrl = '/product/' . urlencode($sku);

header('Location: ' . $productUrl, true, 302);
exit;
```

##### Example – Product Main Image URL

This example accepts the SKU, finds the matching image file, outputs the correct image mime type, and returns the image directly.

```php
<?php

$sku = isset($_GET['sku']) ? trim($_GET['sku']) : '';

if ($sku === '') {
    http_response_code(400);
    exit('Missing sku');
}

/*
 * Example only:
 * Replace this with the website's actual logic for locating the main product image.
 */
$imagePath = __DIR__ . '/images/products/' . $sku . '.jpg';

if (!file_exists($imagePath)) {
    http_response_code(404);
    exit('Image not found');
}

$mimeType = mime_content_type($imagePath);

$allowedMimeTypes = [
    'image/jpeg',
    'image/png',
    'image/webp',
    'image/gif'
];

if (!in_array($mimeType, $allowedMimeTypes, true)) {
    http_response_code(415);
    exit('Unsupported image type');
}

header('Content-Type: ' . $mimeType);
header('Content-Length: ' . filesize($imagePath));
readfile($imagePath);
exit;
```

<div class="relative basis-auto flex-col -mb-(--composer-overlap-px) [--composer-overlap-px:28px] grow flex" id="bkmrk-accepted-image-mime-"><div class="flex flex-col text-sm pb-25"><article class="text-token-text-primary w-full focus:outline-none [--shadow-height:45px] has-data-writing-block:pointer-events-none has-data-writing-block:-mt-(--shadow-height) has-data-writing-block:pt-(--shadow-height) [&:has([data-writing-block])>*]:pointer-events-auto scroll-mt-[calc(var(--header-height)+min(200px,max(70px,20svh)))]" data-scroll-anchor="true" data-testid="conversation-turn-4" data-turn="assistant" data-turn-id="request-WEB:59845d5b-5553-40b7-b423-99d797d3d6c6-6" dir="auto" tabindex="-1">##### Accepted Image Mime Types

The image URL should return a valid image response using a standard image mime type.

Supported mime types should ideally be one of the following:

```
image/jpeg
image/png
image/webp
image/gif
```

The preferred format in most cases is:

```
image/jpeg
```

This is generally the safest option for compatibility with third party feed providers.

##### Important Notes for the Image Endpoint

The image URL should:

<div class="text-base my-auto mx-auto pb-10 [--thread-content-margin:var(--thread-content-margin-xs,calc(var(--spacing)*4))] @w-sm/main:[--thread-content-margin:var(--thread-content-margin-sm,calc(var(--spacing)*6))] @w-lg/main:[--thread-content-margin:var(--thread-content-margin-lg,calc(var(--spacing)*16))] px-(--thread-content-margin)"><div class="[--thread-content-max-width:40rem] @w-lg/main:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn" tabindex="-1"><div class="flex max-w-full flex-col gap-4 grow"><div class="min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&]:mt-1" data-message-author-role="assistant" data-message-id="394283b8-86db-4b7d-a523-81e8e40ed034" data-message-model-slug="gpt-5-4-thinking" dir="auto"><div class="flex w-full flex-col gap-1 empty:hidden"><div class="markdown prose dark:prose-invert w-full wrap-break-word dark markdown-new-styling">- return the image directly in the response body
- return a valid `Content-Type` header matching the image format
- not output any surrounding HTML
- not include header, footer, menu, or page layout content
- not require login or session-based access
- be publicly accessible by the third party feed provider

</div></div></div></div></div></div>The endpoint must behave like a direct image file request.

#### Simple Summary

For clarity:

**View Product Online URL**  
Should take the supplied SKU and open the relevant product page on the website.

**Product Main Image URL**  
Should take the supplied SKU and return only the raw main product image with the correct image mime type.

<div class="text-base my-auto mx-auto pb-10 [--thread-content-margin:var(--thread-content-margin-xs,calc(var(--spacing)*4))] @w-sm/main:[--thread-content-margin:var(--thread-content-margin-sm,calc(var(--spacing)*6))] @w-lg/main:[--thread-content-margin:var(--thread-content-margin-lg,calc(var(--spacing)*16))] px-(--thread-content-margin)"><div class="[--thread-content-max-width:40rem] @w-lg/main:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 group/turn-messages focus-visible:outline-hidden relative flex w-full min-w-0 flex-col agent-turn" tabindex="-1"><div class="flex max-w-full flex-col gap-4 grow"><div class="min-h-8 text-message relative flex w-full flex-col items-end gap-2 text-start break-words whitespace-normal [.text-message+&]:mt-1" data-message-author-role="assistant" data-message-id="394283b8-86db-4b7d-a523-81e8e40ed034" data-message-model-slug="gpt-5-4-thinking" dir="auto"><div class="flex w-full flex-col gap-1 empty:hidden"><div class="markdown prose dark:prose-invert w-full wrap-break-word dark markdown-new-styling">  
</div></div></div></div></div></div></article></div></div><div class="sticky bottom-0 group/thread-bottom-container relative isolate z-10 w-full basis-auto has-data-has-thread-error:pt-2 has-data-has-thread-error:[box-shadow:var(--sharp-edge-bottom-shadow)] md:border-transparent md:pt-0 dark:border-white/20 md:dark:border-transparent print:hidden content-fade single-line" id="bkmrk--2"><div class="relative h-0">  
</div><div><div class="text-base mx-auto [--thread-content-margin:var(--thread-content-margin-xs,calc(var(--spacing)*4))] @w-sm/main:[--thread-content-margin:var(--thread-content-margin-sm,calc(var(--spacing)*6))] @w-lg/main:[--thread-content-margin:var(--thread-content-margin-lg,calc(var(--spacing)*16))] px-(--thread-content-margin)"><div class="[--thread-content-max-width:40rem] @w-lg/main:[--thread-content-max-width:48rem] mx-auto max-w-(--thread-content-max-width) flex-1 mb-[var(--thread-component-gap,1rem)]"><div class="flex justify-center empty:hidden">  
</div></div></div></div></div>