PAYER_ACTION_REQUIRED with status 200
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I've got a problem in the integration of the REST API.
I have a shop and want to first authorize and then in another step capture a payment. The steps are:
1) Create order
2) Authorize order
3) Capture order
The first step is successful. But I've got an issue in the last two. For authorize and capture, the return status of the response is 200 with the status "PAYER_ACTION_REUQIRED". In the documentation, there is information about a redrection to the HATEOAS link, but I can't do this technically in this step. Is there any possibility to finish the order?
Here are the bodies for my requests:
Create order:
{
"purchase_units": [
{
"amount": {
"breakdown": {
"item_total": {
"value": 45.83,
"currency_code": "EUR"
}
},
"value": 45.83,
"currency_code": "EUR"
},
"reference-id": "ap04iuif4j9aq82ovtjbfmq2tc4"
}
],
"payment_source": {
"paypal": {
"experience_context": {
"user_action": "PAY_NOW",
"landing_page": "LOGIN",
"return_url": "NOT INTERESTING FOR THE POST",
"payment_method_preference": "IMMEDIATE_PAYMENT_REQUIRED",
"brand_name": "EXAMPLE INC",
"locale": "de-DE",
"cancel_url": "http://localhost"
}
}
},
"intent": "AUTHORIZE"
}
Authorize order:
{
"payment_source": {
"paypal": {
"experience_context": {
"user_action": "PAY_NOW",
"landing_page": "LOGIN",
"return_url": "NOT INTERESTING FOR THE POST",
"payment_method_preference": "IMMEDIATE_PAYMENT_REQUIRED",
"locale": "de-DE",
"cancel_url": "http://localhost",
"shipping_preference": "NO_SHIPPING"
}
}
}
}
Response:
{
"id": "41053874NS5614918",
"status": "PAYER_ACTION_REQUIRED",
"payment_source": {
"paypal": {}
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/41053874NS5614918",
"rel": "self",
"method": "GET"
},
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=41053874NS5614918",
"rel": "payer-action",
"method": "GET"
}
]
}
Capture order:
{
"payment_source": {
"paypal": {
"experience_context": {
"user_action": "PAY_NOW",
"landing_page": "LOGIN",
"return_url": "NOT INTERESTING FOR THE POST",
"payment_method_preference": "IMMEDIATE_PAYMENT_REQUIRED",
"locale": "de-DE",
"cancel_url": "http://localhost",
"shipping_preference": "NO_SHIPPING"
}
}
}
}
Response:
{
"id": "41053874NS5614918",
"status": "PAYER_ACTION_REQUIRED",
"payment_source": {
"paypal": {}
},
"links": [
{
"href": "https://api.sandbox.paypal.com/v2/checkout/orders/41053874NS5614918",
"rel": "self",
"method": "GET"
},
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=41053874NS5614918",
"rel": "payer-action",
"method": "GET"
}
]
}
Could you please help me? Thank you!
Best regards
Basti
- Labels:
-
Payments REST APIs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Did you ever find a solution to this?
I am having the same issue. I cannot get past this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In this bit...
{
"href": "https://www.sandbox.paypal.com/checkoutnow?token=41053874NS5614918",
"rel": "payer-action",
"method": "GET"
}
You need to open a browser and follow that link as the "Payer". Use your sandbox personal account to pay.
A Paypal login will pop up - you sign in as sb#### personal.example.com and that completes the "Payer Action".
After that, as the Payer, you'll be sent to the return_url.
The return_url should run the order/capture API to make the payment transfer happen between Payer and Seller. (... or approval - then capture - if that is what you want to do.)

Haven't Found your Answer?
It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.
- Which api can get oauth2.0 authorization_code? in REST APIs
- "System error. Please try again later" when connecting to paypal sandbox account with my android app in Sandbox Environment
- NOT ENABLED TO VAULT PAYMENT SOURCE in Sandbox Environment
- p is not a function error using the example downloaded from Paypal in SDKs
- v2/payments/authorizations/{authorization_id} Request failed with status code 404 in REST APIs