Search code examples
soappaypalpaypal-sandboxebay-api

Transaction refused because of an invalid argument. The transaction id is not valid


I have a TransactionID from requesting GetOrders on eBay, but when I make a PayPal GetTransactionDetails request and provide the value it returned, I get the following error:

Errors[] = 
    (ErrorType){
        ShortMessage = "Transaction refused because of an invalid argument. See additional error messages for details."
        LongMessage = "The transaction id is not valid"
        ErrorCode = "10004"
        SeverityCode = "Error"
    },

For both PayPal and eBay I have a sandbox buyer and seller account, and on eBay the buyer account has bought and paid for a product from the seller account. The payment is showing up in both PayPal accounts and both eBay accounts, and I have confirmed that I am using the PayPal credentials for the seller account.

The SOAP request I am sending is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:ns="urn:ebay:api:PayPalAPI" xmlns:ns0="urn:ebay:apis:eBLBaseComponents" xmlns:ns1="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns2="urn:ebay:api:PayPalAPI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header>
        <ns:RequesterCredentials>
            <ns:Credentials xmlns:ns="urn:ebay:apis:eBLBaseComponents">
                <ns:Username>VALUE</ns:Username>
                <ns:Password>VALUE</ns:Password>
                <ns:Signature>VALUE</ns:Signature>
            </ns:Credentials>
        </ns:RequesterCredentials>
    </SOAP-ENV:Header>
    <ns1:Body>
        <ns2:GetTransactionDetailsReq>
            <ns2:GetTransactionDetailsRequest>
                <ns0:Version>117.0</ns0:Version>
                <ns0:TransactionID>VALUE</ns0:TransactionID>
            </ns2:GetTransactionDetailsRequest>
        </ns2:GetTransactionDetailsReq>
    </ns1:Body>
</SOAP-ENV:Envelope>

Any help would be much appreciated.


Solution

  • It seems like incorrect formatting or name space . Can your try this :

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:ebay:apis:eBLBaseComponents" xmlns:ns2="urn:ebay:api:PayPalAPI">
    
    <SOAP-ENV:Header>
        <ns2:RequesterCredentials>
          <ns1:Credentials>
    
             <ns1:Username>VALUE</ns1:Username>
            <ns1:Password>VALUE</ns1:Password>
            <ns1:Signature>VALUE</ns1:Signature>
    
          </ns1:Credentials>
        </ns2:RequesterCredentials>
    </SOAP-ENV:Header>
    
      <SOAP-ENV:Body>
        <ns2:GetTransactionDetailsReq>
          <ns2:GetTransactionDetailsRequest>
            <ns1:Version>84.0</ns1:Version>
    
            <ns2:TransactionID>VALUE</ns2:TransactionID>
          </ns2:GetTransactionDetailsRequest>
        </ns2:GetTransactionDetailsReq>
      </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>