Inventory Loader

Parameters

merchantId

There is documentation on how to retrieve your merchantId in the Common required parameters section of the Flat file feeds page.

shippingGroupMap

This parameter is a mapping of your account's shipping group names to their internal Amazon identifiers.

To produce this mapping, use the getDefinitionsProductType endpoint of the Selling Partner API to retrieve your seller-account-specific product JSON schema. Make sure to use PRODUCT for the product type, the marketplace ID of the marketplace this feed will be sent to, and the same merchant ID that you're using when you submit the feed. If you're using jlevers/selling-partner-api to interact with the Selling Partner API, that would look like this:

use SellingPartnerApi\SellingPartnerApi;
use SellingPartnerApi\Enums\Endpoint;

$connector = SellingPartnerApi::seller(
    clientId: 'amzn1.application-oa2-client.asdfqwertyuiop...',
    clientSecret: 'amzn1.oa2-cs.v1.1234567890asdfghjkl...',
    refreshToken: 'Atzr|IwEBIA...',
    endpoint: Endpoint::NA,  // Or Endpoint::EU, Endpoint::FE
);
$api = $connector->productTypeDefinitionsV20200901();
$response = $api->getDefinitionsProductType(
    productType: 'PRODUCT',
    marketplaceIds: ['ATVPDKIKX0DER'],
    sellerId: 'YOUR-MERCHANT-ID',
);

Then, pass the schema URL to Converter::parseShippingGroups():

use SellingPartnerApi\FeedTransformer\Transformer;

$productTypeDefinition = $response->dto();
$schemaUrl = $productTypeDefinition->schema->link->resource;
$shippingGroupMap = Transformer::parseShippingGroups($schemaUrl);

Usage

To convert a POST_FLAT_FILE_INVLOADER_DATA feed to the newer JSON_LISTINGS_FEED format:

use SellingPartnerApi\FeedTransformer\Transformer;
use SellingPartnerApi\FeedTransformer\FeedTypes\Invloader;

$feedFile = 'path/to/your/feed.tab';
$json = Transformer::fromFile(
    Invloader::$feedType,
    $feedFile,
    'ATVPDKIKX0DER',
    [
        'merchantId' => 'A2DI..........',
        'shippingGroupMap' => $shippingGroupMap
    ]
);

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

Known columns

This is an exhaustive list of the columns we support for this feed type. If you are successfully passing feed files with additional columns, let us know and we'll add support for the ones we're missing.

  • sku

  • price

  • quantity

  • product-id

  • product-id-type

  • add-delete

  • will-ship-internationally (this field will not throw an error, but has no corresponding field in the JSON schema, so no action will be taken related to this field)

  • expedited-shipping (ditto will-ship-internationally)

  • standard-plus (ditto will-ship-internationally and expedited-shipping)

  • minimum-seller-allowed-price

  • maximum-seller-allowed-price

  • handling-time

  • fulfillment-center-id

  • item-condition

  • item-note

  • Plus: any and all fields related to product details, such as hazmat and battery info, tax code, etc.

Last updated