saleweaver / python-amazon-sp-api

Python wrapper to access the amazon selling partner API
https://python-amazon-sp-api.readthedocs.io/en/latest/
MIT License
521 stars 234 forks source link

For CatalogItems, attributes in IncludedData is not working. #1031

Closed nabeel-io closed 1 year ago

nabeel-io commented 1 year ago

Describe the bug In CatalogItems the option IncludedData type for attributes is showing error for search_catalog_items function, there seems to be a mistake in core code for not including this option please take a look to fix it.

To Reproduce

from sp_api.api import CatalogItems CatalogItems(credentials=credentials, marketplace=Marketplaces.IN).search_catalog_items(keywords=['B09C2NSYVT,B0B6RLSSH8'],marketplaceIds=['A21TJRUUN4KGV'], includedData=["attributes"]).payload

Expected behavior 'attributes': {'binding': [{'value': 'spiral_bound', 'marketplace_id': 'A21TJRUUN4KGV'}], 'item_package_weight': [{'unit': 'kilograms', 'value': 0.07, 'marketplace_id': 'A21TJRUUN4KGV'}], 'language': [{'type': 'published', 'value': 'english', 'marketplace_id': 'A21TJRUUN4KGV'}], 'manufacturer': [{'language_tag': 'en_IN', 'value': 'Rays Of Ink', 'marketplace_id': 'A21TJRUUN4KGV'}], 'pages': [{'value': 20, 'marketplace_id': 'A21TJRUUN4KGV'}], 'recommended_browse_nodes': [{'value': '1318060031', 'marketplace_id': 'A21TJRUUN4KGV'}], 'bullet_point': [{'language_tag': 'en_IN', 'value': '[Stress Relieving Designs that are Great for Relaxation] Each coloring page is designed to provide calmness and relaxation as you channelize your energies for creative expression.', 'marketplace_id': 'A21TJRUUN4KGV'}, {'language_tag': 'en_IN', 'value': '[Beautiful Artwork and Designs] Well-crafted illustrations and designs that lay the groundwork for you to create your own frame-worthy mandalas.', 'marketplace_id': 'A21TJRUUN4KGV'}, {'language_tag': 'en_IN', 'value': '[High Resolution Digital Printing] Each image is printed in high resolution to offer crisp, sharp designs that enable trouble free coloring and high quality display.', 'marketplace_id': 'A21TJRUUN4KGV'}, {'language_tag': 'en_IN', 'value': '[Single-sided Pages] Every image is printed on a single-sided page, so that you can use a broad variety of coloring choices without fearing bleed through. Moreover, single-side pages can be framed to display your masterpieces.', 'marketplace_id': 'A21TJRUUN4KGV'}, {'language_tag': 'en_IN', 'value': '[Suitable for Adults With Different Skill Levels] This coloring book offers a broad variety of designs suited for all skill levels - ranging from beginner to expert level.', 'marketplace_id': 'A21TJRUUN4KGV'}], 'publication_date': [{'value': '2021T', 'marketplace_id': 'A21TJRUUN4KGV'}], 'item_dimensions': [{'width': {'unit': 'centimeters', 'value': 18.0}, 'length': {'unit': 'centimeters', 'value': 24.0}, 'height': {'unit': 'centimeters', 'value': 1.0}, 'marketplace_id': 'A21TJRUUN4KGV'}], 'subject_keyword': [{'language_tag': 'en_IN', 'value': 'ar', 'marketplace_id': 'A21TJRUUN4KGV'}], 'product_description': [{'language_tag': 'en_IN', 'value': 'This adult coloring book from Rays of Ink has 20 unique handmade mandala designs. It provides hours of fun, calm, relaxation and stress relief through creative expression. These beautiful designs are printed single-sided and range in complexity and detail from intermediate to expert-level.', 'marketplace_id': 'A21TJRUUN4KGV'}], 'brand': [{'language_tag': 'en_IN', 'value': 'Rays Of Ink', 'marketplace_id': 'A21TJRUUN4KGV'}], 'supplier_declared_dg_hz_regulation': [{'value': 'not_applicable', 'marketplace_id': 'A21TJRUUN4KGV'}], 'generic_keyword': [{'language_tag': 'en_IN', 'value': 'coloring books for adult mandala colouring books mandala drawing book mandala books for adults adult coloring books therapy mandala art book for drawing mandala art book for adult', 'marketplace_id': 'A21TJRUUN4KGV'}], 'item_name': [{'language_tag': 'en_IN', 'value': 'Rays Of Ink Mandala Coloring Book For Adults | Ideal For Stress Relieving, Relaxing & Meditation | 120 GSM Thick Paper', 'marketplace_id': 'A21TJRUUN4KGV'}], 'list_price': [{'value_with_tax': 299.0, 'currency': 'INR', 'marketplace_id': 'A21TJRUUN4KGV'}], 'batteries_required': [{'value': False, 'marketplace_id': 'A21TJRUUN4KGV'}], 'product_site_launch_date': [{'value': '2021-08-06T16:21:56.988Z', 'marketplace_id': 'A21TJRUUN4KGV'}], 'item_package_dimensions': [{'length': {'unit': 'centimeters', 'value': 1.4}, 'width': {'unit': 'centimeters', 'value': 20.9}, 'height': {'unit': 'centimeters', 'value': 30.0}, 'marketplace_id': 'A21TJRUUN4KGV'}]}

A clear and concise description of what you expected to happen. The output should come like above, instead it shows this error

SellingApiBadRequestException: [{'code': 'InvalidInput', 'message': "Invalid 'includedData' requested.", 'details': ''}]

saleweaver commented 1 year ago
 includedData="attributes"

Not all sellers can get all data.

nabeel-io commented 1 year ago

includedData="attributes" Even with the above code I don't get the result. We have access to attributes data and it is working fine in Postman, but once I make a call with the Python API it shows an error .This asin is also from our own brand