Update Inventory Price

See original GitHub issue

Hi @amz-tools, Thanks for this library, it’s really useful and good job!

I want to update the inventory price. I tried 4 different ways but neither worked. Am I missing something?

I’m working in the European zone.

Option 1

listingsItems.patchListingsItem request

 .callAPI({
      operation: 'listingsItems.patchListingsItem',
      path: { sku:[sku], sellerId:[sellerId] },
      query: { marketplaceIds: [marketPlaceId], issueLocale: 'en_US' },
      body: { productType: 'PRODUCT', patches: [{ op: 'replace', path: '/attributes/item-price', value: 19.99 }] },
    })

response

code:'InternalFailure'
details:''
message:'We encountered an internal error. Please try again.'
type:'error'

My opinion: I think this endpoint has not been implemented yet for Europe.

Option 2

JSON_LISTINGS_FEED

  const feedType = 'JSON_LISTINGS_FEED';
  const content = {
    header: {
      sellerId: aspConfig.sellerId,
      version: '2.0',
      issueLocale: 'en_US',
    },
    messages: [
      {
        messageId: 1,
        sku: sku,
        operationType: 'PATCH',
        productType: 'PRODUCT',
        patches: [{ op: 'replace', path: '/attributes/listing-price', value: [{ value: price }] }],
      },
    ],
  };

  const contentType = 'application/json; charset=UTF-8';
  const feedUploadDetails = await spService.callAPI({ operation: 'feeds.createFeedDocument', body: { contentType } });

  await spService
    .upload(feedUploadDetails, JSON.stringify(content), contentType)
    .then(res => console.log(res))
    .catch(err => console.log(err));

  const inputFeedDocumentId = feedUploadDetails.feedDocumentId;

  return spService
    .callAPI({
      operation: 'feeds.createFeed',
      body: { feedType, marketplaceIds: [marketPlace.id], inputFeedDocumentId },
    })
    .then(res => console.log(res))
    .catch(err => console.log(err));

The feed document was uploaded successfully and also the feed was created successfully, but the status of the feed is IN_PROGRESS for 12 hours.

createdTime:'2021-07-16T07:42:27+00:00'
feedId:'138122018824'
feedType:'JSON_LISTINGS_FEED'
marketplaceIds:(1) ['A1PA6795UKMFR9']
processingStartTime:'2021-07-16T07:42:35+00:00'
processingStatus:'IN_PROGRESS'

My opinion: I think this feed is related to listingsItems.patchListingsItem at the backend so may has the same problem.

Option 3 & Option 4

feeds: POST_FLAT_FILE_INVLOADER_DATA & POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA

  const feedType = 'POST_FLAT_FILE_INVLOADER_DATA'; // or 'POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA'
  const content = `sku price\n${sku} ${price}`;

  const contentType = 'text/tab-separated-values; charset=UTF-8';

  const feedUploadDetails = await spService.callAPI({ operation: 'feeds.createFeedDocument', body: { contentType } });

  await spService
    .upload(feedUploadDetails, content, contentType)
    .then(res => console.log(res))
    .catch(err => console.log(err));

  const inputFeedDocumentId = feedUploadDetails.feedDocumentId;

  await spService
    .callAPI({
      operation: 'feeds.createFeed',
      body: { feedType, marketplaceIds: [marketPlace.id], inputFeedDocumentId },
    })
    .then(res => console.log(res))
    .catch(err => console.log(err));

feeds status:

{  createdTime:'2021-07-17T19:12:48+00:00'
   feedId:'139649018825'
   feedType:'POST_FLAT_FILE_INVLOADER_DATA' 
   marketplaceIds:(1) ['A1PA6795UKMFR9']
   processingStatus:'IN_QUEUE'
}
{
   createdTime:'2021-07-17T16:52:53+00:00'
   feedId:'139397018825'
   feedType:'POST_FLAT_FILE_PRICEANDQUANTITYONLY_UPDATE_DATA'  
   marketplaceIds:(1) ['A1PA6795UKMFR9']
   processingStatus:'IN_QUEUE'
}

I think I’m going to lose the remaining half of my hair because of seller-partner-api and it’s documentation.

Thanks for your help

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
amz-toolscommented, Jul 19, 2021

@ahmetsametoglu No, we didn’t. Just had a quick look as well, seems you are not the only one having trouble with the patchListingsItem structure. There’s probably no helpful docs or explanation of it (yet). Let us know if you find out how to set the path correct.

1reaction
taofeifanITcommented, Feb 28, 2022

i want to add a new product, how to write the content

Read more comments on GitHub >

github_iconTop Results From Across the Web

Updating cost / sell price on inventory items. - QuickBooks - Intuit
Updating cost / sell price on inventory items. · 1. Go to the Sales menu from the left panel. · 2. Choose the...
Read more >
Batch Update Inventory Costs in QuickBooks Desktop - YouTube
QuickBooks 30-day free trial + 30% off for 12 months: https://quickbooks.intuit.com/partners/irp/?cid=irp-4337# pricing Import updated costs ...
Read more >
Is there a way to update the price of an inventory item from ...
So far, I've found I need to go back and manually update Cost Prices on inventory when New Bills feature an item that...
Read more >
Change Item Prices in QuickBooks Desktop Pro - Instructions
One way to change item prices in QuickBooks Desktop Pro for individual items in the Item List is by opening an item's “Edit...
Read more >
Updating Quantities, Costs, and Prices
Use this to adjust an existing quantity to match what you have in stock such as when you do an inventory recount to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found