Skip to main content
Published: November 14 2006, 4:40:00 PMUpdated: July 28 2022, 1:49:41 AM

I receiving this error when trying to Get my transactions using GetSellerTransactions.  How can I find out how many pages I need to retrieve?

<Errors>
   <
ShortMessage>Invalid page number.</ShortMessage> 
   <LongMessage>Page number is out of range.</LongMessage> 
   <ErrorCode>340</ErrorCode> 
   <SeverityCode>Error</SeverityCode> 
    <ErrorClassification>RequestError</ErrorClassification>
</Errors>

Summary

You will receive this error if the you use a value in the call Pagination that does not exist.   For instance, if there are 100 transactions for the specified ModTime filter, and you retrieve 50 transactions at a time, then the only valid values for Pagination.PageNumber are 1 and 2.  For any other value, there are no transactions and hence the error is returned.

To find out how many pages need to be retrieved:

Consider this sample GetSellerTransactions XML request:

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

<GetSellerTransactionsRequest xmlns="urn:ebay:apis:eBLBaseComponents">

  <DetailLevel>ReturnAll</DetailLevel>

  <ModTimeFrom>2022-07-25T00:00:00.000Z</ModTimeFrom>

  <ModTimeTo>2022-07-28T00:00:00.000Z</ModTimeTo>

  <RequesterCredentials>

    <eBayAuthToken>*****</eBayAuthToken>

  </RequesterCredentials>

  <Version>1173</Version>

  <Pagination>

    <PageNumber>1</PageNumber>

    <EntriesPerPage>50</EntriesPerPage>

  </Pagination>

</GetSellerTransactionsRequest>

Sample GetSellerTransactions Response:

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

<GetSellerTransactionsResponse xmlns="urn:ebay:apis:eBLBaseComponents">

  <Timestamp>2022-07-28T08:42:46.394Z</Timestamp>

  <Ack>Success</Ack>

  <Version>1173</Version>

  <Build>E1173_CORE_APISELLING_19187371_R1</Build>

  <PaginationResult>

    <TotalNumberOfPages>7</TotalNumberOfPages>

    <TotalNumberOfEntries>50</TotalNumberOfEntries>

  </PaginationResult>

  <HasMoreTransactions>true</HasMoreTransactions>

  <TransactionsPerPage>50</TransactionsPerPage>

  <PageNumber>1</PageNumber>

  <ReturnedTransactionCountActual>50</ReturnedTransactionCountActual>

  <Seller>

  ...

  <TransactionArray>

    <Transaction>

    ...

  </TransactionArray>

  <PayPalPreferred>false</PayPalPreferred>

</GetSellerTransactionsResponse>

There are a couple of ways to find out how many pages to retrieve from the response.  Starting with PageNumber 1, PaginationResult.TotalNumberOfPages gives us the maximum page number to use in the request.  Alternately, we increment the PageNumber by 1 and make the call the GetSellerTransactions till HasMoreTransactions is false.


Version Info

The code example above was based on the versions specified below:

API Schema Version  1173
 

Additional Resources

 

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