# PayPal

A secure and globally accepted online payment transfer.

Note
Make yourself familiar with our [API principles](/access/products/reference/api-principles) to ensure a resilient integration.

details
summary
Product overview
#### Why use PayPal

PayPal is a global payment method with strong consumer recognition and trust. It is also one of the most popular APMs in the world. PayPal opens up a large customer base who already have PayPal accounts and can make purchases with a payment flow that they are comfortable with.

It is accepted in over 200 countries and supports 25 currencies.

#### Feature summary

| Payment type | Countries | Pay later | Recurring | Reversals | Partial reversals | Disputes | Auth only | Auth and settlement (sale) | Airline data | PayPal risk data | Shipping and tracking info | Venmo |
|  --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| Digital Wallet | Global acceptance | ✅ | ❌ |  Refund - yes Cancel - yes | Partial refund - yesMultiple refunds/Partial cancel - no | Handled directly via PayPal | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ |


#### Acceptance currencies

| Currency | Currency Codes |
|  --- | --- |
| Australian Dollar | AUD |
| Brazilian Real | BRL |
| Canadian Dollar | CAD |
| Czech Koruna | CZK |
| Danish Krone | DKK |
| Euro | EUR |
| Hong Kong Dollar | HKD |
| Hungarian Forint | HUF |
| Indian Rupee | INR |
| Israeli New Shekel | ILS |
| Japanese Yen | JPY |
| Malaysian Ringgit | MYR |
| Mexican Peso | MXN |
| New Taiwan Dollar | TWD |
| New Zealand Dollar | NZD |
| Norwegian Krone | NOK |
| Philippine Peso | PHP |
| Polish Złoty | PLN |
| Pound Sterling | GBP |
| Singapore Dollar | SGD |
| Swedish Krona | SEK |
| Swiss Franc | CHF |
| Thai Baht | THB |
| United States Dollar | USD |


Note
For use of PayPal in the US please contact your Relationship Manager.

#### Payment flows

There are two different ways to integrate PayPal:

- Redirect URL mechanism
- Smart Button


##### Redirect URL

Your customer is redirected to a web browser to log into PayPal where they complete the payment.

##### Smart Button

Your customer clicks on the Smart Button, a pop-up window opens on top of their payment screen.

You must integrate with the PayPal SDK using the [JavaScript SDK script configuration developer guide](https://developer.paypal.com/sdk/js/configuration/).

Important
The `payment-source` within the PayPal SDK must be "paypal" when integrating with Access Worldpay. This enables the PayPal option within the SDK. Other payment methods, offered by the PayPal SDK, will not work with Access Worldpay.

You can also customize the PayPal Smart Button. The options are:

* the size, color and shape of the button
* the language that appears on the buttons
* the layout of the button: horizontal or vertical


## Get started

Use our [API reference](/access/products/apms/openapi) and set your headers.

## Request

`POST` `https://try.access.worldpay-bsh.securedataplatform.com/apmPayments`

### Example request

Authorization request
### Parameters

Recommendation
We suggest you provide the `cancelURL`,`failureURL`, `pendingURL` and  `successURL` attribute to redirect your customer to, once you have received the payment result.

## Response

### Example response

Successful Smart Button

```json
{
    "paymentId": "nFxASqw-LV9HE_rr1mMONP6OuaBhNYiq0jRwvvUBRLffpu0O_8mOnTpFSIM9gnTSg8thuF8qvuzMKHjhAUKA-SBywF4F_ufX78jkgX7yoPwA8HF_HMLM0RSLDKrlDpMxs5bSRRbjItu_Me3kIkraos_XGMXXDzWYsmzASPr6BGo",
    "lastEvent": "pending",
    "_links": {
      "self": {
        "href": "https://access.worldpay-bsh.securedataplatform.com/apmPayments/nFxASqw-LV9HE_rr1mMONP6OuaBhNYiq0jRwvvUBRLffpu0O_8mOnTpFSIM9gnTSg8thuF8qvuzMKHjhAUKA-SBywF4F_ufX78jkgX7yoPwA8HF_HMLM0RSLDKrlDpMxs5bSRRbjItu_Me3kIkraos_XGMXXDzWYsmzASPr6BGo"
      }
    },
    "_actions": {
      "confirmPayment": {
        "href": "https://access.worldpay-bsh.securedataplatform.com/apmPayments/nFxASqw-LV9HE_rr1mMONP6OuaBhNYiq0jRwvvUBRLffpu[…]rlDpMxs5bSRRbjItu_Me3kIkraos_XGMXXDzWYsmzASPr6BGo/confirmations"
      }
    },
    "paymentInstrument": {
      "method": "paypal",
      "type": "sdk",
      "sdkReference": "2HG28153DX910101U"
    },
    "redirect": "https://api.paypal.com/v2/checkout/orders/2HG28153DX910101U",
    "commandId": "cmdEy5vwB0krLe9eMwAcE66c0"
  }
```

Successful redirect

```json
{   
    "paymentInstrument": {
      "method": "paypal",
      "type": "direct",
      "sdkReference": "05567855EK995782J"
    },
    "paymentId": "nFxASqw-LV9HE_rr1mMONP6OuaBhNYiq0jRwvvUBRLffpu0O_8mOnTpFSIM9gnTSg8thuF8qvuzMKHjhAUKA-SBywF4F_ufX78jkgX7yoPwA8HF_HMLM0RSLDKrlDpMxs5bSRRbjItu_Me3kIkraos_XGMXXDzWYsmzASPr6BGo",
    "lastEvent": "pending",
    "_links": {
      "self": {
        "href": "https://access.worldpay-bsh.securedataplatform.com/apmPayments/nFxASqw-LV9HE_rr1mMONP6OuaBhNYiq0jRwvvUBRLffpu0O_8mOnTpFSIM9gnTSg8thuF8qvuzMKHjhAUKA-SBywF4F_ufX78jkgX7yoPwA8HF_HMLM0RSLDKrlDpMxs5bSRRbjItu_Me3kIkraos_XGMXXDzWYsmzASPr6BGo"
      }
    },
    "_actions": {},
    "redirect": "https://www.paypal.com/checkoutnow?token=05567855EK995782J",
    "commandId": "cmdEy5vwB0krLe9eMwAcE66c0"
  }
```

Successful in Try

```
{
    "paymentInstrument": {
        "method": "paypal",
        "type": "direct",
        "sdkReference": "2HG28153DX910101U"
      },
    "paymentId": "eyJrIjoiYXBtLXNlcnZpY2UtZGVmYXVsdCIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.dz5mM2S9wOJFy0F+xZ63pJoY4MvCJmVKVX5RXy1cWGhFcthsPs91vvKMH5zN1RgFR8SWBDRoQFA4GRUVGjxZCWsfqOLqZzb6KliNHM8rs0EMWSqklWHSogj5rZUH5kI3DICJvCNxDzrRMZZB6OUT4E07AegBP0HiBKp5mX5kuxXiwMRCCwsuKTgtCsDJY8domtt6sBl+X8q+bpLWXQJ7YOrel1:d9ZYNUMt3N0QGVVX9O72EhvC6RLzeIxsFSOCM:ZO+3uJ34CX9E+HjhI1UTbdHYgEy9IRtW+fHHEyfvseYBMsOj8yG6LS:YpDsO0TtwhXU:ZJpmGdX3zjhg19bxkWAZFZeLAPFdvUQnHUe8Xr7Fzzgl3kRZ:UB44CGCmrMdyKRvmBV7kCfdFyAIavyL5ep9gO0r0VZn3escouFIUg=",
    "lastEvent": "pending",
    "_links": {
      "self": {
        "href": "https://try.access.worldpay-bsh.securedataplatform.com/apmPayments/eyJrIjoiYXBtLXNlcnZpY2UtZGVmYXVsdCIsImxpbmtWZXJzaW9uIjoiNi4wLjAifQ==.dz5mM2S9wOJFy0F+xZ63pJoY4MvCJmVKVX5RXy1cWGhFcthsPs91vvKMH5zN1RgFR8SWBDRoQFA4GRUVGjxZCWsfqOLqZzb6KliNHM8rs0EMWSqklWHSogj5rZUH5kI3DICJvCNxDzrRMZZB6OUT4E07AegBP0HiBKp5mX5kuxXiwMRCCwsuKTgtCsDJY8domtt6sBl+X8q+bpLWXQJ7YOrel1:d9ZYNUMt3N0QGVVX9O72EhvC6RLzeIxsFSOCM:ZO+3uJ34CX9E+HjhI1UTbdHYgEy9IRtW+fHHEyfvseYBMsOj8yG6LS:YpDsO0TtwhXU:ZJpmGdX3zjhg19bxkWAZFZeLAPFdvUQnHUe8Xr7Fzzgl3kRZ:UB44CGCmrMdyKRvmBV7kCfdFyAIavyL5ep9gO0r0VZn3escouFIUg="
      }
    },
    "_actions": {},
    "redirect": "https://secure-test.worldpay-bsh.securedataplatform.com/jsp/test/shopper/APMSTSimulator.jsp?customerRef=3484717844&paymentMethod=PAYPAL",
    "commandId": "cmdEy5vwB0krLe9eMwAcE66c0"
  }
```

Error

```json
{
  "errorName": "bodyDoesNotMatchSchema",
  "message": "The json body provided does not match the expected schema",
  "validationErrors": [
    {
      "errorName": "fieldHasInvalidValue",
      "message": "Field is mandatory",
      "jsonPath": "$.instruction.value.amount"
    }
  ]
}
```

Note
* For the Smart Button flow, the method will be `sdk`. Use the `sdkReference` to generate the Smart Button.
* For the redirect flow, the method will be `redirect`. Use the url in the response to redirect your customer.


### Schema

#### Errors

Check out our API reference for [more responses or error codes](/access/products/apms/openapi/other/payment#other/payment/response&c=400).

### Payment flows diagrams

#### PayPal redirect flow

The payment flow varies depending on the payment experience you want to offer and how you settle/capture the payment. We offer two options for this flow:

* auto settlement
* manual settlement


Please refer to the [main page](https://developer.worldpay-bsh.securedataplatform.com/products/apms) for the redirect flow diagram.

#### PayPal Smart Button flow

##### Payment confirmation

Once your customer has closed the PayPal iframe, you must confirm the payment when using the PayPal Smart Button. This is done by using the `confirmPayment` href returned in the payment request response.

Make a POST request on the `link:actions` action link returned in your payment response.

`POST` `https://try.access.worldpay-bsh.securedataplatform.com/apmPayments/nFxASqw-LV9HE_rr1mMONDTNO21DI7iBqIBDP8tbNT_pHfdVKepSMngqe9EDiBI1pHXEu-SbvqJyvSludyCd-2L21mL7uoB8zl62Ayz7E3GblXYsLnrW2-IZDMChfXfwWt7xrjVsKEPMGearp4PdIQp8hQ6k4_KTkZa_frsM4TQ/confirmations`

Note
No request body is needed for this request.

For greater understanding of the PayPal Smart Button flow, view the sequence diagram below.


```mermaid

sequenceDiagram
    participant Customer
    participant Merchant
    participant Worldpay
    participant PayPal
    Customer->>Merchant: 1. Clicks Smart Button
    Merchant->>Worldpay: 2. Sends request to create a payment 
    Worldpay->>PayPal: 3. Validates and sends request to create a payment
    PayPal->>Worldpay: 4. Generates and responds with paymentId
    Worldpay->>Merchant: 5. Sends paymentId and SDK reference, including confirmPayment href
    Merchant->>Customer: 6. Uses SDK ref to have Smart Button render the PayPal login screen
    Customer->>PayPal: 7. Logs in and pays
    PayPal->>Customer: 8. Closes PayPal screen
    Merchant->>Worldpay: 9. Uses the confirmPayment href to confirm the payment
    Worldpay->>PayPal: 10. Sends payment confirmation
    PayPal->>Worldpay: 11. Processes payment and provides notification on transaction outcome
    Worldpay->>Merchant: 12. Provides notification, via webhook, on transaction outcome
```

**Next steps**

[Manage your PayPal payment](/access/products/apms/manage/)