Skip to main content
Published: August 19 2008, 1:39:00 PMUpdated: November 28 2020, 4:12:06 PM

I'm trying to figure out if my users have a subscription (for instance, a Local Market subscription for Motors).  How can I do this through the API?

Occasionally, the behavior of an application will change depending on what services a user is subscribed to.  For instance, to list in certain categories under certain conditions, a Motors listing may require a Local Market subscription.  This information is easy to obtain, provided you have a token from your user.

The relevant call in this case is GetUser.  To obtain information about a specific user, you generally include the <UserID> parameter for the user you wish to obtain information about.  By default, if you omit this parameter, the GetUser call will return information about the user making the call.  As we will see in a moment, we won't actually need <UserID> in this case, since we will need the user's token to make the call.

Another thing to watch out for when using this call is that if you make the call as a user other than the one specified in the <RequesterCredentials>, you won't be able to find out what services they are subscribed to - this is 'private' info.  To illustrate the point more clearly, consider the following example:


UserA is subscribed to 'Local Market'.  DeveloperB makes a GetUser call using his own token, specifying UserA in the <UserID> block.  The GetUser call will return information about UserA, but not 'private info', such as subscription information.  Instead, DeveloperB should make the GetUser call using the token he obtained when UserA proceeded through Auth & Auth.  When DeveloperB makes a GetUser call when UserA's token in the <RequesterCredentials> node, he will be able to obtain subscription information from User A.


With that in mind, we can make the following call to retrieve information about a user's subscriptions:

GetUser Request

<?xml version="1.0" encoding="utf-8" ?>

- <GetUserRequest xmlns="urn:ebay:apis:eBLBaseComponents">
  <Version>579</Version>
- <RequesterCredentials>
  <eBayAuthToken>YOUR_USER'S TOKEN_REPLACE_ME</eBayAuthToken>
  </RequesterCredentials>
  </GetUserRequest>

Note that since we are making the call with your user's token (UserA, using the above example), we don't even need to include the <UserID> parameter for the GetUser call in this case.  Once you make this call, you'll get a result that looks like the following:

GetUser Response
<?xml version="1.0" encoding="utf-8" ?>
- <GetUserResponse xmlns="urn:ebay:apis:eBLBaseComponents">
  <Timestamp>2008-08-19T20:58:48.469Z</Timestamp>
  <Ack>Success</Ack>
  <Version>579</Version>
  <Build>e579_core_Bundled_7075166_R1</Build>
- <User>
  <AboutMePage>false</AboutMePage>
  <EIASToken>SOME_TOKEN</EIASToken>
  <Email>our_email@ebay.com</Email>
  <FeedbackScore>25</FeedbackScore>
  <UniqueNegativeFeedbackCount>0</UniqueNegativeFeedbackCount>
  <UniquePositiveFeedbackCount>25</UniquePositiveFeedbackCount>
  <PositiveFeedbackPercent>100.0</PositiveFeedbackPercent>
  <FeedbackPrivate>false</FeedbackPrivate>
  <FeedbackRatingStar>Yellow</FeedbackRatingStar>
  <IDVerified>false</IDVerified>
  <eBayGoodStanding>true</eBayGoodStanding>
  <NewUser>false</NewUser>
  <RegistrationDate>2004-10-27T07:00:00.000Z</RegistrationDate>
  <Site>eBayMotors</Site>
  <Status>Confirmed</Status>
  <UserID>our_market_user</UserID>
  <UserIDChanged>false</UserIDChanged>
  <UserIDLastChanged>2004-10-27T07:00:00.000Z</UserIDLastChanged>
  <VATStatus>NoVATTax</VATStatus>
- <SellerInfo>
  <AllowPaymentEdit>true</AllowPaymentEdit>
  <CheckoutEnabled>true</CheckoutEnabled>
  <CIPBankAccountStored>false</CIPBankAccountStored>
  <GoodStanding>true</GoodStanding>
  <LiveAuctionAuthorized>false</LiveAuctionAuthorized>
  <MerchandizingPref>OptIn</MerchandizingPref>
  <QualifiesForB2BVAT>false</QualifiesForB2BVAT>
  <SellerGuaranteeLevel>NotEligible</SellerGuaranteeLevel>
  <SellerLevel>None</SellerLevel>
- <SchedulingInfo>
  <MaxScheduledMinutes>30240</MaxScheduledMinutes>
  <MinScheduledMinutes>0</MinScheduledMinutes>
  <MaxScheduledItems>1000</MaxScheduledItems>
  </SchedulingInfo>
  <StoreOwner>false</StoreOwner>
  <ExpressEligible>false</ExpressEligible>
  <PaymentMethod>CreditCard</PaymentMethod>
  <ExpressWallet>false</ExpressWallet>
  <CharityRegistered>false</CharityRegistered>
  <SafePaymentExempt>true</SafePaymentExempt>
  <TransactionPercent>0.0</TransactionPercent>
  </SellerInfo>
  <PayPalAccountLevel>Verified</PayPalAccountLevel>
  <PayPalAccountType>Premier</PayPalAccountType>
  <PayPalAccountStatus>Active</PayPalAccountStatus>
  <EBaySubscription>LocalMarketRegular</EBaySubscription>
  <EBaySubscription>SellingManagerPro</EBaySubscription>
  <EBaySubscription>EBayStoreFeatured</EBaySubscription>
  <UserSubscription>LocalMarketRegular</UserSubscription>
  <UserSubscription>SellingManagerPro</UserSubscription>
  <UserSubscription>EBayStoreFeatured</UserSubscription>
  <eBayWikiReadOnly>false</eBayWikiReadOnly>
  <MotorsDealer>false</MotorsDealer>
  <UniqueNeutralFeedbackCount>0</UniqueNeutralFeedbackCount>
  </User>
  </GetUserResponse>

If you look at the response, you can see that this user has several subscriptions.  The <EBaySubscription> and <UserSubscription> nodes indicate the subscriptions that this user has.  You can use the existence and content of these nodes to take appropriate action in your application.

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