Skip to main content
Published: September 01 2006, 4:18:00 PMUpdated: November 28 2020, 2:30:18 PM

How can I test BestOffer notifications?

Summary

A BestOffer notification is sent when an eBay buyer places a BestOffer via the eBay website. In order to test BestOffer notifications, you need to first set up notifications at the application and user level. You with then need to create test scenarios in the sandbox. This article walks through the steps needed to test BestOffer notifications.


Detailed Description

1. Create 2 Sandbox test users. For the purposes of this article, we will call them testseller1 and testbuyer1.  Use the sandbox user creation tool at http://developer.ebay.com/DevZone/sandboxuser.asp

2. Create tokens for all three users via the Token Generation Tool at  http://developer.ebay.com/tokentool/

3. Set up Application Level notification preferences via the SetNotificationPreferences call. You may use any user’s token for setting Application Level preferences.

Example:
<SetNotificationPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <Version>429</Version>
  <ApplicationDeliveryPreferences>
  <ApplicationURL>http://www.mycompany.com/notifyurl.cgi</ApplicationURL>
  <ApplicationEnable>Enable</ApplicationEnable>
  </ApplicationDeliveryPreferences>
</SetNotificationPreferencesRequest>

Note: If you have not yet set up your notifications listener URL or are not sure if you are actually receiving notifications, you can set your <ApplicationURL> to use SMTP and send you the notification via email. To do this, set the <ApplicationURL> property to mailto://youremailaddress@yourdomain.com.

4. Set up User Level notification preferences to enable the BestOffer notification via the SetNotificationPreferences call. Make the call using testseller1's token, as you need this notification set up for the seller.

Example:
<SetNotificationPreferencesRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <Version>429</Version>
  <UserDeliveryPreferenceArray>
  <NotificationEnable>
     <EventType>BestOffer</EventType>
     <EventEnable>Enable</EventEnable>
  </NotificationEnable>
  </UserDeliveryPreferenceArray>
</SetNotificationPreferencesRequest>

5. List a FixedPriceItem with BestOffer enabled to the sandbox, using testseller1’s token

Example:

<?xml version="1.0" encoding="utf-8"?>
<AddItemRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <Version>473</Version>
  <ErrorLanguage>en_US</ErrorLanguage>
  <WarningLevel>High</WarningLevel>
  <Item>
    <ListingType>FixedPriceItem</ListingType>
    <Country>US</Country>
    <Currency>USD</Currency>
    <Description>Test Best Offer Item</Description>
    <ListingDuration>Days_5</ListingDuration>
    <Location>San Jose, CA</Location>
    <PaymentMethods>PaymentSeeDescription</PaymentMethods>
    <PrimaryCategory>
      <CategoryID>14111</CategoryID>
    </PrimaryCategory>
    <Quantity>1</Quantity>
    <StartPrice>100.0</StartPrice>
    <ShippingTermsInDescription>True</ShippingTermsInDescription>
    <Title>Test Best Offer Item</Title>
    <BestOfferDetails>
      <BestOfferEnabled>True</BestOfferEnabled>
    </BestOfferDetails>
  </Item>
  <RequesterCredentials>
    <eBayAuthToken>x</eBayAuthToken>
  </RequesterCredentials>
</AddItemRequest>


6. Log into the sandbox as testbuyer1 and place a Best Offer for the item just created.  For example, use the ViewItem URL below and fill in your newly created item number: http://cgi.sandbox.ebay.com/ws/eBayISAPI.dll?ViewItem&item=110005048035


7. The BestOffer notification you receive will look something like the example below:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Header>
  <ebl:RequesterCredentials soapenv:mustUnderstand="0" xmlns:ns="urn:ebay:apis:eBLBaseComponents" xmlns:ebl="urn:ebay:apis:eBLBaseComponents">
  <ebl:NotificationSignaturexmlns:ebl="urn:ebay:apis:eBLBaseComponents">4Fg3zMF3dDqpaEcyQowQpA==</ebl:NotificationSignature>
  </ebl:RequesterCredentials>
 </soapenv:Header>
 <soapenv:Body>
  <GetBestOffersResponse xmlns="urn:ebay:apis:eBLBaseComponents">
   <Timestamp>2006-09-01T23:48:38.751Z</Timestamp>
   <Ack>Success</Ack>
   <CorrelationID>91391120</CorrelationID>
   <Version>475</Version>
   <Build>e475_core_Bundled_3434772_R1</Build>
   <NotificationEventName>BestOffer</NotificationEventName>
   <RecipientUserID>testseller1</RecipientUserID>
   <BestOfferArray>
    <BestOffer>
     <BestOfferID>579866</BestOfferID>
     <ExpirationTime>2006-09-03T23:48:37.000Z</ExpirationTime>
     <Buyer>
      <Email>mg_sandbox2@yahoo.com</Email>
      <RegistrationDate>2005-06-30T23:34:47.000Z</RegistrationDate>
      <UserID>mg_sandbox2</UserID>
     </Buyer>
     <Price currencyID="USD">80.0</Price>
     <Status>Pending</Status>
     <Quantity>1</Quantity>
     <BestOfferCodeType>CustomCode</BestOfferCodeType>
    </BestOffer>
   </BestOfferArray>
   <Item>
    <BuyItNowPrice currencyID="USD">100.0</BuyItNowPrice>
    <ItemID>110005048035</ItemID>
    <ListingDetails>
     <EndTime>2006-09-06T23:44:47.000Z</EndTime>
    </ListingDetails>
   </Item>
  </GetBestOffersResponse>
 </soapenv:Body>
</soapenv:Envelope>

8. At this point, the seller must decide whether to accept or decline the Best Offer.  The RespondToBestOffer API can be used to complete the BestOffer transaction.

Example:

<?xml version="1.0" encoding="utf-8"?>
<RespondToBestOfferRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <RequesterCredentials>
    <eBayAuthToken>x</eBayAuthToken>
  </RequesterCredentials>
  <SiteId>0</SiteId>
  <ItemID>110005048035</ItemID>
  <BestOfferID>579866</BestOfferID>
  <Action>Decline</Action>
  <SellerResponse>Offer is too Low</SellerResponse>
</RespondToBestOfferRequest>


Additional Resources

How well did this answer your question?
Answers others found helpful