I created a new app and I'm following the API instructions as documented here: https://developer.paypal.com/docs/api/activities/
My sandbox credentials are good, and I used them to create a bearer token, which I used (in Postman) to post a payment (https://api.sandbox.paypal.com/v1/payments/payment) with success.
However, my goal for this application is to create an activity report using the API functions linked above. For this, I turned on the appropriate "App feature option" called Transaction Search, in addition to every other app feature option.
Header:
Authorization: Bearer (new bearer token here)
My GET request:
https://api.sandbox.paypal.com/v1/activities/activities?start_time=2018-05-03T15:00:00.000Z&end_time=2018-05-02T15:30:00.000Z&page_size=10&next_page_token=1
Whatever I do, I get:
HTTP Status: 401 Unauthorized
Request body:
{
"name": "PERMISSION_DENIED",
"message": "No permission for the requested operation",
"details": {
"": "No permission for the requested operation"
}
}
I am a US developer, and this application is for my own use.
The PayPal sandbox is a self-contained, virtual testing environment that simulates the live PayPal production environment. The sandbox provides a shielded space where you can initiate and watch while your apps process PayPal API requests without touching any live PayPal accounts.
The PayPal REST API is organized around transaction workflows, including: orders, payments, subscriptions, invoicing, and disputes. The API uses standard verbs and returns HTTP response codes and JSON-encoded responses.
You can enable customers to make PayPal and credit card payments with only a few clicks, depending on the country. You can accept an immediate payment or authorize a payment and capture it later. You can show details for completed payments, refunds, and authorizations.
Final answer (for now), confirmed by a PayPal developer support technician:
PayPal doesn't yet have a REST API method available to the public, for creating this report. Use TransactionSearch in the old NVP (Name-Value-Pair) API, it's reasonably well documented and used everywhere - even though it's been deprecated since 2017.
https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/?mark=TransactionSearch
For those who like to work with example code, the following GitHub project shows how you could implement the API. It was helpful to me:
https://github.com/gtaylor/paypal-python
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With