eBay LMS Trading API AddFixedPriceItemRequest returns 'SKU already in use' error - ebay-api

I've been working on an automatized eBay-upload-item module for a while now and every time I think it could work, eBay comes up with a new non-sense error. Currently the error is:
SKU already in use
I have 0 items in my listing, (active, ended, unsold etc), literally, 0 items anywhere. And when i try to make a BULK upload via the Trading API using individual AddFixedPriceItemRequest per item (including variations), I get the above error, which makes no sense.
All my SKUs are uniquely generated and then checked for against a database that stores them so as to avoid duplication. There is no documentation anywhere, and just basing my debugging on eBay's error reporting can drive anyone into insanity.
Any help will be much appreciated. Thanks

First of all, make sure that the item you're trying to upload is not a Multi-SKU item. This error can appear for multiple problems related to any part of your listing.
It would be also great if you can post API request and response here.

Related

Why is PrestaShop redirrecting to a random product when selecting variations from front-end?

I have an online shop in development, all went well until I decided to do SEO on the shop. After this, if I chose a product variation from front-end it just redirects me to a random product.
This picture describes the first state. The default product load.
This picture describes what is happening after you select a variation. As you can see the product name stays the same, but the link indicates that a totally different product is displayed.
If I have the debug mode enabled when selecting a variation it throws "An error occurred while processing your request" and in the request file I can see that besides some errors (Deprecated: array_key_exists(): Using array_key_exists()) it shows the request for a different product.
I can't understand why this is happening, so I am in dying need of your help.
That's the way Prestashop 1.7 works :
First time a customer lands in a multi-variation page, the default attribute will be loaded,
URL will show only the ID product.
Once you choose an attribute , an AJAX call will refresh the page
with the current attribute and URL will change with id_product-id_product_attribute value.
Not sure what you mean by "random product" as in both of your examples I see an attribute
being selected.
Anyway there are several (paid) modules to change this behaviour in a better SEO perspective,
this is definitely one of the most famous :
https://addons.prestashop.com/en/url-redirects/16633-pretty-urls-seo-friendly-url-remove-ids-numbers.html
EDIT: Just noticed that the ID product is different in the two screenshot, this could be related to some DB issues with attribute too, you should check if you have some not coherent values between id_product and id_product_attribute(s)
I found a fix for this. Apparently or appeared because I was using the duplicate function for uploading products. I don't know why but on some products it makes this behavior.
I've spent over 12 hours to find a explanation for this and I was unable to find one. The PrestaShop forum straight up banned me for posting this topic.
My advice is to NOT USE PRESTASHOP it's and old sistem and full of bugs, the support is expensive and I get the impression that even they don't understand their system.
If you find yourself in this situation, know this. Don't duplicate and upload products using "add new" function.
And I can't state this enough, do yourself a favour and don't use Presta, with all the expenses the time to invest and what the product looks like at the end of the road, is just a waste of time. Even after you finish is guaranteed to break in 1-2 years, any updates will break your store and you will need to invest even more more to fix it. It's an old, slow and buggy CMS. It's days are numbered.
Thanks a lot for help.
Best regards, Daniel.

Big Commerce API - Update Product Custom Field - 422 Error

I'm trying to build an integration for a client between Big Commerce and their ERP system. As part of this, I need to update existing custom fields against products in Big Commerce.
The API reference (https://developer.bigcommerce.com/api-reference/store-management/catalog/product-custom-fields/updatecustomfield) states that this is possible. I have built the integration code to use the exact method described in the API reference but it keeps returning a 422 error which says:
The custom field with the name: xxxxxxxxx & value: yyyyyy already exists.
I don't understand why it would give this error; I know it exists, that's why I'm updating it. If it didn't exist, I would be using the Create Custom Field method instead.
Anyone ever come across this issue before or know why this may be occurring?
Thanks in advance.
I've found the API to be fairly robust, and use the custom_field API a LOT.
Have you done a quick check, via the API to get ALL the custom_fields for the product you are trying to update the custom_field for, and make sure you are updating by the correct custom_field ID? (so, not trying to change a different custom_field, which will then cause this error to be raised?)

How do I make woocommerce error messages block the user from continuing?

Approx 2 years ago, I wrote a custom plugin that checks order items in the cart for specific requirements. If the requirements are not met, it displays an error and does not allow the customer to check out. This code has been working well for approx 2 years. Recently the code broke. It must have been due to the recent WooCommerce upgrades, as we hadn't touched the code in ages. I spent a while debugging it and this is what I found:
wc_add_notice doesn't do anything anymore. When I changed it to wc_print_notice, it displays the error notice.
In the past, when I used wc_add_notice on the cart or checkout page, it would display the error message and not allow the user to continue to checkout. Now that I am using wc_print_notice, it only displays the error message, but it does allow the user to continue. I spent a long time working on this today and I can't figure out how to stop the user from continuing to check out.
Any suggestions..?
And, does anyone know where I can read documentation of the WooCommerce upgrade changes related to my issue?
Thanks!
PS: If you want to see code samples, here are 2 articles which I found today, that display sample code doing exactly what my code does:
https://www.sitepoint.com/minimum-checkout-requirements-in-woocommerce/
https://gist.github.com/kloon/4545677

distriqt inappbilling - getProducts

So I guess you could say I feel like I find myself in a void. Here's the way I understand the order for distriqt inappbilling - android setup
Init the billing
getProducts(send_in_array_of_products)
Now that it's done I can send requests for consume, purchase etc.
The first time I ran the program it returned the products. I made a test purchase but the purchase failed - it made it to the android login and verify credit card - then the purchase failed event was triggered (I have no idea why it failed at this time). I closed the game at this point and did some updates to track more of what was going on.
When I went to run the game the second time it failed getting the products list - turns out it gave me the following error: 1003 - Error refreshing inventory (querying owned items). Okay - now what??
I can't load the getProducts() because of this error. I have tried sending a consume for each product and that fails. It seems like I'm stuck in a spot where I can't do anything with the store because I can't load the product list.
Android says you are suppose to call to the store to get a list of products that that the person owns but I don't see that type of function in the distriqt package.
Can anyone explain what I have to do to get the store working again. How do I request a product list by leaving out the products that they own if I don't know what products they own? Also, if I do know what they own - shouldn't Consume(product) remove it from being a purchased product?
Does anyone know if you can run consume(product) without doing a getProducts() command first?
Thanks for any help you can provide.
This answer really applies to Distriqt InAppBilling ANE but it might help with other people having the same problem using different programming methods. After about a week of messing around I finally figured it out.
You have to make sure the call the
InAppBilling.service.finishPurchase(purchase-information)
command.
Otherwise the play store will see this as an open transaction and when you try to get the product list - it fails with the error code 1003 - Error refreshing inventory (querying owned items).
To fix this I made the finishPurchase call to all of my products. Once that was done everything started working correctly again. Just be sure to call the finishPurchase command on all returned purchase events. I missed that call in the fail event and that was the one that caused my headache. You would think if the purchase failed that google would just close the transaction but no - you still have to tell them that it's finished. Hope this helps someone!

Getting all listing images from an Etsy shop

THE SITUATION
I've been tooling around in the Etsy sandbox API trying to figure out a solution for a client who wants to show the default image and title to all their Etsy listings. Upon clicking, they want it to direct them off the website and onto that Esty listing's page.
Now, figuring out how to get the name and url of all their listings was easy and can be done in one public API call:
http://openapi.etsy.com/v2/shops/:shop_id/listings/active?method=GET&api_key=:api_key
This call will not only return the name of the listing and the url of listing, but also a multitude of other information on that particular item. I suppose I should limit my call to just getting the fields I need, but for sake of example, I digress...
What surprises me most is that what is not included in that gigantic array of information is something I'd expect to find in there: the images associated with the listing or at least the main image. There is however a separate API call I can make to get the images for a single listing, but that would require getting the listing_id and making a separate API call for each item. This now turns what I would expect to be one (or hell, even two) calls to the Etsy API, into 1 plus however many items you return. Granted if you have 100 items you're selling in a shop, that's 101 API calls in just a few seconds! Call me crazy, but I feel there's got to be a better way to do this than what I've found.
THE QUESTION
What is the easiest way to make an Etsy API call to return all the images (or even the main image) for all the listings in a shop?
I ended up using the following code to include everything I needed into one API call:
http://openapi.etsy.com/v2/shops/:shop_id/listings/active?method=GET&api_key=:api_key&fields=title,url&limit=100&includes=MainImage
This way I defined my fields so I don't have unnecessary information, but I also set a limit on the results and used includes=MainImage as a query string. This was to the suggestion of a member of the Etsy developer community.