eBay allows users to request the deletion of their personal data from eBay's own systems, as well as from the systems of all partners who store or display that data, including third-party developers integrated with eBay APIs through the eBay Developers Program.
To help third-party developers comply with these requests, eBay has implemented a push notification system. This system alerts all eBay Developers Program applications when a user has requested the deletion of their personal data and closure of their eBay account. This article explains the process third-party developers must follow to subscribe to, receive, respond to, and validate these notifications.
Why?
As quoted from the page: https://developer.ebay.com/marketplace-account-deletion
"Existing Developers: The August 31, 2021 deadline for existing developers to subscribe to or opt out of eBay marketplace account deletion/closure notifications has passed. Failure to comply with this requirement will result in termination of your access to the Developer Tools, and/or reduced access to all or some APIs.
New Developers: All new third-party developers coming to the platform must subscribe to or opt out of eBay marketplace account deletion/closure notifications before they make their first API call. Once the new developer's application is subscribed to eBay marketplace account deletion/closure notifications or they have successfully opted out of the notifications, the keyset/App ID is activated, and they can begin making API calls."
How?
Let's cover the first preamble points here:
- While completing the form, the developer subscribes to eBay marketplace account deletion/closure notifications by saving an endpoint URL and verification token, eBay sends a unique challenge code via a GET request (e.g., GET https://
?challenge_code=123 ). The provided endpoint URL must use the 'https' protocol and cannot include internal IP addresses or 'localhost'. - Upon receiving the unique challenge code, the endpoint must hash the challengeCode, verificationToken, and endpoint URL (in that exact order), and respond to eBay with an HTTP 200 OK status, including the hashed result in JSON format within the challengeResponse field. The response's Content-Type header must be set to application/json.
- Sign into your developer account: https://developer.ebay.com/signin.
- Navigate to the Application Keys page: https://developer.ebay.com/my/keys
- Click the Notifications link next to your App ID to open the Alerts and Notifications page: https://developer.ebay.com/my/push
- Select the Marketplace Account Deletion option in the Event Notification Delivery Method section.
- Enter a required email address to receive alerts if your Notification Endpoint URL becomes unreachable, then click Save.
- Enter your Notification Endpoint URL, which must use 'https' and be accessible to you, and ensure it can respond to eBay's validation challenge code.
- In the Verification token field, enter a unique 32–80 character token containing only letters, numbers, underscores (_), or hyphens (-), which eBay uses to verify ownership of your endpoint.
- After entering your Notification Endpoint URL and Verification token, click Save, triggering eBay’s validation process, which requires your endpoint to successfully reply to eBay's challenge code.
copyraw
string standalone.fn_eBay_AlertNotification(String crmAPIRequest) { /* ******************************************************************************* Function: string standalone.fn_eBay_AlertNotification(String crmAPIRequest) Trigger: Function executed when a webhook from eBay is sent to ZohoCRM (Market Deletion Webhook) Purpose: eBay Marketplace Account Deletion/Closure Notifications Workflow Inputs: String crmAPIRequest (Webhook) Outputs: JSON String crmAPIResponse Date Created: 2025-03-13 (Joel Lipman) - Initial release Date Modified: 2025-03-13 (Joel Lipman) - Validated Webhook - Send email to client More Info: https://developer.ebay.com/marketplace-account-deletion metadata.topic topic of the notification metadata.schemaVersion schema version metadata.deprecated boolean to indicate deprecation notification.notificationId unique identifier of the notification notification.eventDate timestamp indicating when eBay user made the data deletion request notification.publishDate timestamp indicating when current notification was sent notification.publishAttemptCount integer indicating how many times the notification has been sent to this specific callback URL notification.data.username this string is the publicly known eBay user ID notification.data.userId this string is the immutable identifier of the eBay user notification.data.eiasToken this string is the eBay user's EIAS token; another identifier used for an eBay user ******************************************************************************* */ m_Payload = crmAPIRequest.toMap(); m_Params = ifnull(m_Payload.get("params"),Map()); // v_ChallengeCode = m_Params.get("challenge_code"); v_VerificationToken = "<verification_token_entered_on_the_form>"; v_Endpoint = "https://www.zohoapis.com/crm/v7/functions/fn_ebay_alertnotification/actions/execute?auth_type=apikey&zapikey=<my_zapikey>"; v_Response = zoho.encryption.SHA256(v_ChallengeCode + v_VerificationToken + v_Endpoint); // m_Challenge = Map(); m_Challenge.put("challengeResponse",v_Response); // try { // m_MetaData = m_Params.get("metadata"); v_Topic = ifnull(m_MetaData.get("topic"),"-"); v_SchemaVersion = ifnull(m_MetaData.get("schemaVersion"),"-"); v_Deprecated = ifnull(m_MetaData.get("deprecated"),"-"); m_Notification = m_Params.get("notification"); v_NotificationID = ifnull(m_Notification.get("notificationId"),"-"); v_EventDate = ifnull(m_Notification.get("eventDate"),"-"); v_PublishDate = ifnull(m_Notification.get("publishDate"),"-"); v_PublishAttemptCount = ifnull(m_Notification.get("publishAttemptCount"),"-"); m_Notification_Data = ifnull(m_Notification.get("data"),"-"); v_Username = ifnull(m_Notification_Data.get("username"),"-"); v_UserID = ifnull(m_Notification_Data.get("userId"),"-"); v_EiasToken = ifnull(m_Notification_Data.get("eiasToken"),"-"); // v_DebugMessage = crmAPIRequest + "<hr />" + m_Params + "<hr />" + v_ChallengeCode + "<hr />" + v_VerificationToken + "<hr />" + v_Endpoint + "<hr />" + v_Response; // v_Message = "<table style='border:1px'>"; v_Message = v_Message + "<tr><th>username</th><th>userId</th><th>eiasToken</th>"; v_Message = v_Message + "<tr><td>"+v_Username+"</td><td>"+v_UserID+"</td><th>"+v_EiasToken+"</td>"; v_Message = v_Message + "</table>"; // v_StatusCode = 200; // v_To = "<my_developer_ebay_email>"; l_bcc = List({<another_developer_ebay_email>}); // sendmail [ from :zoho.loginuserid to :v_To bcc: l_bcc subject :v_Topic message :v_Message ] } catch(e) { v_StatusCode = 403; } // m_PayloadResponse = Map(); m_PayloadResponse.put("body",m_Challenge); m_PayloadResponse.put("status_code",v_StatusCode); m_WebhookResponse = Map(); m_WebhookResponse.put("crmAPIResponse", m_PayloadResponse); // return m_WebhookResponse; }
- string standalone.fn_eBay_AlertNotification(String crmAPIRequest)
- {
- /* *******************************************************************************
- Function: string standalone.fn_eBay_AlertNotification(String crmAPIRequest)
- Trigger: Function executed when a webhook from eBay is sent to ZohoCRM (Market Deletion Webhook)
- Purpose: eBay Marketplace Account Deletion/Closure Notifications Workflow
- Inputs: String crmAPIRequest (Webhook)
- Outputs: JSON String crmAPIResponse
- Date Created: 2025-03-13 (Joel Lipman)
- - Initial release
- Date Modified: 2025-03-13 (Joel Lipman)
- - Validated Webhook
- - Send email to client
- More Info:
- https://developer.ebay.com/marketplace-account-deletion
- metadata.topic topic of the notification
- metadata.schemaVersion schema version
- metadata.deprecated boolean to indicate deprecation
- notification.notificationId unique identifier of the notification
- notification.eventDate timestamp indicating when eBay user made the data deletion request
- notification.publishDate timestamp indicating when current notification was sent
- notification.publishAttemptCount integer indicating how many times the notification has been sent to this specific callback URL
- notification.data.username this string is the publicly known eBay user ID
- notification.data.userId this string is the immutable identifier of the eBay user
- notification.data.eiasToken this string is the eBay user's EIAS token; another identifier used for an eBay user
- ******************************************************************************* */
- m_Payload = crmAPIRequest.toMap();
- m_Params = ifnull(m_Payload.get("params"),Map());
- //
- v_ChallengeCode = m_Params.get("challenge_code");
- v_VerificationToken = "<verification_token_entered_on_the_form>";
- v_Endpoint = "https://www.zohoapis.com/crm/v7/functions/fn_ebay_alertnotification/actions/execute?auth_type=apikey&zapikey=<my_zapikey>";
- v_Response = zoho.encryption.SHA256(v_ChallengeCode + v_VerificationToken + v_Endpoint);
- //
- m_Challenge = Map();
- m_Challenge.put("challengeResponse",v_Response);
- //
- try
- {
- //
- m_MetaData = m_Params.get("metadata");
- v_Topic = ifnull(m_MetaData.get("topic"),"-");
- v_SchemaVersion = ifnull(m_MetaData.get("schemaVersion"),"-");
- v_Deprecated = ifnull(m_MetaData.get("deprecated"),"-");
- m_Notification = m_Params.get("notification");
- v_NotificationID = ifnull(m_Notification.get("notificationId"),"-");
- v_EventDate = ifnull(m_Notification.get("eventDate"),"-");
- v_PublishDate = ifnull(m_Notification.get("publishDate"),"-");
- v_PublishAttemptCount = ifnull(m_Notification.get("publishAttemptCount"),"-");
- m_Notification_Data = ifnull(m_Notification.get("data"),"-");
- v_Username = ifnull(m_Notification_Data.get("username"),"-");
- v_UserID = ifnull(m_Notification_Data.get("userId"),"-");
- v_EiasToken = ifnull(m_Notification_Data.get("eiasToken"),"-");
- //
- v_DebugMessage = crmAPIRequest + "<hr />" + m_Params + "<hr />" + v_ChallengeCode + "<hr />" + v_VerificationToken + "<hr />" + v_Endpoint + "<hr />" + v_Response;
- //
- v_Message = "<table style='border:1px'>";
- v_Message = v_Message + "<tr><th>username</th><th>userId</th><th>eiasToken</th>";
- v_Message = v_Message + "<tr><td>"+v_Username+"</td><td>"+v_UserID+"</td><th>"+v_EiasToken+"</td>";
- v_Message = v_Message + "</table>";
- //
- v_StatusCode = 200;
- //
- v_To = "<my_developer_ebay_email>";
- l_bcc = List({<another_developer_ebay_email>});
- //
- sendmail
- [
- from :zoho.loginuserid
- to :v_To
- bcc: l_bcc
- subject :v_Topic
- message :v_Message
- ]
- }
- catch(e)
- {
- v_StatusCode = 403;
- }
- //
- m_PayloadResponse = Map();
- m_PayloadResponse.put("body",m_Challenge);
- m_PayloadResponse.put("status_code",v_StatusCode);
- m_WebhookResponse = Map();
- m_WebhookResponse.put("crmAPIResponse", m_PayloadResponse);
- //
- return m_WebhookResponse;
- }
Category: Zoho :: Article: 900
Add comment