amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
611 stars 734 forks source link

Problem with getFeed and downloadFeedDocument #791

Closed cpietsch82 closed 2 years ago

cpietsch82 commented 3 years ago

Hi,

i have the following problem. i would like to generate package labels and for that i need to upload a xml document via PUT to a specific url. Then i need to create a feed for that (feed type: 'POST_FBA_INBOUND_CARTON_CONTENTS') So my problem is now after creating the feed i check the status periodically until the status is 'DONE'. But in my case i've got always the status 'FATAL'. I don't know exactly why. (Thats my first problem)

The feed guide tells me, that i need to download the feed processing report. This is the feed with the id which comes from the getFeed method. The 'getFeedDocument' action gives me all required information about the feed. URL, encryptiondetails and compressionalgorithm (GZIP) as well. Now i can download the file from the url, but the next step is my biggest problem. I've tried all ways. First decompress and then decrypt and vice versa. But nothing returns a valid and readable string or something like that.

Can anyone help me with that? Thanks in advance!

roger-sanchez117 commented 3 years ago

I have exactly the same problem.

I have no idea how to interpret the information returned by the url of the getFeedDocument result. I know that it has to be decompressed with the indicated compression algorithm and decrypted with the encryption details but I am not able to obtain any readable data either.

I would greatly appreciate your help.

rogersv commented 3 years ago

Hi @roger-sanchez117, here is an example for python that should work as a test. I could decrypt my document like this.

from Crypto.Cipher import AES
import base64

key = base64.b64decode("your key")
iv = base64.b64decode("your initializationVector")

res = requests.get("your document url")
encrypt_data = res.content

aes = AES.new(key, AES.MODE_CBC, iv)
decrypted_data = aes.decrypt(encrypt_data)

print(decrypted_data)
roger-sanchez117 commented 3 years ago

Thank you very much @rogersv , I just discovered how to read the feed processing report in PHP.

Now I think I have problems with encryption and padding with PKCS5 as it shows me the following error: "The uploaded document has an illegal block size."

cpietsch82 commented 3 years ago

Has anybody an example with node.js ? Because i use node.js with crypto and here i have no option to use PKCS5 Padding. Is it really necessary? And what about the decompression of the feed? Decompression first and then decryption? Because the downloaded file has no .zip ending.

UPDATE

i've solved the problem with the decryption and decompressing of the feed. But now i have the same error like @roger-sanchez117. "The uploaded document has an illegal block size". So something is wrong with the encryption. But i don't know exactly whats wrong.

Any suggestions?

JacksonJeans commented 3 years ago

@cpietsch82 ,

hello, I have already solved the problem of the longer. Unfortunately, my PHP implementation had the error that I encoded the encrypted content as base64 and only then transferred it as resource.

Whether PKSC5 is a requirement, I have taken classes from the DocumentHelper API of the Java Client implementation of Amazon.

At this line 23:

public class AESCryptoStreamFactory implements CryptoStreamFactory {
    private static final String ENCRYPTION_ALGORITHM = "AES/CBC/PKCS5Padding";

Omit the base64 encoding. This helped me. A quick look into the documentation of NodeJS crypto told me that crypto does support PKSC5 padding.

After that I updated the inventory 2 sample articles. Here comes the resulting document of my example with POST_INVENTORY_AVAILABILITY_DATA Feed.

createFeedDocument with this File:

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>A3IPxxxxxxxxxxx</MerchantIdentifier>
    </Header>
    <MessageType>Inventory</MessageType>

    <Message>
        <MessageID>1</MessageID>
        <OperationType>Update</OperationType>
        <Inventory>
            <SKU>xxxxxx</SKU>
            <Quantity>417</Quantity>
            <FulfillmentLatency>2</FulfillmentLatency>
        </Inventory>
    </Message>

    <Message>
        <MessageID>2</MessageID>
        <OperationType>Update</OperationType>
        <Inventory>
            <SKU>xxxxxx</SKU>
            <Quantity>3782</Quantity>
            <FulfillmentLatency>2</FulfillmentLatency>
        </Inventory>
    </Message>
</AmazonEnvelope>

result from getFeedDocument after this steps:

  1. createFeed,
  2. getFeed until status is DONE,
  3. getFeedDocument
<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
    <Header>
        <DocumentVersion>1.02</DocumentVersion>
        <MerchantIdentifier>A3IPxxxxxxxxx</MerchantIdentifier>
    </Header>
    <MessageType>ProcessingReport</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <ProcessingReport>
            <DocumentTransactionID>2291902018590</DocumentTransactionID>
            <StatusCode>Complete</StatusCode>
            <ProcessingSummary>
                <MessagesProcessed>2</MessagesProcessed>
                <MessagesSuccessful>2</MessagesSuccessful>
                <MessagesWithError>0</MessagesWithError>
                <MessagesWithWarning>0</MessagesWithWarning>
            </ProcessingSummary>
        </ProcessingReport>
    </Message>
</AmazonEnvelope>
cpietsch82 commented 3 years ago

Thanks @JacksonJeans I've solved the problem with uploading the feed. In another thread you mentioned the base64 encoding problem for the uploading content. I remove the encoding and now the upload works fine!

Thanks a lot

akashkaushik33 commented 3 years ago

Hey @cpietsch82 , I am trying to do the same, uploading a document for creating a product. But even after removing the base64 encoding that @JacksonJeans mentioned, I am getting FATAL status.

const _encryptFile = (content, IV, key, algorithm = 'aes-256-cbc') => {
    try {
        const cipher = crypto.createCipheriv(algorithm, Buffer.from(key), Buffer.from(IV));
        const crypted = Buffer.concat([cipher.update(Buffer.from(content)), cipher.final()]);
        return crypted;
    } catch (e) {
        console.log('Error in encrypt file', e);
        return e
    }
};

 const productFileInUTFFormat = fs.readFileSync('../sample-from-amazon.xlsx', 'utf-8');
    const decodedKey = Buffer.from(encryptionDetails.key, 'base64').toString('ascii');
    const decodedIV = Buffer.from(encryptionDetails.initializationVector, 'base64').toString('ascii');
    const encryptedFileContent = _encryptFile(productFileInUTFFormat, decodedIV, decodedKey);

    fs.writeFileSync('tempfile', encryptedFileContent);
    console.log("path.join(__dirname, '../tempfile')", path.join(__dirname, '../../tempfile'));
    const fileData = fs.readFileSync(path.join(__dirname, '../../tempfile'));
    request.put(url, {
        body: fileData,
        headers: {
            'Content-Type': 'text/tab-separated-values; charset=UTF-8'
        }
    }).then(resp => {
        console.log('>>>>>>>', resp);
    }).catch(e => {
        console.log('Errrrrrr', e);
    });

The file that I am using

Screenshot 2020-11-23 at 7 51 28 PM

Is there something I am doing wrong? If possible could you please share the code sample that is working for you?

cpietsch82 commented 3 years ago

@akashkaushik33 here is a code example:

  let key = Buffer.from(encryption_details.key, 'base64');
  let iv  = Buffer.from(encryption_details.initializationVector, 'base64');

  let algo               = 'aes-256-cbc';
  let cipher             = crypto.createCipheriv(algo, key, iv);
  let encrypted_document = Buffer.concat([cipher.update(xml), cipher.final()]);

  let feed_upload_url = new URL(url);
  let options = {
      hostname: feed_upload_url.hostname,
      port: 443,
      path: feed_upload_url.pathname + feed_upload_url.search,
      method: 'PUT',
      headers: {
        'Content-Type': 'text/xml; charset=UTF-8',
        'Content-Length': Buffer.byteLength(encrypted_document)
      }
  };
  return new Promise((resolve, reject) => {
    let req = https.request(options, res => {
      let body = '';
      res.on('data', chunk => {
        body += chunk;
      });
      res.on('end', () => {
        if (res.statusCode === 200) {
          console.log('Document successfully uploaded.');
          resolve();
        } else {
          reject(new Error('Something went wrong in feed uploading.'));
        }
      });
    });
    req.on('error', reject);
    req.write(encrypted_document);
    req.end();
  });

The difference here is i don't use the toString('ascii') method on key and iv for encryption. For my purpose i'm uploading a xml (content-type), but i think it is not important in this case. Did you downloaded the feed processing report? It contains an error message why the feed returns FATAL. Maybe this can help you.

akashkaushik33 commented 3 years ago

@cpietsch82 Thanks a lot. Ahh, I am converting them to ASCII first. I will try it without converting them.
And I have not checked the feed processing report, yet. I will do that right now and see what is causing the issue.

fengmiq commented 3 years ago

Can you tell me how to encrypt and decode document from php?

JacksonJeans commented 3 years ago

@shaoruisky ,

Hello,

please read here. Here you will find some hints on how to encrypt, decrypt and upload documents in PHP.

pengyanbing84 commented 3 years ago

Hi @roger-sanchez117, here is an example for python that should work as a test. I could decrypt my document like this.

from Crypto.Cipher import AES
import base64

key = base64.b64decode("your key")
iv = base64.b64decode("your initializationVector")

res = requests.get("your document url")
encrypt_data = res.content

aes = AES.new(key, AES.MODE_CBC, iv)
decrypted_data = aes.decrypt(encrypt_data)

print(decrypted_data)

I tried to use your Python example, unfortunately an error occurred, error: raise ValueError("Data must be padded to %d byte boundary in CBC mode" % self.block_size) ValueError: Data must be padded to 16 byte boundary in CBC mode

SenQi-666 commented 3 years ago

@rogersv Seeing your reply, I solved the problem of downloading the report. Thank you.

MrYing commented 3 years ago

@JacksonJeans Hi I have a similar problem, but my problem is the XML format. How to correct it is still this error Please have a look my xml: `<?xml`` version="1.0" encoding="UTF-8"?> <AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">

1.02 XXXXXXXX
<MessageType>Product</MessageType>
<PurgeAndReplace>true</PurgeAndReplace>
<Message>
    <MessageID>10001</MessageID>
    <OperationType>Update</OperationType>
    <Product>
        <SKU>XXXXXX</SKU>
        <ProductTaxCode>A_GEN_TAX</ProductTaxCode>
        <LaunchDate>2021-01-05T08:17:01</LaunchDate>
        <DescriptionData>
            <Title> Test</Title>
            <Brand>Test</Brand>
            <Description>This is a test case ,please agree this product publish</Description>
            <BulletPoint>made in China</BulletPoint>
            <BulletPoint>500 thread count</BulletPoint>
            <BulletPoint>plain weave (percale)</BulletPoint>
            <BulletPoint>100% Egyptian cotton</BulletPoint>
            <Manufacturer>Test</Manufacturer>
            <SearchTerms>Test</SearchTerms>
            <SearchTerms>Test-ying</SearchTerms>
            <ItemType>flat-sheets</ItemType>
            <IsGiftWrapAvailable>false</IsGiftWrapAvailable>
            <IsGiftMessageAvailable>false</IsGiftMessageAvailable>
        </DescriptionData>
        <ProductData>
            <Home>
                <Parentage>variation-parent</Parentage>
                <VariationData>
                    <VariationTheme>Size-Color</VariationTheme>
                </VariationData>
                <Material>cotton</Material>
                <ThreadCount>500</ThreadCount>
            </Home>
        </ProductData>
    </Product>
</Message>

`

Get the return `<?xml version="1.0" encoding="UTF-8"?>

1.02 XXXXXXXXX
ProcessingReport 1 XXXXXX Complete 0 0 1 0 0 Error 5001 XML Parsing Fatal Error at Line 1, Column 226: The element type "Header" must be terminated by the matching end-tag "</Header>". The element type "Header" must be terminated by the matching end-tag "</Header>".
`
educatornum commented 3 years ago

Can you tell me how to encrypt and decode document from php?

A long time ago I used the PHP code for Amazon MWS, which may hopefully help you, and I didn't recommend the PHP

$file_name =public_path('download/PackageDownload/cartonfile.xml');
$feed = file_get_contents($file_name); 
$feedHandle = @fopen('php://temp', 'rw+');
fwrite($feedHandle, $feed);
rewind($feedHandle);

$request->setMerchant(MERCHANT_ID);
$request->setMWSAuthToken(MWSAUTHTOKEN);
$request->setMarketplaceIdList($marketplaceIdArray);
$request->setFeedType('POST_FBA_INBOUND_CARTON_CONTENTS');
$request->setContentMd5(base64_encode(md5(stream_get_contents($feedHandle), true)));
rewind($feedHandle);
$request->setPurgeAndReplace(false);
$request->setFeedContent($feedHandle);
try{
      $response = $service->url($request);
} catch{
      //
}
educatornum commented 3 years ago

createFeedDocument with this File:

Hi @JacksonJeans

How I can Create a Feed Document with an XML file?

It is my POSTMAN and the response is 201 but I can't upload an XML file Screen Shot 2021-02-01 at 9 48 12

I don't understand the file body?

Can anyone help me with that? Thanks in advance!

Best regards,

fmeccanici commented 3 years ago

@JacksonJeans

I think I followed every step described by you, but I am still getting the "The uploaded document has an illegal block size." error after decrypting the feed processing report. To achieve encryption and upload the encrypted XML I use the following PHP code:


$feedDocument = $feedsApi->createFeedDocument(new \ClouSale\AmazonSellingPartnerAPI\Models\Feeds\CreateFeedDocumentSpecification([
    'content_type' => 'application/xml; charset=UTF-8'
]));

$documentId = $feedDocument->getPayload()->getFeedDocumentId();
$url = $feedDocument->getPayload()->getUrl();
$key = $feedDocument->getPayload()->getEncryptionDetails()->getKey();
$key = base64_decode($key, true);
$initializationVector = $feedDocument->getPayload()->getEncryptionDetails()->getInitializationVector();
$initializationVector = base64_decode($initializationVector, true);

$file = file_get_contents('./files/order_feed.xml');
$feedData = utf8_encode($file);

$feedDataEncrypted = AESCryptoStreamFactory::encrypt($feedData, $key, $initializationVector);

$api = new RestClient();
$response = $api->put($url, [$feedDataEncrypted], ['Content-Type' => 'application/xml; charset=UTF-8']);

The response gives me an HTTP response code of 200 OK, which suggests that everything is fine. My XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>A2L0**********</MerchantIdentifier>
    </Header>
    <MessageType>OrderFulfillment</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <OperationType>Update</OperationType>
        <OrderFulfillment>
            <AmazonOrderId>405-*******-*******</AmazonOrderId>
            <FulfillmentDate>2021-02-02T10:40:00</FulfillmentDate>
            <FulfillmentData>
                <CarrierName>Post NL</CarrierName>
                <ShippingMethod>Standard</ShippingMethod>
                <ShipperTrackingNumber>3SYUDM********</ShipperTrackingNumber>
            </FulfillmentData>
            <Item>
                <AmazonOrderItemCode>0232392*******</AmazonOrderItemCode>
                <Quantity>1</Quantity>
            </Item>
        </OrderFulfillment>
    </Message>
</AmazonEnvelope>

And the encrypt function, provided by @JacksonJeans, looks like this:

public const BLOCK_SIZE = 8;
public const IV_LENGTH = 16;
public const CIPHER = 'AES256';

public static function encrypt(string $plainText, string $key, string $iv): string
{
    $plainText = static::getPaddedText($plainText);
    return openssl_encrypt($plainText, static::CIPHER, $key, OPENSSL_RAW_DATA, $iv);
}

protected static function getPaddedText(string $plainText): string
{
    $stringLength = strlen($plainText);
    if ($stringLength % static::BLOCK_SIZE) {
        $plainText = str_pad($plainText, $stringLength + static::BLOCK_SIZE - $stringLength % static::BLOCK_SIZE, "\0");
    }
    return $plainText;
}

Does someone know what's going wrong? I have been stuck on this for quite a while. Thanks a lot for your help!

educatornum commented 3 years ago

I solved the FEED FILE UPLOAD with Python

from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Util.Padding import pad
import os, sys
import json
import base64

def pad(s):
    # Data will be padded to 16 byte boundary in CBC mode
    return s + b"\0" * (AES.block_size - len(s) % AES.block_size)

def getKey(password):
    # Use SHA256 to hash password for encrypting AES
    hasher = SHA256.new(password.encode())
    return hasher.digest()

# Encrypt message with password
def encrypt(message, key, iv, key_size=256):
    message = pad(message)
    cipher = AES.new(key, AES.MODE_CBC, iv)
    return iv + cipher.encrypt(message)

# Encrypt file
def encrypt_file(file_name, key, iv):
    # Open file to get file Data
    with open(file_name, "rb") as fo:
        plaintext = fo.read()
    # Encrypt plaintext with key has been hash by SHA256.
    enc = encrypt(plaintext, key, iv)
    # write Encrypted file 
    # and if you need the encrypt file 
    with open(file_name + ".enc", "wb") as fo:
        fo.write(enc)
    return enc

custom_api_headers = {
    "Content-Type": "application/json",
    "x-amz-access-token": "x_amz_access_token",
}
data = {"contentType": "application/xml; charset=UTF-8"}

CREATE_FEED_DOC = requests.post(
    config["BASE_URL"] + "/feeds/2020-09-04/documents",
    headers=custom_api_headers,
    auth=AWSRequestsAuth, # AWS auth library
    data=json.dumps(data)
)

resDoc = CREATE_FEED_DOC.json()["payload"]

# You recieve URL,VC,KEY

url = resDoc["url"]
initializationVector = resDoc["encryptionDetails"]["initializationVector"]
key = resDoc["encryptionDetails"]["key"]
feed_header = {
    "Content-Type": "application/xml; charset=UTF-8",
}

iv = base64.b64decode(initializationVector) # important
filename = "CartonContent.xml"   # you file path and name
encrypt_data = encrypt_file(filename, getKey(key), iv)

res = requests.put(url, data=encrypt_data, headers=feed_header)

print(res.status_code)
print(res.content)

Maybe this can help you. Best regards, Amartuvshin

bk757 commented 3 years ago

content_type

@JacksonJeans

I think I followed every step described by you, but I am still getting the "The uploaded document has an illegal block size." error after decrypting the feed processing report. To achieve encryption and upload the encrypted XML I use the following PHP code:


$feedDocument = $feedsApi->createFeedDocument(new \ClouSale\AmazonSellingPartnerAPI\Models\Feeds\CreateFeedDocumentSpecification([
    'content_type' => 'application/xml; charset=UTF-8'
]));

$documentId = $feedDocument->getPayload()->getFeedDocumentId();
$url = $feedDocument->getPayload()->getUrl();
$key = $feedDocument->getPayload()->getEncryptionDetails()->getKey();
$key = base64_decode($key, true);
$initializationVector = $feedDocument->getPayload()->getEncryptionDetails()->getInitializationVector();
$initializationVector = base64_decode($initializationVector, true);

$file = file_get_contents('./files/order_feed.xml');
$feedData = utf8_encode($file);

$feedDataEncrypted = AESCryptoStreamFactory::encrypt($feedData, $key, $initializationVector);

$api = new RestClient();
$response = $api->put($url, [$feedDataEncrypted], ['Content-Type' => 'application/xml; charset=UTF-8']);

The response gives me an HTTP response code of 200 OK, which suggests that everything is fine. My XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<AmazonEnvelope xsi:noNamespaceSchemaLocation="amzn-envelope.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <Header>
        <DocumentVersion>1.01</DocumentVersion>
        <MerchantIdentifier>A2L0**********</MerchantIdentifier>
    </Header>
    <MessageType>OrderFulfillment</MessageType>
    <Message>
        <MessageID>1</MessageID>
        <OperationType>Update</OperationType>
        <OrderFulfillment>
            <AmazonOrderId>405-*******-*******</AmazonOrderId>
            <FulfillmentDate>2021-02-02T10:40:00</FulfillmentDate>
            <FulfillmentData>
                <CarrierName>Post NL</CarrierName>
                <ShippingMethod>Standard</ShippingMethod>
                <ShipperTrackingNumber>3SYUDM********</ShipperTrackingNumber>
            </FulfillmentData>
            <Item>
                <AmazonOrderItemCode>0232392*******</AmazonOrderItemCode>
                <Quantity>1</Quantity>
            </Item>
        </OrderFulfillment>
    </Message>
</AmazonEnvelope>

And the encrypt function, provided by @JacksonJeans, looks like this:

public const BLOCK_SIZE = 8;
public const IV_LENGTH = 16;
public const CIPHER = 'AES256';

public static function encrypt(string $plainText, string $key, string $iv): string
{
    $plainText = static::getPaddedText($plainText);
    return openssl_encrypt($plainText, static::CIPHER, $key, OPENSSL_RAW_DATA, $iv);
}

protected static function getPaddedText(string $plainText): string
{
    $stringLength = strlen($plainText);
    if ($stringLength % static::BLOCK_SIZE) {
        $plainText = str_pad($plainText, $stringLength + static::BLOCK_SIZE - $stringLength % static::BLOCK_SIZE, "\0");
    }
    return $plainText;
}

Does someone know what's going wrong? I have been stuck on this for quite a while. Thanks a lot for your help!

Fllow Your Steps, And The Report Response: `string(1399) "Feed Processing Summary: Number of records processed 0 Number of records successful 0

original-record-number order-id order-item-id error-code error-type error-message 0 90012 Fatal The required order-id field is missing from the file. To correct this error, download the template again and use the new copy, or insert the required field into your existing file. 0 90061 Warning The <?xml version="1.0" encoding="UTF-8"?>

1.01A1F83G8C2ARO7P
OrderFulfillment1Update203-2465793-09091052021-02-02T10:40:00Yun ExpressStandardYT2106021266031834412459505706271 field heading is invalid, so values in this field were ignored. To correct this error, download the template again and use the new copy, or fix the field heading in your existing file. ` What is the problem happened?

SouravPal95 commented 3 years ago

I am getting DONE as the status. But after generating the processing report I am getting this....

{
  "header": {
    "sellerId": "A1HGLY0OQBKE5U",
    "version": "2.0",
    "feedId": "50034018828"
  },
  "issues": [
    {
      "messageId": 1,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 2,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 3,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 4,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 5,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 6,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 7,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 8,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 9,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    },
    {
      "messageId": 10,
      "code": "4000003",
      "severity": "ERROR",
      "message": "The Amazon product type specified is invalid or not supported."
    }
  ],
  "summary": {
    "errors": 10,
    "warnings": 0,
    "messagesProcessed": 10,
    "messagesAccepted": 0,
    "messagesInvalid": 10
  }
}

I have used LUGGAGE as the productType The listings payload that I am uploading is this

{
  "header": {
    "sellerId": "A1HGLY0OQBKE5U",
    "version": "2.0"
  },
  "messages": [
    {
      "messageId": 1,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Awesome Bronze Car",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk77"
    },
    {
      "messageId": 2,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Sleek Steel Chair",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk80"
    },
    {
      "messageId": 3,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Aerodynamic Iron Gloves",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk81"
    },
    {
      "messageId": 4,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Sleek Copper Clock",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk86"
    },
    {
      "messageId": 5,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Mediocre Plastic Wallet",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk88"
    },
    {
      "messageId": 6,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-6088C959"
    },
    {
      "messageId": 7,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-20D88EFC"
    },
    {
      "messageId": 8,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-0BAF36BA"
    },
    {
      "messageId": 9,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-CD28D4F0"
    },
    {
      "messageId": 10,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-9A544946"
    },
    {
      "messageId": 11,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-F2FD045F"
    },
    {
      "messageId": 12,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-0138EE43"
    },
    {
      "messageId": 13,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-D334BA28"
    },
    {
      "messageId": 14,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-8650D0FD"
    },
    {
      "messageId": 15,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] 1 L Le Parfait Jar",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "SLLPJ-8D93E1C3"
    },
    {
      "messageId": 16,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Gorgeous Copper Hat",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk94"
    },
    {
      "messageId": 17,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "[Sample] Tiered Wire Basket",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "TWB"
    },
    {
      "messageId": 18,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Heavy Duty Cotton Gloves",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk98"
    },
    {
      "messageId": 19,
      "operationType": "UPDATE",
      "productType": "LUGGAGE",
      "attributes": {
        "item_name": [
          {
            "value": "Ergonomic Steel Lamp",
            "language_tag": "en_US",
            "marketplace_id": "A21TJRUUN4KGV"
          }
        ]
      },
      "sku": "sk103"
    }
  ]
}
johnkw commented 3 years ago

The pointless extra crypto is deprecated - switch over to https://github.com/amzn/selling-partner-api-docs/blob/main/references/reports-api/reports_2021-06-30.md#reportdocument and close this bug. @parvathm @jenilew

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.