> For the complete documentation index, see [llms.txt](https://docs.highsidelabs.co/feed-transformer/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.highsidelabs.co/feed-transformer/feed-types/xml/product-relationship.md).

# Product Relationships

## Parameters

### `productType`

{% hint style="danger" %}
**Required**
{% endhint %}

This must be a valid Amazon product type, corresponding to the product type that you're defining relationships between in the feed. It cannot be the base product type, `PRODUCT`.

## Usage

To convert a `POST_PRODUCT_RELATIONSHIP_DATA` feed to the newer `JSON_LISTINGS_FEED` format:

```php
use SellingPartnerApi\FeedTransformer\Transformer;
use SellingPartnerApi\FeedTransformer\FeedTypes\ProductRelationship;

$feedPath = 'path/to/feed.xml';
$json = Transformer::fromFile(
    ProductRelationship::$feedType,
    $feedPath,
    'ATVPDKIKX0DER',  // -> US Selling Partner API marketplace ID
    ['productType' => 'LUGGAGE']
);

$jsonFeedPath = 'path/to/new/feed.json';
file_put_contents($jsonFeedPath, json_encode($json));
```
