How do I activate or re-list a "stranded" listing via MWS APIs? - amazon-mws

I'd like to know if it's possible to fix/relist a stranded product listing on Amazon via MWS APIs. Having read through their documentation, I don't find any reference on how to achieve this. I have searched here and on seller central forums, but couldn't find direct answers. I found reference to re-activating a listing by submitting 3 types of feeds using the Feeds API section and have tried it. I get successful processing status on all feeds, but that does not change the status of the product listing as it remains "stranded" afterwards.
This doesn't work and doesn't update the listing status. But it's all I could find on this. Here's what I tried:
Submit _POST_PRODUCT_DATA_ feed. example content:
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>VALUE</MerchantIdentifier>
</Header>
<MessageType>Product</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Product>
<SKU>VALUE</SKU>
<StandardProductID>
<Type>ASIN</Type>
<Value>VALUE</Value>
</StandardProductID>
<Condition>
<ConditionType>New</ConditionType>
</Condition>
</Product>
</Message>
</AmazonEnvelope>
Submit _POST_PRODUCT_PRICING_DATA_ feed. example content:
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>VALUE</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Price>
<SKU>VALUE</SKU>
<StandardPrice currency="VALUE">VALUE</StandardPrice>
</Price>
</Message>
</AmazonEnvelope>
Submit _POST_INVENTORY_AVAILABILITY_DATA_ feed. example:
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>VALUE</MerchantIdentifier>
</Header>
<MessageType>Inventory</MessageType>
<PurgeAndReplace>false</PurgeAndReplace>
<Message>
<MessageID>1</MessageID>
<OperationType>Update</OperationType>
<Inventory>
<SKU>VALUE</SKU>
<Quantity>VALUE</Quantity>
</Inventory>
</Message>
</AmazonEnvelope>
The 3 feeds complete successfully but without an effect. Please note that this is done for Amazon fulfilled product and doesn't require FulfillmentLatency element and the listing with full info and images already exists.
I'd appreciate it if anyone who has experience in this issue could provide any pointers. Thanks
EDIT:
To clarify, "stranded" listings are product listings that have become inactive, despite having a positive amount of fulfillable stock in Amazon's fulfillment centres. Occasionally, a few of our listings become in-active and are marked with a "No listing exists for this inventory item" note on SellerCentral Inventory page. The ASIN listing which those products were listed against is still active and matches the product information that we are offering, so the message is confusing to me. We usually go to SellerCentral "Fix Stranded Inventory" page and hit "Relist" button, submit the form and the listing goes active again.
What I'm looking for, is a way to achieve the same via MWS APIs instead of doing this manually. We are able to retrieve the stranded listings report via the API (_GET_STRANDED_INVENTORY_UI_DATA_) and can determine which products are eligible for "relist" action, but don't know if it's possible at all to perform that via the API.

Thanks for your edit. I'm not using FBA (Fulfillment By Amazon) myself, so I have no actual experience with this, but from what I've seen so far:
"Stranded Inventory" are items that are in an Amazon warehouse which for one reason or another cannot be sold. Fixing that seems to depend on the actual reason why Amazon thinks it cannot be sold. As you stated, you can obtain a list of these through a _GET_STRANDED_INVENTORY_UI_DATA_ report.
Items might not have proper product data or pricing for the relevant markets. The _POST_PRODUCT_DATA_ and _POST_PRODUCT_PRICING_DATA_ feeds should take care of that. Note that I don't think _POST_INVENTORY_AVAILABILITY_DATA_ is used with FBA inventory. It definately is used for merchant fulfillment, as Amazon has no other way of knowing what inventory is in the merchant's stock.
Items might be damaged or otherwise unfit for sale. You may have to schedule an outbound shipment to take a look at their condition and possibly relist or relist as "used".
Items might be reserved for pending orders (and possibly additional reasons). I don't think you can do anything about that.
So the first step should be to check why your items are stranded. I don't think there is a straight forward MWS call that does what the "Fix Stranded Inventory" button does, nor do I think there could/should be.

The "Fix stranded inventory" page header has a button "Fix stranded inventory in bulk" which takes you to the Inventory Report "Bulk Fix Stranded Inventory"; there you may see a history of previous reports of this type and can request a new download. After you've requested a report and the download has been generated, examining the Download link shows that the Report Type is "_GET_STRANDED_INVENTORY_LOADER_DATA_"; use this knowledge to schedule a periodic report via the MWS Reports API.
To get a report that includes the "stranded" reason and additional related information, you'll need to click the "Download Report" button on the "Fix stranded inventory" page header (which takes you to the Inventory Report "Stranded Inventory"), or request/schedule Report Type "_GET_STRANDED_INVENTORY_UI_DATA_" via the MWS Reports API.
You would need to create a process whereby the data from the two reports would be combined/correlated and have a human review the report data, correct any errors or issues, then trigger a re-upload of an updated "Inventory Loader" file. You can upload manually via the Add Products via Upload page using File Type "Inventory Loader File", but you can also do this programmatically using the MWS Feeds API to upload the file using type "_POST_FLAT_FILE_INVLOADER_DATA_".
This is the most optimized mechanism I've found for handling stranded items programmatically; I admit there is some tedium in the process, but that is entirely due to Amazon's design.
Note: The technique for finding the Report Type to use in the API can be applied to most of the reports in Seller Central (do note that the Financial Reports take a little more effort due to efforts to secure them).

Related

What is the correct call to find "Related Contacts" on a Salesforce Account?

I am trying to identify the correct field in Salesforce to be able to link a new "Contact" with their own "Account" to the "Related Contact" section of another "Account"."To do this I'm first trying establish how you can read the details on an "Account" and report on who the "Related Contacts" and the information held against them (if any).
I am using a GET request like this for example:
https://website.sandbox.my.salesforce.com/services/data/v56.0/query/?q=SELECT+Account_Id__c,Other_Contact_Names__c+from+Account+WHERE+Partner_Approved__c+=+true+AND+Type+=+'Developer'
So I can return values for "Account_Id__c" and "Other_Contact_Names__c" just to prove the call is generally correct. But I don't know how to pull the "Related Contacts" information in the Account. I have looked under the Object Manager in Setup through all likely Objects and their related Fields, but I cannot find a Field Name for this.
Once I find this I hope to be able to POST information from another system to link a Contact to a specific Account as a "Related Contact".
I'd be grateful to hear from anyone with experience in doing this before.

Amazon MWS Download orders Client

We have a java client for downloading orders from Amazon MWS.
We use:
MaWSJavaClientLibrary-1.1.jar
MWSClientJavaRuntime-1.0.jar
MWSOrders_2013-09-01_v2020-10-20.jar
We download an xml with users data, with also shipping details (address, city, zipcode and so on...)
Begining from half 2020, we didn't receive customer name and address anymore. I mean that those 2 tags in xml were not passed anymore. We realized that something was changed in Amazon MWS for GDPR and security reasons.
We compiled a form online where we sent to amazon lots of informations about how we use those data.
However, we have not understand what we have to do in order to get those data again in xml.
Our client continues to work as usual, beu we continue to get xml without customer name and address.
Last email from amazon says:
Good morning,
thank you for your reply. As this issue is unrelated to your Developer Profile role assignments, we recommend that you review the information available in the links below for information on this topic.
Since the new API for Sales Partners (SP-API) is officially available, we are no longer issuing new credentials for MWS and are not updating existing MWS access roles. From now on, it is possible to develop applications in multiple regions with a single set of SP-API credentials.
More information on SP-API can be found here:
https://developer.amazonservices.it
SP-API documentation on GitHub: https://github.com/amzn/selling-partner-api-docs
If you still need assistance on this topic, you can submit a MWS or SP-API technical support request here: https://developer.amazonservices.it/gp/mws/contactus.html
Thank you for selling with Amazon.
is there anyone that had same problem and can help us to retrieve those information again please?
Thanks

RSS feed of new entries in Active directory

tldr: if details are changed or new accounts added in active directory we want to update an RSS feed.
Our organisation has a good deal of staff changes so it can be slightly crazy to keep track of who's in what role and new staff that have joined us.
I'm currently interested in setting up a feed which will show staff changes which I could then have show up on our intranet site (internal only so no privacy issues there). Something like: Jane Doe has started working for CompanyName in DepartmentName, here's a link to her staff profile [LINK]. Or Bill from accounting now works in building management.
Basically person x now works for us, or person y has changed roles.
We handle our login authentication with active directory (which I don't know heaps about), any time someone comes to work for us they get a login; when they change roles they would have their details changed in active directory.
What I want is an RSS feed which would have new items added to it dynamically any time that a new user is added or a staffmember's details are changed on AD.
a particular item in the feed would look something like this
<item>
<title>[username] [now works here / has changed roles]</title>
<link>.../staff.aspx?uid=[username]</link>
<description> follow the link to see their staff profile</description>
</item>
how can I get the feed xml file automatically updated when one of those changes is made in active directory?
Thanks for your time.
I would recommend setting up a service to poll for the changes that then writes them somewhere else for you to pick up and manipulate for your RSS feed.
Ryan Dunn has a great post discussing how to do this in .Net, specifically with Change Notifications. Personally, I'd recommend using DirSync as it's pretty easy to setup, but his post does a great job with pros/cons of each method.
This is quite a complicated question. Active Directory has a "last modified" attribute and a "created" attribute. So you could query the timestamp on created and then update an RSS file from that to get your new users. However, just because an AD entry has been modified doesn't mean the job title has changed, so you're going to have to cache the Active Directory somewhere locally, say into a database and then do a check against that to see if a job title has changed.
You'll need to write some LDAP queries (See here, for example: http://www.selfadsi.org/extended-ad/search-user-accounts.htm) to find all the accounts and then process them.
What language are you looking to use?

Salesforce Triggering an External Procedure

I'm not 100% sure of the terminology on how to describe what I'm looking to do, so I apologize in advance.
I have a custom entry page for an object in salesforce, and I'm curious as to whether or not it's possible to call an external website when I click the save button.
Rough Example:
User enters in a new Account and hits save.
After saving the Account, The extender class calls to a webpage that inserts an entry into an external database to let a different set of users external to salesforce know that something new has been created.
Again, I apologize. I know I'm not describing this very well. Thank you for any and all input!
Yes, it is possible. Take a look at the Invoking Callouts Using Apex section of the Apex Code Developer's Guide. Salesforce refers to this (your Apex code connecting to another web server) as an HTTP Callout.
Also, take a look at questions with the "callout" tag on the dedicated StackExchange site for Salesforce.com.

How to I access reports programmatically in SalesForce using Apex

I'm trying to write an app on the SalesForce platform that can pull a list of contacts from a report and send them to a web service (say to send them an email or SMS)
The only way I can seem to find to do this is to add the report results to a newly created campaign, and then access that campaign. This seems like the long way around.
Every post I read online says you can't access the reports through Apex, however most or all of these posts were written before Version 20 of the API was released last month, which introduced a new report object. I can now programmatically access info about a report (Such as the date last run etc) but I still can't seem to find a way to access the result data contained in that report.
Does anyone know if there's a way to do that?
After much research into it, I've discovered the only way to do this at the moment is indeed to scrape the CSV document. I would guess that Conga etc are using exactly this method.
We've been doing this for a while now, and it works. The only caveats are:
Salesforce username / password /
security token has to be shared to
the app connecting. If the password
changes (and by default it is changed
every 30 days or so) the token also
changes and must be re-entered.
You have to know the host of the account, which can be difficult to
get right. For instance while most european accounts would use emea.salesforce.com to access CSV, our account uses na7 (North America 7) even though we're located in
ireland. I'm currently sending the page host to the app and parsing it
to calculate the correct subdomain to use, but I think there has to be a
better way to do this.
Salesforce really needs to sort this out by supplying an API call which allows custom report results to be exported on the fly and allowing us to use OAuth to connect to it. But of course, this is unlikely to happen.
In the SalesforceSpring 11 update, it seems you can obtain more informations about the Reports:
As stated in the API for Report and ReportType, you can access via Apex the fields used in the query by the Report, reading the field "columns", as well as the field used to represent the filters called "filter".
Iterating through this objects, should allow you to build a String representing the same query of the Report. After building that string you can make a dynamic query with a Database.query(..) call.
It seems to be a little messy, but should work.. (NOT TESTED YET!)
As header states, this works only with Custom Reports!
Just to clarify for fellow rookies who will find this, when the question was asked you could access your report data programatically, but you had to use some hacky, error prone methods.
This is all fixed, you can now access your reports via the API as of Winter '14.
Documentation here - http://www.salesforce.com/us/developer/docs/api_analytics/index.htm
Go to town on those custom dashboards etc. Cross posted from the Salesforce Stack Exchange - https://salesforce.stackexchange.com/questions/337/can-report-data-be-accessed-programatically/
But Conga (appextremes) do this in their QuickMerge product, where the user specifies the report Id, and the apex script on the page runs the report to extract the results for a mail merge operation.
the v20.0 API added metadata about the reports, but no way to actually run the report and obtain the results. If this is a standard report, or a report you've defined, you can work out the equivalent SOQL query for your report and run that, but if its an end user defined report, there's no way to do this.

Resources