Magento API creates simple product correct -> but afterwards tells "101 Product not exists" - api

I try to add some pictures to a simple product, which was created (without error) by the API. The product is shown in frontend its functional with all wanted attributes. But if I check afterwards
$client->call($sessionId, 'product.info', '123456');
I get Soap Error: "101: Product doesn't exists". But its definitivly reachable over back- and frontend. (Cache cleared, Index refreshed)
Same issue, when I try to add media informations. On Confugurable Products the error don't show up and the pictures are added whithout any problems.
Maybe I messed something up with the attributes or the attribut sets... I don't know, where to watch first.
I'm at my php’s end!
Using Magento 1.6.0.0
Thank your for clarify me.
Best regards.

Since the ame API function ("product.info" in this case) receive as a parameter both SKU and ID, there is a problem if your are looking for SKU's which is numeric values.
To avoid this problem, we always adding space to the end of SKU before sending it to the API. For example, if your SKU is "123456" you should send "123456 " to the API.

Have you tried this call with your product id instead of the sku? I had some problems in the past with product calls and the sku.

I've installed 2 magentos and we always use numeric SKUs and I've always had this problem.
I've solved it by modifying the file:
app/code/core/Mage/Catalog/Model/Api/Resource.php
About line 122 that reads:
$product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), $identifierType);
I've changed it to:
$product = Mage::helper('catalog/product')->getProduct($productId, $this->_getStoreId($store), 'sku');
This way the function always expects an SKU.

Related

ebay finding api finditemsbykeywords pagination problem

I tried the following calls:
https://svcs.ebay.com/services/search/FindingService/v1?X-EBAY-SOA-OPERATION-NAME=findItemsByKeywords&SERVICE-VERSION=1.13.0&keywords=waschbecken&RESPONSE-DATA-FORMAT=JSON&GLOBAL-ID=EBAY-DE&outputSelector(0)=ItemSpecifics&paginationInput.entriesPerPage=100&paginationInput.pageNumber=2
then on the ebay API explorer for the post request body,
<findItemsByKeywordsRequest xmlns="http://www.ebay.com/marketplace/search/v1/services">
<keywords>waschbecken</keywords>
<paginationInput>
<entriesPerPage>100</entriesPerPage>
<pageNumber>2</pageNumber>
</paginationInput>
</findItemsByKeywordsRequest>
but I do not get 100 searchResult count per page, in Postman I get 32 searchResult and in API explorer 56; furthermore 2nd page forward I do not get any searchResult count, I am trying to understand is there something wrong that I am writing in the call or there is some another problem or any parameter I am missing.
Thanks for the help.
I am also running into this problem. I am guessing that the pagination results are for the entire store, but not for the search by keywords....Seems like they dropped the ball on this.
Sorry, I did not update on the question, I forgot about it.
The problem was not with the pagination, the problem is the variants.
Simply explained, the output of the query doesn't count for the variants listed on the Ebay search by the same seller. If you have from a same seller the same product with the different variant, the query does not show the variants from those product from the same seller just different variant, as it would if you do an ebay search.
The mechanism of the query is different as that of the product search on Ebay.

Issue with page_info and products.json

I'm a developer working on a private app to manage the database and the inventory of a Shopify Online Store with Symfony and I'm looking for getting all products or inventory of the store.
I tried with the url https://{{api_key}}:{{password}}#{{shopify_domain}}/admin/products.json , but it gets only 50 to 250 products and there's more than 200 000 products on this online Store. I also tried with /admin/inventory_items, but it returns missing or invalid parameter.
Recently, I checked the documentation of cursor-based pagination and I saw that there's a parameter call page_info but I didn't know how to get it. So after many researches, I learned that I had to find the parameter on the last product displayed to go to the next product which will be on the next page. I also seen that there was a parameter on GraphQL which is called storefrontId, it looked like page_info so I tried to add it to the URL but it didn't worked. I noticed that there were a = to the end of the URL, so I tried it with =0 =1 =2 and =3, also with =rel=next =next and =page=2 but it returns the same error : { "errors": { "page_info": "Invalid value." } }
For people who will find me a solution with downloading data and uploading it daily, this is not relevant because on this online store there is more than 200 000 products and the employee aren't developer.
If there is a possibility to update and display the database in real-time, without uploading a file, it would be perfect !
If you know how to help me, I'm open to suggestions !
Thanks,
Karim HADJ-ABDELKADER
The parameter page_info should be unique ID and not just number, look at this docoment about the pagination paramenters
https://shopify.dev/docs/api/usage/pagination-rest#parameters
for example :
https://{shop}.myshopify.com/admin/api/2019-07/products.json?page_info=hijgklmn&limit=3

getAllPrebidWinningBids() returns something but getAllWinningBids() is empty

I've been struggling with pbjs and DFP for several days now and my current problem is the one described in the title: when I type pbjs.getAllPrebidWinningBids() in the console, something is returned but nothing is displayed on my test page, and when I type pbjs.getAllWinningBids(), an empty array is returned and I don't get why.
A few more info :
This is a test page on our server with no other competition;
We use custom price buckets;
In DFP, I have 5 line items from 0.00€ to 2.00€ (so a 0.50€ increment) that matches the custom price buckets in the code;
The bids are "redirected" in the correct price buckets;
The code works and an ad is displayed when I set up a self-promotion
campaign in DFP with a prebid snippet as a creative, so I suppose
that something is wrong with the price buckets.
Would someone have an idea of what is blocking the selection of the bid and the rendering?
Thanks!
EDIT : I've come to realize that it was actually a normal behaviour since pbjs.getAllPrebidWinningBids() returns the bids that won the auction but haven't rendered on the page yet, while pbjs.getAllWinningBids() returns those that won but have also rendered.
So my question now is why the hell is no ad rendered at all?!
Here's my code (with a few dummy values), in case someone understand what's wrong: https://jsfiddle.net/8ewz9rgb/2/
Not answering the original thread question, instead your new issue why no ads are rendering. This is because you are calling GPT's googletag.disableInitialLoad. This will not render ads until googletag.refresh is called, which doesn't happen because it's in a 'pbjs' queue and you are not loading Prebid here, it is 404ing.

eBay API change currency of returned price

Is there a way to get an item in another currency using the eBay API?
Very simple. All you have to do is change the site ID parameter. Since you didn't specify a language, I'm going to assume you're doing this HTTP-GET and just parsing the XML. The same principles will apply regardless of how you do it, programatically or not.
For a URL:
"http://open.api.ebay.com/shopping"
?callname=GetSingleItem
&responseencoding=XML
&appid=[APPID]
&siteid=2 <------------This, for example, is Canada's siteid. 0 is US. This will change the currency returned under < ConvertedCurrentPrice>
&version=839
&ItemID=181195344321
Put it all together and you get this copy/paste-friendly "http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=[APPID]&siteid=2&version=839&ItemID=181195344321"
Make sure to use your app ID as the parameter.
You can use this call for currency change:
Currency type can be changed in Ebay while listing an item using Add Item call in Ebay's trading API.
http://developer.ebay.com/devzone/xml/docs/Reference/eBay/extra/additms.rqst.additmrqstcntnr.itm.crrncy.html
Thanks CedCommerce
You can and it's actually very simple. You can use the Shopping API GetSingleItem.
Depending on what currency you are interested in, all you have to do is change the SiteID on which you are making the call. For example, if you want to get the price in EUR, you can set the SiteID to 3(UK), or 77(Germany). You will also have to set the IncludeSelector to "Details". This way, you will get a response that will contain the following fields.
<ConvertedCurrentPrice currencyID="GBP">68.55</ConvertedCurrentPrice>
<CurrentPrice currencyID="USD">92.9</CurrentPrice>
where the CurrentPrice is the original price of the listing, on the ebay site the listing was made, and the ConvertedCurrentPrice is the price of the listing on the site that corresponds to the SiteID you supplied.
You can see a full list of SiteIDs with the currencies they are using here

How can I get the URL for product's page using the Shopify API?

I checked out Shopify product API but result doesn't seem to return product page URL. The URL looks like resulted after some transformation on the title. Is there reliable well defined logic for this or any other method to get product page URL?
You can do it as 'products/< product.handle >'. I'm not sure if there is a better way of doing it, but it works.
I usually add this in config/initializers/shopify_api.rb:
module ShopifyAPI
class Shop
def store_url_for(entity)
return "http://#{self.domain}/#{entity.class.element_name}/#{entity.handle}"
end
end
end
Just to complete answer from Michael Johnston, you need to call ShopifyAPI::Shop.current before you can use store_url_for(entity).
For example, to get the url of a product in a controller:
product = ShopifyAPI::Product.find(#product_id)
shop = ShopifyAPI::Shop.current
product_url = shop.store_url_for(product)
This is pretty old post and maybe api has been upgraded because there is def. others url constructs such as collections/collection-name/products/product-name.
Still looking if there is a way to get unique product URI