Integrate PayPal payments, invoicing, payouts, products, and subscriptions into your Cortex agents via the PayPal REST API.
| Service | Tools | What You Can Do |
|---|---|---|
| π³ Orders | 4 | Create, capture, show, and refund orders |
| π Invoices | 3 | List, create, and view invoices |
| πΈ Payouts | 1 | Send payments to multiple recipients |
| π¦ Products | 2 | List and create catalog products |
| π Subscriptions | 2 | List billing plans and create subscriptions |
Total: 12 tools across 5 PayPal services.
# From marketplace
cortex plugin install marketplace:cortex-plugin-paypal
# From GitHub
cortex plugin install github:CortexPrism/cortex-plugin-paypal
# Local development
cortex plugin install ./manifest.json- PayPal Developer Account at developer.paypal.com
- Create a REST API App in the Dashboard
- Get your Client ID and Client Secret
- Use Sandbox credentials for testing, Live for production
{
"plugins": {
"cortex-plugin-paypal": {
"enabled": true,
"config": {
"paypalClientId": "YOUR_CLIENT_ID",
"paypalClientSecret": "YOUR_CLIENT_SECRET",
"paypalEnvironment": "sandbox"
}
}
}
}| Field | Type | Required | Description |
|---|---|---|---|
paypalClientId |
string | Yes | PayPal REST API Client ID |
paypalClientSecret |
string | Yes | PayPal REST API Client Secret |
paypalEnvironment |
string | No | sandbox or live (default: sandbox) |
# List tools
cortex tools list | grep paypal
# Create an order
cortex tool call paypal_create_order '{"amount": "25.99", "description": "Widget purchase"}'
# List products
cortex tool call paypal_list_products '{"page_size": 10}'
# Send a payout
cortex tool call paypal_create_payout '{
"recipients": "[{\"email\":\"user@example.com\",\"amount\":\"50.00\"}]"
}'
# Use in chat
cortex chat --plugin cortex-plugin-paypalCreate a PayPal order for a purchase.
Parameters:
amount(string, required) β Order total (e.g.,"25.99")currency(string, optional, default:USD) β Currency codedescription(string, optional) β Order descriptionintent(string, optional, default:CAPTURE) βCAPTUREorAUTHORIZEreference(string, optional) β Merchant-provided reference ID
Capture payment for an approved order.
Parameters:
order_id(string, required) β PayPal order ID
Get details of a PayPal order.
Parameters:
order_id(string, required) β PayPal order ID
Refund a captured payment.
Parameters:
capture_id(string, required) β Capture ID to refundamount(string, optional) β Partial refund amount (defaults to full)currency(string, optional, default:USD)note(string, optional) β Refund note to buyer
List PayPal invoices.
Parameters:
status(string, optional) β Filter:DRAFT,SENT,PAIDpage_size(number, optional, default: 20)page(number, optional, default: 1)
Create and optionally send an invoice.
Parameters:
recipient_email(string, required)recipient_name(string, required)amount(string, required)currency(string, optional, default:USD)note(string, optional)send(boolean, optional, default: true) β Send immediately
Get invoice details by ID.
Parameters:
invoice_id(string, required)
Send payments to multiple recipients.
Parameters:
recipients(string, required) β JSON array of{"email":"...","amount":"...","note":"..."}email_subject(string, optional)email_message(string, optional)
List catalog products.
Parameters:
page_size(number, optional, default: 20)page(number, optional, default: 1)
Create a catalog product.
Parameters:
name(string, required)description(string, optional)type(string, optional, default:DIGITAL) βPHYSICAL,DIGITAL, orSERVICEcategory(string, optional) β e.g.,SOFTWARE
List billing/subscription plans.
Parameters:
page_size(number, optional, default: 20)page(number, optional, default: 1)status(string, optional) βACTIVE,INACTIVE,CREATED
Create a subscription for a plan.
Parameters:
plan_id(string, required)subscriber_email(string, optional)subscriber_name(string, optional)quantity(number, optional, default: 1)return_url(string, optional)cancel_url(string, optional)
toolsβ Provides 12 PayPal toolsnetwork:fetchβ Makes HTTPS requests to PayPal REST API
deno task test
deno fmt
deno lint
deno task validatecortex-plugin-paypal/
βββ manifest.json # 12 tool definitions
βββ mod.ts # Entry point
βββ auth.ts # PayPal OAuth token management
βββ services/
β βββ orders.ts # Order management (create, capture, show, refund)
β βββ invoices.ts # Invoice management (list, create, show)
β βββ payouts.ts # Payouts (send to recipients)
β βββ products.ts # Catalog products (list, create)
β βββ subscriptions.ts # Billing plans and subscriptions
βββ test/unit/mod.test.ts # Tests
βββ README.md # This file
βββ CHANGELOG.md # Version history
MIT