> ## Documentation Index
> Fetch the complete documentation index at: https://docs.paybyrd.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PayPal

PayPal is one of the largest payment methods in the world. Consumers can pay using their PayPal wallet balance, credit or debit cards, or Pay Later products.

<Note>The payment must be completed in 73 hours. The validity of the refund is 180 days.</Note>

## How it works

<img src="https://mintcdn.com/paybyrd/_2RsTPIIlIKxMrgj/accept-payments/img/paypal-payment-flow.png?fit=max&auto=format&n=_2RsTPIIlIKxMrgj&q=85&s=dbcd9c7f7c1e9e556b2f6de7dae15cf2" alt="Flowchart depicting PayPal payment flow" width="2108" height="1304" data-path="accept-payments/img/paypal-payment-flow.png" />

PayPal is an asynchronous payment method. When you create a payment, the customer authenticates and approves it through the PayPal interface:

* **Desktop:** a modal opens within the page.
* **Mobile:** a new browser tab opens and closes automatically on completion.

The transaction remains in a processing status until the customer acts. Once the customer completes the payment, PayPal sends a notification and the transaction is updated to either succeeded or failed.

## Create payment

The following example shows how to create a PayPal payment and the response it returns:

```bash theme={null}
curl --request POST \
 --url https://gateway.paybyrd.com/api/v2/payment \
 --header 'Accept: application/json' \
 --header 'Content-Type: application/json' \
 --header 'x-api-key: {your_api_key}' \
 --data '
{
 "type": "OnlineTransfer",
 "amount": "8.15",
 "currency": "EUR",
 "orderRef": "ABC12345", 
 "brand": "PAYPAL",
 "culture": "pt-PT"
}'
```

```json theme={null}
{
 "type": "OnlineTransfer",
 "currency": "EUR",
 "orderRef": "ABC12345",
 "brand": "PAYPAL",
 "redirectUrl": "https://your-shop-url?orderRef=ABC12345",
 "code": "BYRD207",
 "description": "Pending redirect",
 "transactionId": "39824983-4a13-42d4-8e85-e2821e494975",
 "amount": "8.15",
 "action": {
   "type": "redirect",
   "url": "https://gateway.paybyrd.com/api/v1/Redirect/39824983-4a13-42d4-8e85-e2821e494975"
 }
}
```

See the full API reference [here](/api-reference/payments/create-payment).

Check the `code` field to know whether the transaction was accepted. A successful scenario returns the code `BYRD207`. You can find the list of all status codes in the [Respone code reference](/api-reference/api-code-reference).
