# Configure PayPal

## Step 1: Sign up & Sign In

To use the PayPal provider you will need to sign up for a Business PayPal account. If you haven't created one follow these steps:

1. Head over to the [PayPal site](https://www.paypal.com).
2. Click the **Sign-Up** button in the top corner to create an account.
3. Choose **Business Account** as the account type.

![PayPal Business Account Signup](/files/kqGK6ssJUkAAtz3Qfinb)

### Sandbox accounts

If you wish to test your system before going live, you need to sign up for a set of Sandbox accounts.

1. Sign in to a valid PayPal account - any account will do.
2. Follow this link: <https://developer.paypal.com/developer/accounts/>.

![PayPal Sandbox Accounts](/files/hCdNzF8R3rJGC7oanhxk)

From here you can view and modify any existing Sandbox accounts you have.

3. Select **Create Account** to create both a business and a personal set of accounts.

![Create PayPal Sandbox Accounts](/files/kOLJOsqSKxuBV3AQY2hJ)

4. Locate the **Managed Accounts** column.
5. Select **View/Edit account** for each account.
6. Note down the **Email ID** and **Password**.

![PayPal Sandbox Account Details](/files/IvPD591E2QO2Vy6d0563)

## Step 2: Create a PayPal App

In order for Umbraco Commerce to perform actions in your PayPal account on your behalf, we need to create a PayPal App. In fact, we'll need to create two: one for the Sandbox account and one for our Live account.

1. Access the [PayPal Developer Portal](https://developer.paypal.com/developer/applications/).

![Overview of apps and credentials in the PayPal developer portal.](/files/mwfmunFFayi9R0XISgnu)

2. Create the two apps by toggling the **Sandbox\Live** toggle buttons.
3. Clicking the **Create App** button to create an App for each environment.
4. Give your app a name, and choose the **Sandbox Business Account** to associate the App with the Sandbox App.
5. Click the **Create App** button to create the App.

![The options when creating a New App in the PayPal developer portal.](/files/EyVBGgENeM5x8EwlLYLW)

6. Note down the **Client ID**.
7. Click the **Show** link below the **Secret** heading.
8. Note down the **Secret**.

![API Credentials and secrets for an app in the PayPal developer portal.](/files/ITnMbmDWh7lY0QkPe4R1)

### Webhooks

Webhooks are used for communication between PayPal and the Umbraco Commerce installation. They are managed on the same PayPal portal page as the app secrets.

1. Scroll down to the **Webhooks** section.
2. Click the **Add Webhook** button to create a new Webhook.

![The configuration options when add a new webhook through the PayPal developer portal.](/files/AHy3IGgzTRevxgtdptwQ)

3. Provide the URL where the webhook notifications should be sent. See the example below:

```bash
https://{store_domain}/umbraco/commerce/payment/callback/paypal-checkout-onetime/{payment_method_id}/
```

{% hint style="info" %}
The webhook needs to be a Umbraco Commerce-specific URL. Remember to replace the parameters in curly brackets with the corresponding values taken from your store.
{% endhint %}

4. Select the **Event Types** to be notified of.
5. **Save** the webhook settings.

{% hint style="info" %}
These are the recommended Event Types to configure notifications for:

* Checkout order approved
* Checkout order completed
* Payment authorization voided
* Payment capture completed
* Payment capture denied
* Payment capture pending
* Payment capture refunded
* Payment capture reversed
  {% endhint %}

![Overview of available event types to subscribe to notifications through your webhook.](/files/MHK32HkclHVY6VAB2NcG)

6. Note down the **Webhook ID** for the webhook.

![Overview of the created Webhook in the PayPal developer portal.](/files/joUKjz8aWcGdqaBaFSZP)

Keep in mind that you will need to create an App and webhook configuration for both Sandbox and Live environments. For the Live environment, this must be set up under the account that will be accepting the payments.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.umbraco.com/umbraco-commerce-payment-providers/paypal/configuring-paypal.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
