Amazon MWS - Get all Listings FBA+FBM - amazon

I'm using the MWS Reports API to get all my listings with ASIN, SKU, Title, etc.
However, the ReportType 'GET_MERCHANT_LISTINGS_DATA' shows many of those listings as Status = Inactive, so I guess it contains only the FBM listings which we deactivate when we have FBA inventory.
Is my assumption correct? Which reports do I need to request to get all available listings (FBA+FBM)?

GET_MERCHANT_LISTINGS_ALL_DATA should give you what you're after.
And, as an aside,.... GET_FBA_MYI_ALL_INVENTORY_DATA gave me (or appeared to give me) a list of all current FBA products on my account.

Related

Get purchased product from PaymentIntent

in my app i want to list past purchases for a stripe customer. So I was looking at the relevant API objects like PaymentIntents, Sessions or Charges. But they all do not seem to contain any reference to Product or Price, which I would need to list the purchased products.
Subscriptions contain a list of items that are contained in that subscription, so I was expecting PaymentIntents to have something like that too.
Does anyone has an idea how to archive my list of past purchases? Thanks!
I did some digging through the Stripe API docs[1] and, out of the three objects you referrenced (PaymentIntent, Session, Charges), the only one that I can see being able to trace back to a product is the Session.
Session objects have a line_items property[2] which can be followed all the way down to line_items.data.price.product[3]. To access this you’ll need to inlcude the expand=["data.line_items"] parameter to your call to list Checkout Sessions. You can read more about expanding API responses here[4]
So for all the charges to your customers that were done using Checkout Sessions, you could list them all, use the customer property to associate earch session with a customer in your application, traverse the the returned data, and then query the API for the product details. If you have a lot of customers & products these API calls will add up fast so I would store this data in your back-end to avoid hitting rate limits[5].
Alternatively, you could just save the product ID (either Stripe or your local version) as metadata[6] for any of the above Stripe payment objects listed. That would allow you to link any payment object you wish to a product.
https://stripe.com/docs/api
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items
https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items-data-price-product
https://stripe.com/docs/expand
https://stripe.com/docs/rate-limits
https://stripe.com/docs/api/metadata
I had the same question I found a way to retrieve the products related to a specific PaymentIntent.
You need to get the sessions that was linked to PaymentIntent when the Checkout process was made.
I will give you the code (in PHP) that I use to to this.
\Stripe\Stripe::setApiKey(STRIPE_API_SECRET);
// Find the Session for that PaymentIntent
$sessions = \Stripe\Checkout\Session::all([
'payment_intent' => "pi_xxxxxxxxxx",
'expand' => ['data.line_items'],
]);
You will then have an key line_items that contain the products linked.
Enjoy

Tax From Changed for Nexus

I am trying to create sales orders using WebServices from our CRM (Salesforce) to NetSuite. I am having an issue with international sales orders, in particular I am hitting this issue with United Kingdom.
If I create a sales order in the UI and set a bunch of field values and then set the Address to United Kingdom, I get a popup with the following message:
The address you have selected is based in a nexus for which you are required to charge a different kind of tax. Click OK to change the form to one that is applicable for that Nexus.
In the UI, when you click "ok", the page reloads and a few new tax fields appear (the fields are built in, denoted by the field ids). The problem is when the page reloads, all of the data is wiped out.
I did this UI testing to determine what was causing this. However, in WebServices, all the data sets at once (not able to be done in any "order"). What is happening with my webservice call is that it gets this same warning and then all of the data it tried to send is lost and then it tries to submit the record, hitting validation rules we have in place.
Has anyone hit this before? Is there a field or something I can set via webservices that is what NS is doing on the backend when you click "ok"?
I am open to any solution. I do have a ticket open with NS Support, however so far they have not been helpful. If I do get a resolution, I intend to post it for others.
to get around it, you can access the vendor first then select dropdown icon to open the purchase order

Get root category name for ASIN from MWS API

I'm trying to calculate the FBA fees in a Nodejs application. I get the product group and the product type name from the advertising API but I need the root category name for given products. How can I do that?
Edit1: additionally I'd also like to be able to check whether a specific product is media or apparel
The Products API should be what you're looking for. Specifically, the GetProductCategoriesForASIN operation. You can make a request for up to 20 ASINs at a time. The GetMatchingProductForId operation might also work, that has the product rankings within each category.
The client libraries are here, just plug in your credentials and see if this works for you.

adsense management api give diffrent results than website

adsense management api give me different results than the website interface.
the simplest example:
run the report here:
https://developers.google.com/adsense/management/v1.4/reference/accounts/reports/generate
I want to see the rpm by countries for given AD_UNIT_NAME for some date
this the request:(xxxx is censored
https://www.googleapis.com/adsense/v1.4/accounts/pub-xxxx/reports?startDate=2014-05-01&endDate=2014-05-01&dimension=COUNTRY_CODE&filter=AD_UNIT_NAME%3D%3D160%2F600+-+xxxx&metric=AD_REQUESTS_RPM&key=xxxx
I get the results as excepted the problem is when i go the adsense website and click on the same ad unit name, and add country dimension I see different results.. i checked it a lot of times with all kind of differents request(for example clicks instead of rpm or different ad unit or without country dimensions and so on).
the api always give different results than adsense interface why is that?
api results example:
[
"BR",
"5.10"
]
adsense website results for same ad:
brazil: 7.64
what i tried:
make sure same currency.
make sure same dates.
check different dates.
check its the same ad.
check different ads.
etc.
so after long time I found the answer:
different time zone...
all was needed was to set useTimezoneReporting to true.
I think it should be the default value..

Foursquare: Authomatic bulkclaim venues

this is a case for the real estate sector
is it possible to add residences for sale as a venue of the agency ? (not representing the office, but the product it self)?
Can this be done automatically through the real estate side (like a API feed to 4square) instead of using the bulkclaim excel file?
Will the system allow to manage authomaticly the venues (homes for sale) and delete them once they're sold?
You can always add venues using the venues/add endpoint, but you may not be able to instantly delete the venues. Also note that it's against foursquare's policies to add a person's home on foursquare without their explicit consent.

Resources