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
612 stars 739 forks source link

How to set discount price in Amazon Listing API? #2774

Closed FatmaSedaOZYURT closed 8 months ago

FatmaSedaOZYURT commented 8 months ago

By using Listing API, I work to offer exist product in Amazon with LISTING_OFFER_ONLY. But I failing unsuccesfully discount_price. I always have error message : An internal error has occurred. Try again. purchasable_offer object is this: "purchasable_offer": [ { "currency": "TRY", "discounted_price": [ { "schedule": [ { "value_with_tax": "9000.0", "end_date": "2024-03-12", "start_date": "2024-03-04" } ] } ], "our_price": [ { "schedule": [ { "value_with_tax": "9999.0" } ] } ] } ]

and my error message: { "sku": "Test-123-TESTTESTTEST", "status": "INVALID", "submissionId": "b4f2XXX...", "issues": [ { "code": "4000000", "message": "An internal error has occurred. Try again.", "severity": "ERROR", "categories": [] } ] }

My Request: curl --location --request PUT 'https://sellingpartnerapi-eu.amazon.com/listings/2021-08-01/items/MyMerchantToken/Test-123-TESTTESTTEST?marketplaceIds=A33AVAJ2PDY3EV' \ --header 'x-amz-access-token: My access token' \ --header 'X-Amz-Security-Token: My session token' \ --header 'Content-Type: application/json' \ --data '{ "productType": "SHOES", "requirements": "LISTING_OFFER_ONLY", "attributes": { "purchasable_offer": [ { "marketplace_id": "A33AVAJ2PDY3EV", "currency": "TRY", "discounted_price": [ { "schedule": [ { "value_with_tax": "9000.0", "end_date": "2024-03-12", "start_date": "2024-03-04" } ] } ], "our_price": [ { "schedule": [ { "value_with_tax": "9999.0" } ] } ] } ], "condition_type": [ { "value": "new_new" } ], "condition_note": [ { "value": "TEST TEST TEST" } ], "merchant_release_date": [ { "value": "2024-03-04" } ], "max_order_quantity": [ { "value": 1 } ], "merchant_suggested_asin": [ { "value": "an exist product'\''s ASIN" } ], "fulfillment_availability": [ { "fulfillment_channel_code": "DEFAULT", "quantity": "100", "lead_time_to_ship_max_days": 7, "restock_date": "2024-04-29" } ], "gift_options": [ { "can_be_messaged": false, "can_be_wrapped": false } ], "externally_assigned_product_identifier": [ { "type": "ean", "value": "an exist product'\''s EAN" } ] } }'

_How to fix this problem? How to need to send purchasable_offer?_

FatmaSedaOZYURT commented 8 months ago

The problem is caused by incorrect field spelling in my body content. start_date -> start_at end_date -> end_at

"purchasable_offer": [ { "currency": "TRY", "discounted_price": [ { "schedule": [ { "value_with_tax": "9000.0", "end_at": "2024-03-12", "start_at": "2024-03-04" } ] } ], "our_price": [ { "schedule": [ { "value_with_tax": "9999.0" } ] } ] } ]