# PayPal

Manage PayPal: orders, captures, refunds, invoices, payouts, subscriptions. Exposes **47 actions** covering the full API surface
the agent needs - read and write.

## What it can do

| Method | What it does |
| --- | --- |
| `paypal_order_create` | Create an order - POST /v2/checkout/orders. |
| `paypal_order_get` | Get order details - GET /v2/checkout/orders/&#123;id&#125;. |
| `paypal_order_update` | Update order (before payment approval) - PATCH /v2/checkout/orders/&#123;id&#125;. |
| `paypal_orders_list` | List orders - GET /v2/checkout/orders. |
| `paypal_order_capture` | Capture a payment for an AUTHORIZE intent order - POST /v2/checkout/orders/&#123;id&#125;/capture. |
| `paypal_capture_get` | Get capture (completed payment) details - GET /v2/payments/captures/&#123;id&#125;. |
| `paypal_capture_refund` | Refund a capture (completed payment) - POST /v2/payments/captures/&#123;id&#125;/refund. |
| `paypal_refund_get` | Get refund (transaction) details - GET /v2/payments/refunds/&#123;id&#125;. |
| `paypal_authorization_get` | Get authorization details - GET /v2/payments/authorizations/&#123;id&#125;. |
| `paypal_authorization_capture` | Capture an authorization - POST /v2/payments/authorizations/&#123;id&#125;/capture. |
| `paypal_authorization_void` | Void (cancel) an authorization - DELETE /v2/payments/authorizations/&#123;id&#125;. |
| `paypal_invoice_create` | Create an invoice - POST /v2/invoicing/invoices. |
| `paypal_invoice_get` | Get invoice details - GET /v2/invoicing/invoices/&#123;id&#125;. |
| `paypal_invoice_update` | Update an invoice - PUT /v2/invoicing/invoices/&#123;id&#125;. |
| `paypal_invoices_list` | List invoices - GET /v2/invoicing/invoices. |
| `paypal_invoice_send` | Send invoice to recipient - POST /v2/invoicing/invoices/&#123;id&#125;/send. |
| `paypal_invoice_remind` | Send invoice reminder - POST /v2/invoicing/invoices/&#123;id&#125;/remind. |
| `paypal_invoice_cancel` | Cancel invoice - POST /v2/invoicing/invoices/&#123;id&#125;/cancel. |
| `paypal_invoice_record_payment` | Record a payment for an invoice - POST /v2/invoicing/invoices/&#123;id&#125;/record-payment. |
| `paypal_invoice_delete` | Delete invoice (DRAFT status only) - DELETE /v2/invoicing/invoices/&#123;id&#125;. |
| `paypal_subscription_create` | Create a subscription plan - POST /v1/billing/plans. |
| `paypal_subscription_get` | Get subscription plan details - GET /v1/billing/plans/&#123;id&#125;. |
| `paypal_subscription_update` | Update subscription plan - PATCH /v1/billing/plans/&#123;id&#125;. |
| `paypal_subscriptions_list` | List subscription plans - GET /v1/billing/plans. |
| `paypal_subscription_activate` | Activate a subscription plan (APPROVAL_PENDING status) - POST /v1/billing/plans/&#123;id&#125;/activate. |
| `paypal_subscription_suspend` | Suspend (pause) a subscription - POST /v1/billing/plans/&#123;id&#125;/suspend. |
| `paypal_subscription_cancel` | Cancel a subscription - POST /v1/billing/plans/&#123;id&#125;/deactivate. |
| `paypal_subscription_capture` | Manually trigger a payment capture on a subscription - POST /v1/billing/plans/&#123;id&#125;/capture. |
| `paypal_product_create` | Create a product - POST /v1/catalog/products. |
| `paypal_product_get` | Get product details - GET /v1/catalog/products/&#123;id&#125;. |
| `paypal_product_update` | Update product - PATCH /v1/catalog/products/&#123;id&#125;. |
| `paypal_products_list` | List products - GET /v1/catalog/products. |
| `paypal_payout_create` | Create a payout batch - POST /v1/payments/payouts. |
| `paypal_payout_get` | Get payout batch status - GET /v1/payments/payouts/&#123;id&#125;. |
| `paypal_payout_item_get` | Get individual payout item status - GET /v1/payments/payouts/&#123;batch_id&#125;/items/&#123;item_id&#125;. |
| `paypal_disputes_list` | List disputes - GET /v1/customer/disputes. |
| `paypal_dispute_get` | Get dispute details - GET /v1/customer/disputes/&#123;id&#125;. |
| `paypal_dispute_update` | Update dispute - POST /v1/customer/disputes/&#123;id&#125;/&#123;action&#125;. |
| `paypal_get_account_details` | Get authenticated merchant account details - GET /v1/oauth2/token/userinfo. |
| `paypal_get_payee_info` | Get payee (merchant) info - GET /v1/customer/partners/&#123;partner_id&#125;. |
| `paypal_list_transactions` | List transactions - GET /v1/reporting/transactions. |
| `paypal_get_transaction` | Get transaction details - GET /v1/reporting/transactions/&#123;id&#125;. |
| `paypal_webhook_create` | Create a webhook - POST /v1/notifications/webhooks. |
| `paypal_webhooks_list` | List webhooks - GET /v1/notifications/webhooks. |
| `paypal_webhook_get` | Get webhook details - GET /v1/notifications/webhooks/&#123;id&#125;. |
| `paypal_webhook_update` | Update webhook - PATCH /v1/notifications/webhooks/&#123;id&#125;. |
| `paypal_webhook_delete` | Delete webhook - DELETE /v1/notifications/webhooks/&#123;id&#125;. |

## How to get credentials

This connector uses an **API key / token**. Create one in the provider
dashboard, then paste it into FlyMyAI:

- **`PAYPAL_CLIENT_ID`** - PayPal Developer - Apps & Credentials - create REST app. (https://developer.paypal.com/dashboard/applications/)
- **`PAYPAL_CLIENT_SECRET`** - Secret shown next to the client ID in your REST app.
- **`PAYPAL_ENV`** *(optional)* - 'production' or 'sandbox' (default sandbox).

## Fields to fill in FlyMyAI

| FlyMyAI field | Where it comes from |
| --- | --- |
| `PAYPAL_CLIENT_ID` | PayPal Developer - Apps & Credentials - create REST app. |
| `PAYPAL_CLIENT_SECRET` | Secret shown next to the client ID in your REST app. |
| `PAYPAL_ENV` | 'production' or 'sandbox' (default sandbox). |

## Troubleshooting

- **`401 Unauthorized` / `403 Forbidden`** - the token is wrong, expired, or missing a required scope - regenerate it.
- **`429 Too Many Requests`** - you hit the provider rate limit; retry after a short backoff.
- **Unexpected `4xx` on writes** - double-check required fields; the agent confirms before write actions.

## Links

- [PayPal API documentation](https://developer.paypal.com/api/rest)
