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

# Setup PayPal

> Standard PayPal Checkout, verify, webhook, and IPN on Join Markt.

# Setup PayPal

Standard PayPal (not Friends & Family) uses create-order plus verify and webhook/IPN settlement.

## Routes

| Route                           | Role                                      |
| ------------------------------- | ----------------------------------------- |
| POST /api/paypal/create-order   | Start PayPal order for a Join Markt order |
| POST /api/paypal/verify-payment | Client-side verify after return           |
| POST /api/paypal/webhook        | Webhook settlement                        |
| POST /api/paypal/ipn            | Legacy IPN path                           |

Domain helpers live in `lib/domains/payments/paypal.ts`.

## Setup

1. Enable PayPal in Payment methods and enter client credentials for the store.
2. Configure return/cancel URLs to the Join Markt checkout invoice.
3. Point webhooks (and IPN if used) at your deployment origin.
4. Test a full pay → paid/completed → delivery unlock.

## Notes

* Create is checkout-lifecycle public + rate limited.
* Amount must match the DB order.
* For Friends & Family manual flow see Setup PayPal F\&F.
* Never put PayPal secrets in embed JS.
