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
586 stars 730 forks source link

Listings API putListingsItem How To Update price and quantity? #419

Closed doverradio closed 4 months ago

doverradio commented 2 years ago

All I want to do is use the Amazon SP-API Listings API's putListingsItem call to update the price and quantity of an item I have listed.

productType

According to the ListingsItemPutRequest docs, productType and attributes are required for this call.

Firstly, to obtain the correct productType value, you are supposed to search for a product definitions type using the Product Type Definitions API. So, I do that, and call searchDefinitionsProductTypes, just to discover my product has no matching product type.

Ultimately, I gave the value PRODUCT for productType field. As a result, the getDefinitionsProductType call returned an object containing an array of propertyNames, shown below:

        "propertyNames": [
            "skip_offer",
            "fulfillment_availability",
            "map_policy",
            "purchasable_offer",
            "condition_type",
            "condition_note",
            "list_price",
            "product_tax_code",
            "merchant_release_date",
            "merchant_shipping_group",
            "max_order_quantity",
            "gift_options",
            "main_offer_image_locator",
            "other_offer_image_locator_1",
            "other_offer_image_locator_2",
            "other_offer_image_locator_3",
            "other_offer_image_locator_4",
            "other_offer_image_locator_5"
        ]
    },

On seeing this, I decide list_price and fulfillment_availability must be the price and quantity and then try using these in my code below.

attributes

The attributes value is also required. However, their current docs show no clear example of what to put for these values, which are where I must put price and quantity somewhere.

I found this link about patchListingsItem and tried to implement that below but got an error.

code:

// trying to update quantity... failed.

    a.response =  await a.sellingPartner.callAPI({
        operation:'putListingsItem',
        path:{
          sellerId: process.env.SELLER_ID,
          sku: `XXXXXXXXXXXX`
        },
        query: {
          marketplaceIds: [ `ATVPDKIKX0DER` ]
        },
        body: {
          "productType": `PRODUCT`
          "requirements": "LISTING_OFFER_ONLY",
          "attributes": {
                "fulfillment_availability": {
                    "fulfillment_channel_code": "AMAZON_NA",
                            "quantity": 4,
                            "marketplace_id": "ATVPDKIKX0DER"
                        }
                    }
      });

    console.log( `a.response: `, a.response )

error:

{
    "sku": "XXXXXXXXXXXX",
    "status": "INVALID",
    "submissionId": "34e1XXXXXXXXXXXXXXXXXXXX",
    "issues": [{
        "code": "4000001",
        "message": "The provided value for 'fulfillment_availability' is invalid.",
        "severity": "ERROR",
        "attributeName": "fulfillment_availability"
    }]
}

I also tried using list_price :

// list_price attempt... failed.

    a.response =  await a.sellingPartner.callAPI({
        operation:'putListingsItem',
        path:{
          sellerId: process.env.SELLER_ID,
          sku: `XXXXXXXXXXXX`
        },
        query: {
          marketplaceIds: [ `ATVPDKIKX0DER` ]
        },
        body: {
          "productType": `PRODUCT`
          "requirements": "LISTING_OFFER_ONLY",
          "attributes": {
                "list_price": {
                    "Amount": 90,
                    "CurrencyCode": "USD"
                }
      });

    console.log( `a.response: `, a.response )

Error (this time seems I got warmer... maybe?):


{
    "sku": "XXXXXXXXXXXX",
    "status": "INVALID",
    "submissionId": "34e1XXXXXXXXXXXXXXXXXXXX",
    "issues": [{
        "code": "4000001",
        "message": "The provided value for 'list_price' is invalid.",
        "severity": "ERROR",
        "attributeName": "list_price"
    }]
}

How do you correctly specify the list_price or the quantity so this call will be successful?

Just tryin to update a single item's price and quantity.

AshleyBurr commented 2 years ago

I am keen to know the answer to this one too.

shirushi-dev commented 2 years ago

me toooo

tbrains commented 2 years ago

@doverradio

Update the purchasable_offer attribute to update the price with patchListingItems, Ex:

        patch_data = {
            "productType":
            "PRODUCT",
            "patches": [{
                "op":
                "replace",
                "path":
                "/attributes/purchasable_offer",
                "value": [{
                    "marketplace_id": marketplace_data.marketplace_id,
                    "currency": currency,
                    "our_price": [{
                        "schedule": [{
                            "value_with_tax": f"{price:.2f}"
                        }]
                    }]
                }]
            }]
        }
doverradio commented 2 years ago

@tbrains

I rewrote my patchListingsItem call in the following way, based upon your suggestion:

let price = 50
let sku = `XXXXXXXXXX`
let response =  await sellingPartner.callAPI({
            operation:'patchListingsItem',
            path:{
              sellerId: `XXXXXXXXXX`,
              sku: sku
            },
            query: {
              marketplaceIds: [ `XXXXXXXXXX` ]
            },
            body: {
              "productType": "PRODUCT",
              "patches": [{
                "op":
                "replace",
                "path": "/attributes/purchasable_offer",
                "value": [{
                    "marketplace_id": 'XXXXXXXXXX',
                    "currency": 'USD',
                    "our_price": [{
                        "schedule": [{
                            "value_with_tax": price
                        }]
                    }]
                }]
            }]
          } } );

The result looked very promising...

{
    "sku": "XXXXXXXXXX",
    "status": "ACCEPTED",
    "submissionId": "xxxxxxxxxxxxxxxxxxxxxx",
    "issues": []
}

Unfortunately, after waiting, the price remained same.

tbrains commented 2 years ago

It takes few minutes to reflect in the dashboard.

doverradio commented 2 years ago

@tbrains YOU GENIUS!!!!

Ok, it completely worked guys, he knows the way.

Please, can you show how to do quantity next?

tbrains commented 2 years ago

Quantity is similar, you have to patch the attribute fulfillment_availability,

fulfillment_channel_code = "DEFAULT"  # MFN

patch_data = {
    "productType":
    "PRODUCT",
    "patches": [{
        "op": "replace",
        "path": "/attributes/fulfillment_availability",
        "value": [{
            "fulfillment_channel_code": fulfillment_channel_code,
            "quantity": quantity
        }]
    }]
}
shirushi-dev commented 2 years ago

@tbrains

Is it possible to update "fulfillment_availability" only for "patchListingsItem"? I'm confused because I'm not sure how to use "patchListingsItem" and "putListingsItem".

(From Google Translate)

tbrains commented 2 years ago

@shirushi-dev

putListingsItem: This is used to Create or Fully Update Listings. patchListingItem: This is used to partially update a listing.

If you are just updating price and quantity of an existing listing, then putListingItem is perfect, read more.

If you are using python, then you can check this library.

shirushi-dev commented 2 years ago

@tbrains Is it possible to update "fulfillment_availability" using "patchListingsItem"?

I couldn't do that.

tbrains commented 2 years ago

@shirushi-dev, its possible for MFN listings.

shirushi-dev commented 2 years ago

@tbrains It's done! Thank you very much.

michael-land commented 2 years ago

is it possible to update business price via Listing API?

tbrains commented 2 years ago

@xiaoyu-tamu, right now its not possible to update the business price via Listing API.

stefnats commented 2 years ago

Just to be clear, the feeds Api is able to do that.

michael-land commented 2 years ago

The feed processing time is longer than the ListingApi endpoint unfortunately

stefnats commented 2 years ago

That's absolutely right.

A few other thoughts on that: Changing few prices with a feed takes usually less than 30 sec and changing the price via Api does not guarantee that the price will be displayed immediately on the Amazon retail website / product page (but in seller central)

BashaBill commented 2 years ago

Does anyone here have a simple example of the JSON they are submitting to the 'putListingsItem' when trying to 'create' a new listing?

I have only EAN, price and free stock and would like to create and update listings. Thank you.

kdfhhao commented 2 years ago

@tbrains I want to update list_price through patchListingsItem, no matter it is /attributes/list_price or /attributes/purchasable_offer, the error code 4000001 The provided value for 'list_price' is invalid.or The provided value for 'purchasable_offer ' is invalid. do you have an example? thanks.

kdfhhao commented 2 years ago

list_price":{"$comment":"This attribute represents the list price, also known as the manufacturer's suggested retail price (MSRP), the recommended retail price (RRP) or the suggested retail price (SRP) and is the price the manufacturer recommends the retailer sell the product for","title":"List Price","description":"Provide the list price for the product. This is often referred to as the manufacturer's suggested retail price (MSRP), the recommended retail price (RRP) or the suggested retail price (SRP)","examples":["64 USD, 69 GBP, 98 EUR"],"type":"array","minItems":1,"minUniqueItems":1,"maxUniqueItems":1,"selectors":["marketplace_id","currency"],"items":{"type":"object","required":["currency","marketplace_id","value"],"properties":{"value":{"title":"List Price","description":"Provide the list price for the product not including the tax. List price is often referred to as the manufacturer's suggested retail price (MSRP), the recommended retail price (RRP) or the suggested retail price (SRP). This is not the offering or cost price.","editable":true,"hidden":false,"examples":["64"],"type":"number","minimum":0.0},"currency":{"$comment":"The Manufacturer's Suggested Retail Price (MSRP) for the product--not the price for which you plan to sell it, which you'll specify later. This information will be used to display \"List Price\" on the product detail page. Don't know the MSRP? Leave it blank..","title":"List Price Currency","description":"Select the corresponding currency","editable":false,"hidden":true,"examples":["USD"],"type":"string","enum":["AED","ALL","ARS","ATS","AUD","BAM","BEF","BGN","BHD","BOB","BRL","BYR","CAD","CHF","CLP","CNY","COP","CRC","CSD","CZK","DEM","DKK","DOP","DZD","EEK","EGP","ESP","EUR","FIM","FRF","GBP","GRD","GTQ","HKD","HNL","HRK","HUF","IDR","ILS","INR","IQD","ISK","ITL","JOD","JPY","KES","KRW","KWD","LBP","LTL","LUF","LVL","LYD","MAD","MKD","MXN","MYR","NGN","NIO","NOK","NZD","OMR","PAB","PEN","PHP","PLN","PTE","PYG","QAR","RON","RSD","RUB","SAR","SDG","SEK","SGD","SKK","SVC","SYP","THB","TND","TRY","TWD","UAH","USD","UYU","VEF","VND","YER","ZAR"],"enumNames":["AED","ALL","ARS","ATS","AUD","BAM","BEF","BGN","BHD","BOB","BRL","BYR","CAD","CHF","CLP","CNY","COP","CRC","CSD","CZK","DEM","DKK","DOP","DZD","EEK","EGP","ESP","EUR","FIM","FRF","GBP","GRD","GTQ","HKD","HNL","HRK","HUF","IDR","ILS","INR","IQD","ISK","ITL","JOD","JPY","KES","KRW","KWD","LBP","LTL","LUF","LVL","LYD","MAD","MKD","MXN","MYR","NGN","NIO","NOK","NZD","OMR","PAB","PEN","PHP","PLN","PTE","PYG","QAR","RON","RSD","RUB","SAR","SDG","SEK","SGD","SKK","SVC","SYP","THB","TND","TRY","TWD","UAH","USD","UYU","VEF","VND","YER","ZAR"]},"marketplace_id":{"$ref":"#/$defs/marketplace_id"}},"additionalProperties":false}}

tbrains commented 2 years ago

@kdfhhao, can you share your code or the json data you are sending

tbrains commented 2 years ago

Does anyone here have a simple example of the JSON they are submitting to the 'putListingsItem' when trying to 'create' a new listing?

I have only EAN, price and free stock and would like to create and update listings. Thank you.

@BashaBill have you checked this tutorial, it also has sample request

kdfhhao commented 2 years ago

@tbrains path = "/attributes/list_price"; {"productType":"PRODUCT","patches":[{"op":1,"path":"/attributes/list_price","value":["{"currency":USD,"marketplace_id":"ATVPDKIKX0DER","amount":14.98}"]}]} or {"productType":"PRODUCT","patches":[{"op":1,"path":"/attributes/list_price","value":["{"currency":USD,"marketplace_id":"ATVPDKIKX0DER","value":14.98}"]}]} thank you.

tbrains commented 2 years ago

@kdfhhao the value of op is replace and put price inside our_price, follow the exact structure

BashaBill commented 2 years ago

Does anyone here have a simple example of the JSON they are submitting to the 'putListingsItem' when trying to 'create' a new listing? I have only EAN, price and free stock and would like to create and update listings. Thank you.

@BashaBill have you checked this tutorial, it also has sample request

I have yes. This assumes you already have a SKU.. what if you have a new product you want to list? Have you done this before?

Thanks for your response too. 👍

kdfhhao commented 2 years ago

@tbrains thank you. After testing it still throws the error

{"productType":"PRODUCT","patches":[{"op":"replace","path":"/attributes/list_price","value":["{"currency":"USD","marketplace_id":"ATVPDKIKX0DER","our_price": [{"schedule": [{"value_with_tax":14.98}]}]}"]}]}

Still getting error, list_price has separate struct, I suspect there is something wrong with this.

kdfhhao commented 2 years ago

@tbrains I try to replace our_price with list_price, the error is still there, and the amount is still there.

kdfhhao commented 2 years ago

@tbrains thank you list_price update success
Must have the following format, which is different from purchasable_offer. {"productType":"PRODUCT","patches":[{"op":"replace","path":"/attributes/list_price","value":[{"currency":"USD","marketplace_id":"ATVPDKIKX0DER","value":14.98}]}]}

Om3n31 commented 2 years ago

@tbrains I don't understand why it is so difficult to get clear documentation about this API, thanks a lot for ending my frustration.

tbrains commented 2 years ago

no probs, yes I agree, the docs are very verbose and confusing.

hashhesh commented 2 years ago

Hi All

@tbrains , I hope i can get your advise I have tried as you shown here but always getting _"The provided value for 'purchasableoffer' is invalid" error I have even tried as @kdfhhao suggested but even with no luck the same error with only difference purchasable_offer/list_price . Honestly I have no idea what's wrong since it's works fine you.

    $data = [
        "product_type" => "PRODUCT",
        "patches" => [
            new SellingPartnerApi\Model\Listings\PatchOperation([
                "op" => "replace",
                "path" => "/attributes/purchasable_offer",
                "value" => [
                    "marketplace_id" => $merchant_data['marketplace_ids'],
                    "currency" => $currency,
                    "our_price" => [
                        "schedule" => [
                            "value_with_tax" => (double)$formated_price,
                        ]
                    ]
                ]
            ]),
        ],
    ];

    $body = new \SellingPartnerApi\Model\Listings\ListingsItemPatchRequest($data);

    $apiInstance = new SellingPartnerApi\Api\ListingsApi($config);
$result = $apiInstance->patchListingsItem($merchant_data['seller_id'], $form_data['product_sku'], $merchant_data['marketplace_ids'], $body, 'en_US');

and this is the response

            [sku] => 100pcs Security Bit Tool Set Torx Hex SH
            [status] => INVALID
            [submission_id] => 97396630e315474d98bd44f002e3cb9b
            [issues] => Array
                (
                    [0] => SellingPartnerApi\Model\Listings\Issue Object
                        (
                            [container:protected] => Array
                                (
                                    [code] => 4000001
                                    [message] => The provided value for 'purchasable_offer' is invalid.
                                    [severity] => ERROR
                                    [attribute_names] => Array
                                        (
                                            [0] => purchasable_offer
                                        )

                                )

                        )

                )

One last thing, the same goes with _fulfillment_channelcode Could you please if you don't mind help me if there is anything i should consider/pay more attention??

Thanks a million in advance

kdfhhao commented 2 years ago

Structure error, the correct way to query the structure.

在 2022年5月19日,16:45,hashhesh @.***> 写道:

 Hi All

@tbrains , I hope i can get your advise I have tried as you shown here but always getting "The provided value for 'purchasable_offer' is invalid" error I have even tried as @kdfhhao suggested but even with no luck the same error with only difference purchasable_offer/list_price . Honestly I have no idea what's wrong since it's works fine you.

$data = [
    'product_type' => 'PRODUCT',
    'patches' => [
        new SellingPartnerApi\Model\Listings\PatchOperation([
            'op' => 'replace',
            'path' => '/attributes/purchasable_offer',
            "value" => [
                "marketplace_id" => $merchant_data['marketplace_ids'],
                "currency" => $currency,
                "our_price" => [
                    "schedule" => [
                        "value_with_tax" => (double)$formated_price,
                    ]
                ]
            ]
        ]),
    ],
];

$body = new \SellingPartnerApi\Model\Listings\ListingsItemPatchRequest($data);

$apiInstance = new SellingPartnerApi\Api\ListingsApi($config);

$result = $apiInstance->patchListingsItem($merchant_data['seller_id'], $form_data['product_sku'], $merchant_data['marketplace_ids'], $body, 'en_US'); and this is the response

        [sku] => 100pcs Security Bit Tool Set Torx Hex SH
        [status] => INVALID
        [submission_id] => 97396630e315474d98bd44f002e3cb9b
        [issues] => Array
            (
                [0] => SellingPartnerApi\Model\Listings\Issue Object
                    (
                        [container:protected] => Array
                            (
                                [code] => 4000001
                                [message] => The provided value for 'purchasable_offer' is invalid.
                                [severity] => ERROR
                                [attribute_names] => Array
                                    (
                                        [0] => purchasable_offer
                                    )

                            )

                    )

            )

Could you please if you don't mind help me if there is anything i should consider/pay more attention??

Thanks a million in advance

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.

kdfhhao commented 2 years ago

@hashhesh If you're updating list_price you'll have to follow the format above because as far as I know list_price don't belong to the node purchasable_offer. "path" => "/attributes/list_price",

BashaBill commented 2 years ago

Does anyone know how to update the Shipping status of Orders using Amazon SP API? I am struggling to find out anything about it. thanks

hashhesh commented 2 years ago

@hashhesh If you're updating list_price you'll have to follow the format above because as far as I know list_price don't belong to the node purchasable_offer. "path" => "/attributes/list_price",

Hi @kdfhhao thanks for reply. I have tried "path" => "/attributes/list_price" but still facing the same issue. One more thing if you don't could you please tell me where my mistake in structure despite "path" => "/attributes/list_price", thanks

tbrains commented 2 years ago

Hello @hashhesh,

In the response, the sku looks like product title, can you cross check that and other values (seller_id, sku, marketplace_id, patch_data). Also, can you post the final patch data (JSON) that you are passing to patchListingsItem.

kdfhhao commented 2 years ago

@hashhesh You need to pay attention to the fact that the transferred data cannot be directly spliced into JSON. The data should be transferred in the form of classes. You can monitor the transferred data and observe the characteristics of the data!

在 2022年5月20日,20:25,tbc @.***> 写道:

Hello @hashhesh,

In the response, the sku looks like product title, can you cross check that and other values (seller_id, sku, marketplace_id, patch_data). Also, can you post the final patch data (JSON) that you are passing to patchListingsItem

hashhesh commented 2 years ago

Really appreciated guys @tbrains & @kdfhhao thanks for your reply, after a while I tried again and it's works as you advise above. ,thanks again guys

kdfhhao commented 2 years ago

@tbrains When I use the order number to update the order status, the following problem occurs. When the same code is accessed normally in North America, the following error is reported in Europe, which is completely nonsensical. 404 bad request. Your browser sent a request that this server could not understand. Size of a request header field exceeds server limit. Did you encounter this problem? I see a few people have this problem amzn/selling-partner-api-models#2961

332

ThanhLuan0932 commented 2 years ago

Does anyone here have a simple example of the JSON they are submitting to the 'putListingsItem' when trying to 'create' a new listing?

I have only EAN, price and free stock and would like to create and update listings. Thank you.

hi @BashaBill, did you solved this ? If done, can you give me a reference to your Json attribute file ? I'm having a little trouble with providing the attribute to the putListingsItem API. Thanks a lot !

BashaBill commented 2 years ago

Hi @ThanhLuan0932

I, like you, only had the EAN, Price and Free Stock values to begin with. The issue I found was that Amazon SP-API does not offer a 'BOOK' product definition. When using Amazon's own API (product-type-definitions-api-model) to query a 'Book', no 'BOOK' definition was found. This is apparently due to it not being setup yet on the Amazon UK Marketplace for Amazon SP-API.

So we are left with the more generic PRODUCT type definition to work with.

The PRODUCT type definition has a required field you have to submit in the feed. that is 'merchant-suggested-asin'. This is REQUIRED so you need to supply it.

This led me to having to create a ASIN Lookup service for all the EANs we have in our system (you can download a report of your whole inventory via Seller Central to get most of the ASINs you have already used and import them into one of your own database tables and JOIN your EAN to get your ASIN). This is what I am currently doing until I receive more information about a BOOK product type being made available via Amazon SP-API. :-( The others I have to look up. The service is simple and send the EAN to Amazon and asks for an ASIN, if one is found I add it to the lookup table. This is running all the time. The consequence of this is that I cannot list anything that I do not have an ASIN for. Some manual intervention has been required for this so watch out! Amazon SP-API is far from perfect at this stage.

Below is an example of a submission I am making to Amazon SP-API via their JSON_LISTINGS_FEED feed type.

Here you see where we put the EAN, under 'externally_assigned_product_identifier'

{"header":{"sellerId":"XXXXXXXXXXXX","version":"2.0","issueLocale":"en_GB"},"messages":[{"messageId":1,"sku":"NW635621501553","operationType":"UPDATE","productType":"PRODUCT","requirements":"LISTING_OFFER_ONLY","attributes":{"country_of_origin":[{"marketplace_id":"A1F83G8C2ARO7P","value":"UK"}],"merchant_suggested_asin":[{"value":"1562243225","marketplace_id":"A1F83G8C2ARO7P"}],"condition_type":[{"value":"new_new","marketplace_id":"A1F83G8C2ARO7P"}],"purchasable_offer":[{"currency":"GBP","our_price":[{"schedule":[{"value_with_tax":10.2}]}],"marketplace_id":"A1F83G8C2ARO7P"}],"fulfillment_availability":[{"fulfillment_channel_code":"DEFAULT","quantity":2}],"externally_assigned_product_identifier":[{"marketplace_id":"A1F83G8C2ARO7P","type":"ean","value":"0635621501553"}],"product_tax_code":[{"marketplace_id":"A1F83G8C2ARO7P","value":"A_BOOKS_GEN"}]}}]}

The operation type is "UPDATE" which serves for adding new and updating existing product listings you may have.

Good luck!

mzbk commented 2 years ago

I need your help, I tried all the above suggestions but am still not able to update the inventory quantity with Amazon SP API. Below body, I am sending to update the quantity with Put Request.

Need your help @doverradio @BashaBill @hashhesh @Om3n31 Thanks in advance.

SellingPartnerApi\Model\ListingsV20210801\ListingsItemPutRequest Object
(
    [container:protected] => Array
        (
            [product_type] => FALSE_EYELASH
            [requirements] => 
            [attributes] => Array
                (
                    [fulfillment_availability] => Array
                        (
                            [fulfillment_channel_code] => AMAZON_JP
                            [quantity] => 5
                        )
                )
        )
)

When I use sandbox get a response ACCEPTED but without getting an error.

........
            [sku] => 2629-48KGT-2347 // TEST
            [status] => INVALID
            [submission_id] => 602b84b73b964e24b174a80d3a7870a3
            [issues] => Array
                (
                    [0] => SellingPartnerApi\Model\ListingsV20210801\Issue Object
                        (
                            [container:protected] => Array
                                (
                                    [code] => 4000003
                                    [message] => ������������Amazon������������������������������������������������������������������������������
                                    [severity] => ERROR
                                    [attribute_names] => 
                                )
                        )
                )
........

=======================

To patch the request I am trying the below body.

SellingPartnerApi\Model\ListingsV20210801\ListingsItemPatchRequest Object
(
    [container:protected] => Array
        (
            [product_type] => FALSE_EYELASH
            [patches] => Array
                (
                    [op] => replace
                    [operation_type] => UPDATE    // Already try with or without this parameter
                    [path] => /attributes/fulfillment_availability
                    [value] => Array
                        (
                            [fulfillment_channel_code] => AMAZON_JP
                            [quantity] => 5
                        )
                )
        )
)

Get the below response.

Exception when calling: [400] {
  "errors": [
    {
      "code": "InvalidInput",
      "message": "Request has missing or invalid parameters and cannot be parsed.",
      "details": ""
    }
  ]
}
ThanhLuan0932 commented 2 years ago

Hi @mzbk, I solved my problem syncing my product to the Vendor Central site. This is my process prossces

To provide the appropriate properties for the putListingsItemor patchListingsItem API you need to use the getDefinitionsProductType API. then make sure required attributes have been provided in your submit content. Hope it helps you

mzbk commented 2 years ago

Hi @mzbk, I solved my problem syncing my product to the Vendor Central site. This is my process prossces

To provide the appropriate properties for the putListingsItemor patchListingsItem API you need to use the getDefinitionsProductType API. then make sure the required attributes have been provided in your submit content. Hope it helps you

I am fetching the data first as you said then passing the proper Product Type and Fulfilment Channel Code but still getting an error "code": "4000003".

mzbk commented 2 years ago

@kdfhhao the value of op is replace and put price inside our_price, follow the exact structure

Can you help me I can't update the quantity even if I pass the same structure as you mentioned. Do I need to do any think else?

$patchBody = [
    'product_type' => 'BONDING_ADHESIVES',
    'patches' => [
        "op" => "replace",
        "path" => "/attributes/fulfillment_availability",
        "value" => [
            "fulfillment_channel_code" => 'DEFAULT',
            "quantity" => 527
        ]
    ]
];
kingsun-he commented 2 years ago

If your sku is AFN, you can't update the quantity. I think.@mzbk

mianzaid commented 2 years ago

If your sku is AFN, you can't update the quantity. I think.@mzbk

Thank you very much I found the correct body to update the inventory with the new method.

I found the solution the main issue is in the body there are many different methods which are provided by amazon feed base or listing put/patch base.

In my question, I was using the Listing base approach.

The endpoint URL is below.

{{fe_url}}/listings/2021-08-01/items/{{seller_id}}/8001025974?marketplaceIds={{jp_market_id}}

The body should be like the below. If there is an error in product type even if you pass the current product type just use "PRODUCT" instead.

Note: But if you are using a feed document then it might be changed see here

I got success with the below body.

{
    "product_type": "PRODUCT",
    "patches": [
        {
            "op": "replace",
            "operation_type": "PARTIAL_UPDATE",
            "path": "/attributes/fulfillment_availability",
            "value": [
                {
                    "fulfillment_channel_code": "DEFAULT",
                    "quantity": 2
                }
            ]
        }
    ]
}
kingsun-he commented 2 years ago

Hi kdfhhao, It is strange. Using the keyword "value" is not OK. If I use "value", it will set the list price to blank. I have to use the keyword "value_with_tax". Here is my code.

{ "productType":"PRODUCT", "patches": [ { "op":"replace", "path":"/attributes/list_price", "value": [ { "currency":"GBP", "marketplace_id":"A1F83G8C2ARO7P", "value_with_tax":14.98 } ] } ] }

kingsun-he commented 2 years ago

I know the problem. When your marketplace is US, the keyword is "value", if your marketplace is Europe, the keyword is "value_with_tax". It is interesting.

Daniel-01-10 commented 2 years ago

How about good day colleagues.!!! I hope you can help me. :) My problem is that I am trying to create a new document using putListingsItem giving it the productType and Required Attributes. The response I get is Accepted but when I try to see if my Item was published in the Amazon Seller Central listing it doesn't show up. What would I be missing or what am I doing wrong? I hope you can help me, I would really appreciate it captura