Paypal Transaction Search API not returning customer's email or phone number

Viewed 37

I'm using Paypal's transaction search API to retrieve transaction history for my account. However, sometimes all of the customer's info is not returned in the payer_info object, such as their phone number or email. This missing info shows up when I look at the transaction inside Paypal, but not the API. The call I'm making is a pretty simple cURL call:


    $ch = curl_init(); 
    curl_setopt($ch, CURLOPT_URL, 'https://api-m.paypal.com/v1/reporting/transactions?start_date=2021-06-08T00:00:00-0700&page_size=20&page=1&fields=all&end_date=2021-06-10T23:59:59-0700&transaction_id=<transactionid>');
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
    $headers = array();
    $headers[] = 'Content-Type: application/json';
    $headers[] = "Authorization: Bearer $access_token";
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    $result = curl_exec($ch);

The only things returned every time in the payer_info object are account_id, address_status, payer_status, payer_name[] and country code.

It seems as though I can get this info for transactions that were processed through Paypal checkout, but not ones that were done with a credit card (even though Paypal still processes our credit card sales).

I'm not sure what I need to change to make sure I'm always retrieving the full payer_info object. Any help would be greatly appreciated.

Thanks, Sean

0 Answers
Related