rhysnhall/etsy-php-sdk

Listing->delete() has no effect

Closed this issue · 3 comments

Hello!
I've been loving this SDK, it's been a breeze to upgrade my etsy app from the v2 version to v3.

Recently I was testing out listing functionality and wanted to delete a listing.

$listing = $etsy->getListing($listing_id);
$listing->delete();

I know I successfully grabbed the listing and have appropriate scopes, but the listing->delete() call did not work (the listing was still on etsy after the call) and the call did not throw any exceptions. Other functions that I've tested so far like listing->getFiles() works.

Any ideas?

Hey, thanks for the support. Good to see it getting some use!
Check out the Etsy docs for the delete method. There are a bunch of requirements that a Listing must meet before it can be deleted. You may have to update it to a draft or drain its stock levels.

Let me know if this doesn't resolve it!

Yup, can confirm it's the method that doesn't work. Using the etsy client directly worked for me instead:

$response = Etsy::$client->delete(
"/application/listings/$listing_id"
);

Latest version has Etsy's updated endpoints which fix this issue.