Order not found for PAYMENT.CAPTURE.DENIED webhook

Aleksey2
Contributor
Contributor

Hello, 

 

I've found a problem while handling webhooks: PAYMENT.CAPTURE.DENIED, PAYMENT.CAPTURE.DECLINED

 

When PayPal hit my backend's endpoint with payload (typical payload). I'm trying to get an information of the order from the links section

```
"links": [
{
"href": "https://api.paypal.com/v2/payments/captures/{capture_id}",
"rel": "self",
"method": "GET"
},
{
"href": "https://api.paypal.com/v2/payments/captures/{capture_id}/refund",
"rel": "refund",
"method": "POST"
},
{
"href": "https://api.paypal.com/v2/checkout/orders/{order_id}",
"rel": "up",
"method": "GET"
}
]
```

So, to get information about order, I just should hit https://api.paypal.com/v2/checkout/orders/{order_id} endpoint and provide order_id.
For some reason API return 404 error (resource_not_found) for those hooks only. Everything is working fine for PAYMENT.CAPTURE.COMPLETED hook.
What is confusing is that the structure of the webhooks is completely the same for all of em. 

Why I can't get information about the order after capture.declined hook?

Login to Me Too
1 REPLY 1

Kavyar
Moderator
Moderator

Good day @Aleksey2 

 

Thank you for posting to the PayPal community.

 

This error occurs when the access token or specific resource ID that you are passing in the payload is either expired or does not exist.

 

For more information, please use the following link - https://developer.paypal.com/api/rest/reference/orders/v2/errors/

 

To resolve this issue, I recommend trying again by performing a new API request. Please ensure that you are using the correct access token and resource ID.

 

Important: Please note that it is important to utilize the token within 24 hours. If it is not used within this timeframe, you will need to generate a new token.

 

Payment.Capture.Declined webhook event that was triggered when a payment capture was declined.

 

If you are still experiencing issues, please create an MTS ticket via the following URL  - https://www.paypal-support.com/s/?language=en_US  .Please ensure that you provide detailed information and error details when submitting the ticket.

 

Sincerely,

Kavya

PayPal MTS

 

If this post or any other was helpful, please enrich the community by giving kudos or accepting it as a solution.

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.