Transform your legacy Amazon XML feeds into the new JSON_LISTINGS_FEED format for SP-API. Free and Open Source!
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 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, we faced the same situation and needed a cost-effective solution, so we built this free and open-source transformer for the community.
- π 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
git clone https://github.com/drkbcn/json_listings_feed.git
cd json_listings_feed
composer installCopy .env.example to .env and configure your Amazon SP-API credentials.
use Labelgrup\AmazonTransformer\Transformer;
$transformer = new Transformer($sellerId, $marketplaceId);
$json = $transformer->transformXmlToJson($xmlContent);
echo $json;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)Old XML Format:
<AmazonEnvelope>
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>A3UM3SGRVK155I</MerchantIdentifier>
</Header>
<MessageType>Inventory</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Inventory>
<SKU>B0182SJFQQ</SKU>
<Quantity>5</Quantity>
</Inventory>
</Message>
</AmazonEnvelope>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
}
]
}
]
}
]
}Old XML Format:
<AmazonEnvelope>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Price>
<SKU>RS-7IGC-AFXK</SKU>
<StandardPrice currency="EUR">18.78</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>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/inventory.phpβ Complete inventory update workflowexamples/pricing.phpβ Complete pricing update workflow
check_feed.phpβ Monitor feed processing statuscheck_product.phpβ Get product information and pricing details
# 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]- β 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
Created with β€οΈ by @drkbcn at Labelgrup Networks.
- πΌ Company: labelgrup.com
- β Support: Ko-fi
- π§ Contact: hello@labelgrup.com
Did this project save you money? Consider:
- β Starring this repository
- π Reporting issues or requesting features
- π Contributing code improvements
- β Buying me a coffee
MIT License - Free to use, modify, and distribute!
- Inspiration: Amazon Sellers community facing migration challenges
- Built on: jlevers/selling-partner-api (the excellent free SP-API library)
- Alternative to: Highside Labs' commercial Feed Transformer (which charges $299-$899 per feed type)
We hope this helps you migrate your Amazon integrations without breaking the bank! π°