# Connect PayPal

Let customers pay with their PayPal balance or cards: create a PayPal app, add its webhook, then add the account in Commerce.

Source: https://support.rework.com/article/commerce-connect-paypal

> **In plain words:** **PayPal** lets your customers pay with their PayPal balance or a card. Once connected, the customer approves the payment on PayPal and Commerce marks the record paid. From PayPal you need an app's **Client ID** and **Secret**, plus the **Webhook ID** of the webhook you create for Commerce. New to the payment words used here? See [Payment accounts](https://support.rework.com/article/commerce-payment-accounts) and [Commerce basics](https://support.rework.com/article/commerce-basics).

**Where to find it:** Commerce > left icon rail > **Settings** > **Accounts & integrations** > **Payment accounts**. **Who can use it:** workspace admins.

## Before you start

- A PayPal Business account.
  
- A payment service in Commerce. See [Services](https://support.rework.com/article/commerce-services).
  

## Create an app in PayPal

1. Sign in to the [PayPal Developer Dashboard](https://developer.paypal.com/dashboard).
   
2. Open **Apps & Credentials** and create a **Merchant** app.
   
3. Copy the app's **Client ID** and **Secret**.
   

## Add the webhook in PayPal

1. In Commerce, open **New account** > **PayPal** and click **View guideline**. Copy the **Webhook URL**.
   
2. In your PayPal app, open the **Webhooks** section and add that URL.
   
3. Subscribe to these events: Checkout order approved, Payment capture completed, Payment capture declined, Payment capture denied, Payment capture refunded and `VAULT.PAYMENT-TOKEN.DELETED`. The last one tells Commerce when a customer removes their saved PayPal from your account, so they are asked for a new payment method right away.
   
4. Save, then copy the **Webhook ID** PayPal shows for the new webhook.
   

PayPal explains webhooks in [Webhooks](https://developer.paypal.com/api/rest/webhooks/).

## Add the account in Commerce

1. In Commerce, click **Settings** at the bottom of the left icon rail. Under **Accounts & integrations**, click **Payment accounts**.
   
2. Click **New account**. The **New payment account** dialog opens.
   
3. Under **Payment gateways**, click **PayPal**. The form **New PayPal account** opens.
   
4. Type a **Name** your team will recognise, for example "PayPal main".
   
5. Fill in the fields from the steps above. For PayPal these are **Client ID**, **Client secret** and **Webhook ID**, all required.
   
6. Optionally add **Owners**: people who are not admins but may manage this account.
   
7. Click **Create account**. The account appears in the table with the status **Enabled**.
   

![The New PayPal account form](https://storage.googleapis.com/reworkv3-public/success/261011/LQ0ARpBvVnwd1sCsKGrSEwKMvrLlGXyRVERhgSbFmSF8JBuHWYmpUh8GDrbgLNlU/img.THcBFC2nu7CDGAobqwBCCL5TllTjw3FHA3jc8LHu4tdx21fPOGtt7UuOnb3rOsIT.png)

Secret fields are hidden after saving. The table shows only their last four characters. To change one later, open the account with **Edit** and type the new value. Leave a secret blank to keep the stored one.

> **Note:** The subtitle at the top of **Payment accounts** says **Live environment** or **Sandbox environment**. Use the provider's live keys in a live workspace and its test keys in a sandbox workspace.

## Let customers pay with it

An account does nothing until a **Payment service** uses it. A payment service is the folder of payments that your quotes, orders and invoices collect through. See [Payment accounts](https://support.rework.com/article/commerce-payment-accounts) for how the pieces fit.

1. Click **Payment** in the left icon rail, then the payment service in the sidebar.
   
2. Click **Service settings** at the bottom of the sidebar.
   
3. Under **Operations**, click **Payment accounts**.
   
4. Turn on **Online gateways** if it is off, then tick your **PayPal** account.
   
5. Click **Save payment accounts**.
   

## What your customer sees

When a customer clicks **Pay** on a quote, invoice or payment link, they see **Pay with PayPal** and a **Pay** button with the amount. A note explains that they are taken to PayPal's own secure page, so their card or wallet details never reach your workspace.

After paying they return to a page that says "Waiting for the payment result" and then **Payment received**. PayPal confirms the payment to Commerce in the background, and the invoice or quote shows as paid. Each attempt is listed under **Payment** > **Checkouts**. See [Online checkouts](https://support.rework.com/article/commerce-checkouts).

## Limits to know

- PayPal accepts 24 currencies in Commerce, including USD, EUR, GBP, AUD, CAD, JPY, SGD and THB. It does not accept VND.
  
- Credentials from a PayPal sandbox app only work in a sandbox workspace, and live app credentials only in a live one.
  

## Troubleshooting

| 
Problem

 | 

Why it happens

 | 

What to do

 |
| --- | --- | --- |
| 

Customers pay but the record stays unpaid

 | 

The webhook is missing or the **Webhook ID** is wrong

 | 

Check the webhook in your PayPal app and paste its current **Webhook ID**

 |
| 

PayPal is not offered for a record

 | 

The record's currency is not one PayPal accepts

 | 

Use another provider or a bank transfer for that currency

 |
| 

The provider is not offered at checkout

 | 

The account is not attached to the payment service, or it is **Disabled**

 | 

Tick it under **Online gateways** in the service's **Payment accounts** settings, and check its status is **Enabled**

 |
| 

A field shows "Stored ••1234, leave blank to keep."

 | 

The secret is saved and hidden on purpose

 | 

Leave it blank to keep it, or type a new value to replace it

 |
