REST API Request for transaction list is empty

OrchidC
Contributor
Contributor

Hi All,

 

I got the transaction request via API, I can assure that there are transactions in between start and end date but it returns empty.

Request is: api.sandbox.paypal.com/v1/reporting/transactions?fields=all...

 

Response:

{
    "transaction_details": [],
    "account_number""5EG*******",
    "start_date""2020-01-25T07:00:00+0000",
    "end_date""2020-01-27T17:59:59+0000",
    "last_refreshed_datetime""2020-01-27T17:59:59+0000",
    "page"1,
    "total_items"0,
    "total_pages"0,
    "links": [
        {
            "rel""self",
            "method""GET"
        }
    ]
}
Login to Me Too
5 REPLIES 5

OrchidC
Contributor
Contributor

When I increase the date range, it can get the initial transfer from paypal upon creation of the sandbox account, other transaction was not included.

My Sandbox transaction:

2020-01-30_8-15-02.png

Response I get:

{
    "transaction_details": [
        {
            "transaction_info": {
                "transaction_id""0TL915509U798000W",
                "transaction_event_code""T1900",
                "transaction_initiation_date""2020-01-23T06:05:50+0000",
                "transaction_updated_date""2020-01-23T06:05:50+0000",
                "transaction_amount": {
                    "currency_code""USD",
                    "value""5000.00"
                },
                "transaction_status""S",
                "transaction_subject""Initial balance",
                "protection_eligibility""02"
            }
        }
    ],
    "account_number""5EG**********",
    "start_date""2020-01-01T00:00:00+0000",
    "end_date""2020-01-27T17:59:59+0000",
    "last_refreshed_datetime""2020-01-27T17:59:59+0000",
    "page"1,
    "total_items"1,
    "total_pages"1,
    "links": [
        {
            "rel""self",
            "method""GET"
        }
    ]
}
Login to Me Too

OrchidC
Contributor
Contributor

I'm really having issues gettings response, not sure if I was filtering it incorrectly as when I change the filter date to 2020-01-27 to 2020-01-28 I am getting the response of transactions made on 27.

Hope I will be pointed to the right filter if someone experience this same issue.

2020-02-12_8-18-31.png

Login to Me Too

NSLH
Contributor
Contributor

I have run into this exact same problem in the live environment.  Some transactions can be found with the API, and some cannot.  All of them can be found through the PayPal website.  I have double checked the date range, but I have not found a solution yet.  On some transactions, the API returns nothing in the transaction_details section and the total_items is set to 0.

Login to Me Too

NSLH
Contributor
Contributor

Additional details:

I suspect there is simply a bug in the REST implementation of the Transaction Search API at PayPal.  I ran a quick test using the old NVP version of the API using one of the Transaction IDs that the REST version (https://api.paypal.com/v1/reporting/transactions) cannot return properly, and the NVP version (https://api-3t.paypal.com/nvp/?Method=TransactionSearch) was able to return the information.  Obviously the information is limited, since the NVP version returns far less information.  

Login to Me Too

MTS_Stefan
Moderator
Moderator

Hello Everyone,

 

The Transaction Search in v1 REST (/v1/reporting/transactions) is not like the one in NVP.

It is more on the reporting side, which is why transactions only appear a few hours after they took place.

The documentation points this out with:

  • It takes a maximum of three hours for executed transactions to appear in the list transactions call.

On sandbox however, that time range may very well vary.

We would recommend to give it +6h or more and use balance_affecting_records_only with N if nothing is return.

Not that you used a none instant payment method or something else caused a delay.

 

If you need to look up a transaction in a timely fashion:

V1 has the transaction list call: https://developer.paypal.com/docs/api/payments/v1/#payment_list

This one works very much like the NVP counter part.

 

Webhooks, IPN as well as Execute Payment Replies will also have the transaction ID in them.

A transaction ID: can be used in a Sale Details Call: https://developer.paypal.com/docs/api/payments/v1/#sale_get

 

I hope this helps.

Kind Regards,

<removed>

Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.