# Handle funding failures (/platforms/checkout/standard/customize/handle-funding-failures)

Handle funding failures in PayPal by managing INSTRUMENT_DECLINED errors. Restart the payment process to allow the payer to select a different payment option.



> **Info:** Get the latest on our platform's capabilities and best practices by exploring our new [documentation site](https://www.paypal.ai/docs/handling-payment-failures-with-paypal/).

If your payer's funding source fails, the Orders API returns an `INSTRUMENT_DECLINED` error. A funding source might fail for the following reasons:

* The billing address associated with the payment method is incorrect.
* The transaction exceeds the card limit.
* The card issuer denied the transaction.

To handle this error, restart the payment so the payer can select a different payment option.

## Know before you code [#know-before-you-code]

> **Info:** ### Get started [#get-started]
>
> Complete the steps in **Get started** to get the following sandbox account information from the Developer Dashboard:
>
> * Your personal and business sandbox accounts.
> * Your access token.
>
> [Get started](/platforms/get-started/)

> **Info:** ### PayPal Checkout [#paypal-checkout]
>
> This feature modifies an existing PayPal Checkout integration and uses the following:
>
> * [JavaScript SDK:](/sdk/js/) Adds PayPal-supported payment methods.
> * [Orders REST API:](/api/orders/v2) Create, update, retrieve, authorize, and capture orders.
>
> [PayPal Checkout](/platforms/checkout/standard/)

> **Info:** ### Explore PayPal APIs with Postman [#explore-paypal-apis-with-postman]
>
> You can use Postman to explore and test PayPal APIs. Learn more in our [Postman guide](/api/rest/postman).

## Restart the payment [#restart-the-payment]

Restarting the payment is required if you directly call the Orders API from your server. If you use `actions.order.capture()`, the script automatically restarts the checkout flow and prompts the payer to select a different funding source.

Restart the payment in the `onApprove` function as follows:

```text lineNumbers
paypal.Buttons({
  onApprove: function (data, actions) {
    return fetch('/my-server/capture-paypal-transaction', {
      headers: {
        'content-type': 'application/json'
      },
      body: JSON.stringify({
        orderID: data.orderID
      })
    }).then(function(res) {
      return res.json();
    }).then(function(captureData) {
      if (captureData.error === 'INSTRUMENT_DECLINED'); // Your server response structure and key names are what you choose
        return actions.restart();
      }
    });
  }
}).render('#paypal-button-container');
```
