Handle eBay Marketplace Account Deletion Notifications

Micha(el) Bladowski
Geek Culture
Published in
5 min readAug 18, 2021

--

Photo by Jan Tinneberg on Unsplash

Maybe you got the same message as I did:

https://developer.ebay.com/marketplace-account-deletion

So, why is this REALLY IMPORTANT?

The callback URL should immediately acknowledge each eBay marketplace account deletion/closure notification with an HTTP status code indicating a successful response. 200 OK, 201 Created, 202 Accepted, and 204 No Content are all acceptable. For any callback URL that doesn’t respond to an eBay marketplace account deletion/closure notification, eBay will resend the notification to the callback URL until it is acknowledged. After a 24-hour period of multiple, unacknowledged notifications from a callback URL, the callback URL is marked down, and eBay will send out an alert email to the developer about the callback URL being non-responsive. Upon receiving the email, the developer will have up to 30 days to resolve the problem with their callback URL acknowledging eBay marketplace account deletion/closure notifications. If the problem is not resolved within 30 days, the developer will be marked as non-compliant.

Did you read the last sentence?
If you understand it, you know, this can ruin your whole Business!

Photo by Benjamin Davies on Unsplash

I won´t go into detail here, I just want to suggest using AWS Lambda, because it´s by far the easiest way to handle eBay Notifications at all.

I am not a Lambda expert and I am not a NodeJS expert, I am happy to make this work, the rest — I don´t care, because my main language is PHP ;)
But things like this are very easy with NodeJS and eBay also offers a new SDK for its notifications: https://github.com/eBay/event-notification-nodejs-sdk

Using Lambda gives you the benefit of NOT having your own server which takes all the pressure from you when it comes to maintaining and monitoring, sure, Lambda costs something, but these costs are a joke, see yourself.

So, here are the steps to make this work, in your local dev env:

  • npm init
  • npm install event-notification-nodejs-sdk

So after this, you actually have everything you need.

Now we take the example from eBays SDK and transform it into a Lambda function:

Yeah, please don´t blame me for that copy&paste code ;-)
In case you want a Slack Notification every time eBay sends something, feel free to update the config and enable it. In case you want to process the eBay Data in any other way, feel free to modify everything to your needs.

You should “zip” this index.js and the “node_modules”:

Go to AWS Lambda, create a new “Function” and choose “HTTP-API” and Upload your zip. After that you should add the “API-Gateway” as Trigger, so you will get an HTTPS endpoint you can use to reach your function from outside.

In case you are NOT a developer, here´s my skeleton zip, but you still have to configure the “index.js” and of course set up everything in your eBay Developer Account.

sorry, it´s german

Actually, that´s it. You should test your endpoint by testing the challenge-URL:

https://xxxxxxxx.execute-api.eu-central-1.amazonaws.com/default/ebay-account-deletions?challenge_code=123

and you hopefully should get a result like this:

{
“challengeResponse”: “5fe38234682368903fbd5a529599e9f5”
}

If not, please check the CloudWatch-Logs of your function, you should see any kind of error here.

Photo by Joshua Hoehne on Unsplash

There is one very important thing, you need to know!

Because I had trouble catching exceptions in this async javascript world, where I am not so very familiar with, I didn´t know how to help myself, so I changed some parts of eBays SDK Code here ;(

Even after reading this nice article, I wasn´t able to catch the exceptions here in the way, I thought it should work.

I am pretty sure, If you have better knowledge in javascript than me, you will be able to handle this without modifying eBays SDK code ;)

Anyway, please see my commits in this branch, to see, what I have changed.

I made that change because I was not able to catch the validation Errors inside “validator.js” when calling “EventNotificationSDK.process”. So in case, YOU know how to catch the errors and exceptions correctly, PLEASE let me know!

Photo by Tim Mossholder on Unsplash

I am aware, if you never did anything with Lambda before, this stuff will confuse you a lot, but there are tons of Tutorials out there, and creating a Lambda function — really — are only a few clicks, it´s incredibly easy.

Give it a try!

Even though this Article is very trivial, I still hope it might help somebody out there because I know myself that it´s very difficult to find valuable info out there when it comes to eBay.

In case you are a PHP developer, like me and you regularly have to deal with eBay APIs, feel free to check out my repositories at GitHub, maybe you will find something useful there ;)

--

--

Micha(el) Bladowski
Geek Culture

devop, developer, ebay pro, problem solver, api expert