Как добавить подержанную книгу на Amazon с помощью SP-APIPython

Программы на Python
Гость
Как добавить подержанную книгу на Amazon с помощью SP-API

Сообщение Гость »


I've been trying to do this for about two years now. And I read that at that time (2021) not all types of products were yet available/working correctly. I'm trying to add a book, with this code (for marketplace germany) . But specifically when trying to list a used book, I get the following error: 'code': '4000003', 'message': 'The specified product type is invalid or not supported.', 'severity': 'ERROR' Although the category for supported books is absolutely correct "ABIS_BOOK". I can list other products. Has really nothing changed in 2 years, or am I doing something wrong? If this isn't a bug, what is it?"

I really need your help, any kind at all, please.
import requests import json from creds import credentials token_response = requests.post( "https://api.amazon.com/auth/o2/token", data={ "grant_type": "refresh_token", "refresh_token": credentials["refresh_token"], "client_id": credentials["lwa_app_id"], "client_secret": credentials["lwa_client_secret"], }, ) access_token = token_response.json()["access_token"] endpoint = "https://sellingpartnerapi-eu.amazon.com" seller_id = "XXXXXXXXXX" sku = "SKU1234" marketplace_ids = ["A1PA6795UKMFR9"] attributes = { "condition_type": "UsedGood", "marketplace_id": marketplace_ids, } response = requests.put( f"{endpoint}/listings/2020-09-01/items/{seller_id}/{sku}", params={"marketplaceIds": ','.join(marketplace_ids)}, headers={ "x-amz-access-token": access_token, "Content-Type": "application/json" }, json={ "productType": "ABIS_BOOK", "requirements": "LISTING_OFFER_ONLY", "standard_product_id": { "type": "ASIN", "value": "3776621478"}, "attributes": attributes } ) res = ListingsItems(credentials=credentials, marketplace=Marketplaces.DE) print(response.json())

Источник: https://stackoverflow.com/questions/780 ... the-sp-api

Вернуться в «Python»