How to solve an INVALID_RESOURCE_ID problem with PayPal Payouts API - paypal

Here is my complete error and I am using sandbox credentials to call payout
{"name":"INVALID_RESOURCE_ID","message":"The requested resource ID was not found","debug_id":"c0b6db41825e9","information_link":"https://developer.paypal.com/docs/api/payments.payouts-batch/#errors","details":[],"links":[]}

"I am using sandbox credentials to call payout" -- where is your call's request body? Difficult for anyone to help when you provide no information.
Try a new, unique sender_item_id for each payouts batch request. If it still doesn't work, use a different (new) sandbox Business account and REST app credentials for it.

Related

CyberSource: Retrieve Capture Token from PayPal Transaction Details

I'm trying to retrieve the capture request token from past PayPal transactions as I need that for refunding customers. We don't have that info anywhere on our systems anymore because, just don't even ask. It looks kind of like this:
AxjrrwSTQDiO3h+N6P5RABJPE8jCJjo7f4OxZX/x/FO5LcGBSKHWXfwtSx+j1ncoSt3SABJtkGk=
Is it possible to get that?
I looked at PayPal's Transaction Search API here and nothing in the response says that field exists:
https://developer.paypal.com/docs/api/transaction-search/v1/
I have also checked the built-in reports on PayPal but they don't give us that either.
Furthermore, I have tried the REST API with CyberSource and that doesn't provide the Token either:
https://developer.cybersource.com/api-reference-assets/index.html#transaction-details
I have the PayPal Generated Transaction ID, the dates, our reference numbers, etc. All I need is that Capture Request Token. I will then be able to refund customers using CyberSource.
Any help or ideas would be most appreciated.
That's a CyberSource token, so you won't find it anywhere within PayPal.
The PayPal REST API itself (no CyberSource) doesn't require it for refunds, only the transaction ID: https://developer.paypal.com/docs/api/payments/v2/#captures_refund

How to use the paypal payout api return url?

I want to use the payout interface of paypal. Using curl in sandbox mode has been called. However, I dont know how to use returnUrl, because I need to know whether the payment of paypal is successful. This should be an asynchronous operation. I filled in the callback address in the location shown in the figure, but I checked the access log and found that no callback was received. Who can help me and how to solve this problem?
The URL you speak of in REST App settings really only applies to things like Connect with PayPal or OpenID integrations, and has nothing to do with Payouts.
To be notified of Payouts status, see the API response of your Payouts request, or register for Webhook events that have to do with Payouts.

Accessing PayPal Commerce Platform API

I've created a new sandbox app in paypal and checked all controls under settings.
I'm manually making a request to get an access token using cURL as suggested in the docs.
Then I make a POST request to /v2/customer/partner-referrals. I'm simply copy-pasting the request from the docs from here.
The response I get is:
HTTP/1.1 403 Forbidden
...
{
"name":"NOT_AUTHORIZED",
"message":"Authorization failed due to insufficient permissions.",
"debug_id":"...",
"information_link":"",
"details":[{
"issue":"MISSING_SCOPES",
"description":"User doesn't have this API in their scope"
}],
"links":[]
}
The partner onboarding page says, that I get 401 Unauthorized if the account doesn't have permissions to access the commerce API. But at the same time I can't find a way to request certain APIs to be included in the scope.
How can I authorize a request to PayPal Commerce API ?
UPD
There's an additional question which may actually be a reason for my issue. Am I required to apply and be approved for the Parter Program before I can use sandbox APIs ?
There's a flow chart on the paypal website for PayPal Commerce Platform integration. It clearly shows that develop the app while using sandbox while I wait for the app approval. How show I interpret this image then?
The fastest way to get started is to start the Engineering and
Business workflows at the same time.
When testing this on sandbox you need to have these specific scopes added to your account.
To do this you'll have to contact PayPal-support using this link:
[https://www.paypal-support.com/s/contactsupport?language=en_US.][1]
Let Support know you would like to add the Sandbox Scopes for PayPal Commerce Platform for Partners to your sandbox account and they should be able to help you out!
I hope this can help you!
Are you an approved PayPal partner? The form to request so is linked from the onboarding page in your question...

How to test a PayPal capture API call with Sandbox

I have setup PayPal Sandbox test accounts, a Personal (buyer) and a Business (merchant).
I'd like to test a PayPal 'DoCapture' API Operation. The problem I'm encountering is that I need an AuthorizationID and don't know how to obtain it. If i run the 'DoExpressCheckoutPayment' API call, I do not get an AuthorizationID returned, using the merchant API credentials, though I do get an 'ACK' of success. Do I need to be using the buyer credentials with the 'DoExpressCheckOutPayment' call? I don't see the API credentials in the PayPal Sandbox profile for the Personal account.
Express Checkout example with authorization and capturing you can find here.
Short answer - according with DoCapture documentation
AuthorizationID ... This is the transaction ID returned from DoExpressCheckoutPayment...
According with DoExpressCheckout documentation you need field from response, attention, PaymentInfo#TransactionId
... this value is your AuthorizationID for use with the Authorization & Capture APIs.
This is what you need to do to implement the capture API.
Create Payment: set intent as authorize in its request to get payment Id
Show Payment Details: to get approval_url. The customer will use this URL to pay for the order.
Execute approved PayPal payment: Use this API after customer successfully pays for the order. This API returns authorization-id along with capture link.
Use Capture API: use the URL obtained from step 3 to capture.
Use this link and check payments API.
https://developer.paypal.com/docs/api/payments/#payment_execute
Hope this helps to someone who stumbles upon here.

PayPal Permission API

Im building a store where merchants(sellers) can sale their goods to the customers. Im using PayPal Expresscheckout for the payments. I have tested with my own API credentials, and it works fine.
However, to be able to use the ExpressCheckout API's as a specific merchant, i have to get it's permissions.
Can they give me their permissions directly from their profile?
I dont want to implement some special workflow for getting permissions from them.
Should i then store the credentials for each merchant in my own database?
What type of credentials is it? How/Where can merchant get these and send me ?
I have read some Permission API docs, but im not sure i have understood it really, yet. So would be glad to get direct answer from someone who already have experiense with this.
Thank you!
They would need to either provide you with their API credentials from their account, or they would need to grant 3rd party permissions to your API username to be able to execute API calls on their accounts.