PHPackages                             drkbcn/json\_listings\_feed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. drkbcn/json\_listings\_feed

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

drkbcn/json\_listings\_feed
===========================

Transform legacy Amazon XML feeds into the new JSON\_LISTINGS\_FEED format for SP-API.

00PHP

Since Jul 28Pushed 9mo agoCompare

[ Source](https://github.com/drkbcn/json_listings_feed)[ Packagist](https://packagist.org/packages/drkbcn/json_listings_feed)[ RSS](/packages/drkbcn-json-listings-feed/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

🛒 Amazon XML → JSON Listings Feed Transformer
=============================================

[](#-amazon-xml--json-listings-feed-transformer)

**Transform your legacy Amazon XML feeds into the new JSON\_LISTINGS\_FEED format for SP-API. Free and Open Source!**

[![Ko-fi](https://camo.githubusercontent.com/201ef269611db7eb6b5d08e9f756ab8980df3014b64492770bdf13a6ed924641/68747470733a2f2f6b6f2d66692e636f6d2f696d672f676974687562627574746f6e5f736d2e737667)](https://ko-fi.com/drkbcn)

---

🚀 Why this project?
-------------------

[](#-why-this-project)

Amazon is deprecating its legacy XML and flat-file feeds and migrating to the new JSON\_LISTINGS\_FEED format for SP-API. While the excellent [jlevers/selling-partner-api](https://github.com/jlevers/selling-partner-api) library provides comprehensive SP-API access (and is completely free!), the author also created a separate **commercial feed transformer tool** by Highside Labs that charges $299-$899 per feed type to handle this migration.

**At [@labelgrupnetworks](https://labelgrup.com), we faced the same situation and needed a cost-effective solution, so we built this free and open-source transformer for the community.**

---

✨ Features
----------

[](#-features)

- 🔄 **Transform legacy Amazon XML to JSON\_LISTINGS\_FEED**
- 🛒 **Supports inventory, pricing, product, image, and relationship feeds**
- 🧩 **Direct integration with jlevers/selling-partner-api**
- 🆓 **100% Open Source and free**
- 🏷️ **Designed for migrations and automations**
- 🛠️ **Easy to use, no commercial dependencies**
- 📦 **Uses PATCH operations for optimal performance**

---

📦 Installation
--------------

[](#-installation)

```
git clone https://github.com/drkbcn/json_listings_feed.git
cd json_listings_feed
composer install
```

Copy `.env.example` to `.env` and configure your Amazon SP-API credentials.

---

📝 Quick Usage
-------------

[](#-quick-usage)

### Basic Transformation

[](#basic-transformation)

```
use Labelgrup\AmazonTransformer\Transformer;

$transformer = new Transformer($sellerId, $marketplaceId);
$json = $transformer->transformXmlToJson($xmlContent);
echo $json;
```

### Complete Workflow (Inventory Update)

[](#complete-workflow-inventory-update)

```
use Labelgrup\AmazonTransformer\{AmazonXMLFunctions, Transformer};
use SellingPartnerApi\{FeedType, Api\FeedsV20210630Api};

// Generate XML (for compatibility with existing systems)
$xmlBuilder = new AmazonXMLFunctions($sellerId);
$messages = [$xmlBuilder->getQtyMessage($sku, $newQuantity)];
$xmlContent = $xmlBuilder->buildXmlInventoryData($messages);

// Transform to JSON
$transformer = new Transformer($sellerId, $marketplaceId);
$jsonOutput = $transformer->transformXmlToJson($xmlContent);

// Send to Amazon
$feedsApi = new FeedsV20210630Api($config);
// ... (see examples for complete implementation)
```

---

🧑‍💻 Migration Examples
----------------------

[](#‍-migration-examples)

### Inventory Update

[](#inventory-update)

**Old XML Format:**

```

    1.01
    A3UM3SGRVK155I

  Inventory

    1
    Update

      B0182SJFQQ
      5

```

**New JSON Format (Generated):**

```
{
  "header": {
    "sellerId": "A3UM3SGRVK155I",
    "version": "2.0",
    "issueLocale": "es_ES"
  },
  "messages": [
    {
      "messageId": 1,
      "sku": "B0182SJFQQ",
      "operationType": "PATCH",
      "productType": "PRODUCT",
      "patches": [
        {
          "op": "replace",
          "path": "/attributes/fulfillment_availability",
          "value": [
            {
              "fulfillment_channel_code": "DEFAULT",
              "quantity": 5
            }
          ]
        }
      ]
    }
  ]
}
```

### Price Update

[](#price-update)

**Old XML Format:**

```

  Price

    1
    Update

      RS-7IGC-AFXK
      18.78

```

**New JSON Format (Generated):**

```
{
  "messages": [
    {
      "messageId": 1,
      "sku": "RS-7IGC-AFXK",
      "operationType": "PATCH",
      "productType": "PRODUCT",
      "patches": [
        {
          "op": "replace",
          "path": "/attributes/purchasable_offer",
          "value": [
            {
              "audience": "ALL",
              "currency": "EUR",
              "our_price": [
                {
                  "schedule": [
                    {
                      "value_with_tax": 18.78
                    }
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  ]
}
```

---

🧪 Examples &amp; Testing
------------------------

[](#-examples--testing)

### Available Examples

[](#available-examples)

- `examples/inventory.php` — Complete inventory update workflow
- `examples/pricing.php` — Complete pricing update workflow

### Utility Scripts

[](#utility-scripts)

- `check_feed.php` — Monitor feed processing status
- `check_product.php` — Get product information and pricing details

### Running Examples

[](#running-examples)

```
# Update inventory
php examples/inventory.php

# Update pricing
php examples/pricing.php

# Check feed status
php check_feed.php [feedId] [--detailed]

# Get product info
php check_product.php [SKU]
```

---

🔧 Supported Feed Types
----------------------

[](#-supported-feed-types)

- ✅ **POST\_INVENTORY\_AVAILABILITY\_DATA** - Inventory quantity updates
- ✅ **POST\_PRODUCT\_PRICING\_DATA** - Product pricing updates
- ✅ **POST\_PRODUCT\_DATA** - Product information updates
- ✅ **POST\_PRODUCT\_IMAGE\_DATA** - Product image updates
- ✅ **POST\_PRODUCT\_RELATIONSHIP\_DATA** - Variation relationships

---

🏢 About Us
----------

[](#-about-us)

Created with ❤️ by [@drkbcn](https://github.com/drkbcn) at [Labelgrup Networks](https://labelgrup.com).

- 💼 **Company:** [labelgrup.com](https://labelgrup.com)
- ☕ **Support:** [Ko-fi](https://ko-fi.com/drkbcn)
- 📧 **Contact:**

---

🤝 Contributing
--------------

[](#-contributing)

Did this project save you money? Consider:

- ⭐ Starring this repository
- 🐛 Reporting issues or requesting features
- 🔀 Contributing code improvements
- ☕ [Buying me a coffee](https://ko-fi.com/drkbcn)

---

📄 License
---------

[](#-license)

MIT License - Free to use, modify, and distribute!

---

� Credits
---------

[](#-credits)

- **Inspiration:** Amazon Sellers community facing migration challenges
- **Built on:** [jlevers/selling-partner-api](https://github.com/jlevers/selling-partner-api) (the excellent free SP-API library)
- **Alternative to:** Highside Labs' commercial Feed Transformer (which charges $299-$899 per feed type)

---

📚 Resources
-----------

[](#-resources)

- [Amazon SP-API Documentation](https://developer-docs.amazon.com/sp-api/)
- [JSON\_LISTINGS\_FEED Migration Guide](https://developer-docs.amazon.com/sp-api/docs/listing-workflow-migration-tutorial)
- [Feed Type Mappings](https://developer-docs.amazon.com/sp-api/docs/mapping-product-attributes)

---

**We hope this helps you migrate your Amazon integrations without breaking the bank! 💰**

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity13

Early-stage or recently created project

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/beeb184d264a6671b5365c012c286428724ebe9bca9156bc3ab547df6a8a2af9?d=identicon)[drkbcn](/maintainers/drkbcn)

---

Top Contributors

[![malonsolabelgrup](https://avatars.githubusercontent.com/u/64540623?v=4)](https://github.com/malonsolabelgrup "malonsolabelgrup (3 commits)")[![drkbcn](https://avatars.githubusercontent.com/u/2090227?v=4)](https://github.com/drkbcn "drkbcn (1 commits)")

### Embed Badge

![Health badge](/badges/drkbcn-json-listings-feed/health.svg)

```
[![Health](https://phpackages.com/badges/drkbcn-json-listings-feed/health.svg)](https://phpackages.com/packages/drkbcn-json-listings-feed)
```

###  Alternatives

[mtdowling/jmespath.php

Declaratively specify how to extract elements from a JSON document

2.0k472.8M135](/packages/mtdowling-jmespathphp)[opis/closure

A library that can be used to serialize closures (anonymous functions) and arbitrary data.

2.6k230.0M283](/packages/opis-closure)[masterminds/html5

An HTML5 parser and serializer.

1.8k242.8M226](/packages/masterminds-html5)[sabberworm/php-css-parser

Parser for CSS Files written in PHP

1.8k191.2M63](/packages/sabberworm-php-css-parser)[michelf/php-markdown

PHP Markdown

3.5k52.4M344](/packages/michelf-php-markdown)[jms/metadata

Class/method/property metadata management in PHP

1.8k152.8M88](/packages/jms-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
