Skip to main content
Published: November 14 2006, 4:40:00 PMUpdated: November 28 2020, 3:01:57 PM

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>2006-11-01T18:28:52.799Z</ModTimeFrom>

  <ModTimeTo>2006-11-30T18:28:52.799Z</ModTimeTo>

  <RequesterCredentials>

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

  </RequesterCredentials>

  <Version>487</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>20061114T21:52:06.921Z</Timestamp>

  <Ack>Success</Ack>

  <Version>487</Version>

  <Build>e487_core_Bundled_3842622_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 487


Additional Resources

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