Which API should I use to get "Buy box percentage", "session", "Average price" in Amazon MWS? - amazon-mws

I am using Amazon MWS API to list some merchant information. I would like to get the "buy box percentage," "session," and "average price" (average price for last seven days) for each of my products.
What is the correct API call to do that? I would specifically like to know how I can calculate the box percentage.

The subscriptions API can send you notifications when an offer changes.
Then you can keep track of the time you had the buy box. Since these are 'push' notifications you should get a pretty accurate picture of the percentage.
http://docs.developer.amazonservices.com/en_US/notifications/Notifications_AnyOfferChangedNotification.html
IsBuyBoxWinner : Indicates whether the offer is currently in the Buy Box. There can be up to two Buy Box winners at any time per ASIN,
one that is eligible for Prime and one that is not eligible for Prime.

As far as I can see, this information is only accessible on the Seller Central website (and can be downloaded as CSV), but not through MWS.

Related

Variable value for Amount for Salesforce opportunity API

I'm working on a Magento website. In that, after the customer is done with adding products to the cart he fills a form and once the form is submitted, form data along with product details like SKU, price is sent to Salesforce to create a new opportunity.
The API is working and the Data is going to salesforce, but the issue is that the same product can have different prices based on certain conditions.
the new amount going to salesforce but on the salesforce side, the new amount is not reflecting but the amount when the product is created for the first time is coming.
is there any way to make the amount a variable field so the new amount reflects?
below is an image of the opportunity and the JSON data I'm sending.
{"StageName":"New Opportunity","Name":"test","CloseDate":"2021-06-04","What_are_you_interested_in__c":"Purchase New Trailer","Product_JSON__c":"[{\"Name\":\"Large Trailers\",\"Sku\":\"large-trailers-rent\",\"Quantity\":1,\"Price\":\"1301.0400\"}]","Purchase_Delivery_Contact_Phone__c":"123","On_Site_Contact_Email__c":"test-12#test-12.com","Mailing_Street__c":"test-12","Delivery_Street__c":"","Qty__c":"1","X66969__c":0,"First_Name__c":"test-12","Last_Name__c":"test-12"}
This request looks weird. Vanilla Salesforce doesn't need hacks like a text field to hold serialised JSON in it (Product_JSON__c).
Where do you send it? Normal POST to something like services/data/v51.0/sobjects/Opportunity or some custom endpoint (it'd have "/apexrest" in the URL). Even if it goes to normal endpoint - I guess there's trigger that deserialises this Product_JSON__c and creates OpportunityLineItems out of it. You'll have to chat with developer responsible for that trigger, we can't tell what's going on in there.
In general yes, it's possible to have variable prices. You (or that developer) have to read up about OpportunityLineItem. There's ListPrice,UnitPrice,TotalPrice,Discount, lots of choices to do this right and report properly on the discounts! And there are tips like
Creating an OpportunityLineItem increments the Opportunity Amount
value by the TotalPrice of the OpportunityLineItem
There are ways to do it properly, insert header (Opportunity) and line items in one go, without such hacks. See
https://salesforce.stackexchange.com/questions/155422/using-the-rest-api-to-create-parent-and-child-records-in-a-single-http-request
https://salesforce.stackexchange.com/questions/274694/can-you-upsert-using-composite-sobject-tree
https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_sobject_tree.htm

How to sync payment from salesforce to netsuite without a credit card

I want to sync a record in Netsuite from Salesforce. The payment was created in Salesforce and It has a token details of a Credit Card, also last 4 digits of the card. I want to sync the payment in Netsuite. But if I choose "paymentmethod" = "Credit Card" then it asking for the whole Credit Card Number which must be 13-20 digit long. How to turn off that validation? I just want to sync the payment not the credit card details.
Looking forward for your ideas and suggestions.
Thank you.
As far as I know there is no way to turn the validation off. What you can do is select a different Payment Method, or use a custom field to identify payments made with Credit Cards in Salesforce.
I figured out that there is now to turn off this validation. There is option called accounting list and added a new value there. See the below attached screenshot.accounting list in Netsuite
Add new payment method in Netsuite1yVM.png

gmail api returning total messages as 0 for a particular Label

I have been using the "Get Label" API to get the details of a particular Label.
It was all working until the last couple of days.
What I now observe is that the "Total Messages" Count is always 0. "UnRead Messages" Count show up properly.
I have used it in my application and also tried it from https://developers.google.com/gmail/api/v1/reference/users/labels/get - "Try It Now" and the result is the same --- 0 Total Messages
As noted in the comments to the question, there's an apparent bug in the API as reported here.
FWIW I'm running into the same issue.
In my case I have three accounts, all created programmatically by the same code, all containing messages inserted programmatically by the same code. The get label API repeatably reports the correct number of messages for one account while erroneously reporting zero messages for the other two accounts. Viewing the account in the web interface shows all the messages in all the accounts as expected.

Outputting Stripe plan name via plan-ID using AngularJS ng-model two-way data binding

I am outputting form inputs on the final page of a checkout field, titled "Review & checkout"... on this page I display the plan the customer picked and the personal info they provided so far.
I have no problem showing fields like Name or Email, as the value inputted is being shown, as Angular displays whatever was in the value="" field of the input.
To display the subscription plan that the customer picked, it's trickier.
The value field is already being utilized to tell stripe which plan the customer should be charged for.
How can I get around this problem?
I am able to display the stripe-id for the plan but it is not user-friendly. They are id's like trad-2-5, trad-2-6, trad-2-7... so what I want to do is display a custom title when trad-2-5 is selected, and so on...
Any help is greatly appreciated!!Thanks
There are a couple of ways you could do this.
The really silly answer is that you can just create a map of plan ids to human-readable descriptions in the Angular controller code, then display that. This might be enough for what you want, but it's also pretty hacky, and not a lot of fun to maintain.
The less silly answer depends on where these plan ids are coming from. If they are coming from an endpoint on your server, which gets them from Stripe's plans endpoint, then you could also pass along the display name of the plan from that endpoint. If the plan id's are hard coded somewhere, or whitelisted, then this may not make sense. However, that display name is what will appear on the customer's invoice, and credit card statement, so it'd be nice to make it match up with what they see on the checkout page.

How to differentiate between inventory in different sites?

I'm using the ListInventorySupply action to get all my inventory
https://mws.amazonservices.co.uk/FulfillmentInventory/2010-10-01?AWSAccessKeyId ....
Now the response includes ALL my inventory for all European sites. How can I know which items are in .uk and which in .de etc?
I haven't worked with FBA, but it is my understanding that the FullfillmentInventory API call does not give you fulfillment center information and neither lets you specify a specific fulfillment center as query parameter.
There is another set of API calls from the Reports API that most probably do what you want. I suggest you look specifically at the _GET_AFN_INVENTORY_DATA_BY_COUNTRY_ report type.

Resources