# Paypal on boxd

> Online payment system that allows money transfers and serves as an electronic alternative to traditional payment methods.

- Page: https://boxd.sh/integrations/paypal/
- CLI: `run paypal` (78 commands, 8 marked common)
- SDK: `import { paypal } from "@boxd/run"`; every parameter and response type is at `@boxd/run/paypal`
- Triggers: none
- Connect: `run auth paypal` (Sign in with Paypal), or https://app.boxd.sh/integrations/detail/paypal
- All integrations: https://boxd.sh/integrations/ (Markdown: https://boxd.sh/integrations/index.md)

## From the shell

```sh
run auth paypal      # once: prints a link to connect your account
run paypal           # list its commands
run paypal get-order --help
```

Parameters are flags (`--flag value`); object and array parameters take a JSON string. Output is YAML, or JSON with `--json`. Calls use your own connection; `--scope <name>` uses a connection shared with your team.

## From a script

```ts
import { every, paypal } from "@boxd/run";

every("1 hour", async () => {
  const result = await paypal.getOrder({ order_id: "…" });
  console.log(result);
});
```

Run it with `run paypal.run.ts`. Paypal has no triggers; `every()` polls on a schedule, keeps the script running as a job, and wakes the machine when it is due.

## Commands

Required flags are listed; `run paypal <command> --help` lists the optional ones. "common" marks what `run paypal` shows without `--all`.

| Command | SDK method | Required flags | Optional | Description |
|---|---|---|---|---|
| `activate-plan` ·common | `paypal.activatePlan()` | `--id` | 0 | Activates a billing plan in PayPal, making it available for subscription signups |
| `add-batch-trackers` | `paypal.addBatchTrackers()` | `--trackers` | 0 | Add tracking information for multiple PayPal transactions in a single request |
| `authorize-order` ·common | `paypal.authorizeOrder()` | `--order-id` | 5 | Authorizes payment for an order |
| `cancel-invoice` ·common | `paypal.cancelInvoice()` | `--invoice-id` | 5 | Cancels a sent PayPal invoice and optionally notifies relevant parties |
| `cancel-reminders` | `paypal.cancelReminders()` | `--invoice-id` | 0 | Cancels the automatic payment reminders for a PayPal invoice |
| `capture-subscription-payment` | `paypal.captureSubscriptionPayment()` | `--amount` `--capture-type` `--id` `--note` | 0 | Captures an authorized payment on a PayPal subscription |
| `charge-payment-method` | `paypal.chargePaymentMethod()` | `--input` | 0 | Charges a payment method and captures funds immediately using Braintree GraphQL API |
| `create-invoice` | `paypal.createInvoice()` | `--detail` | 7 | Creates a PayPal draft invoice |
| `create-payment` | `paypal.createPayment()` | `--intent` `--payer` `--transactions` | 1 | Creates a PayPal payment using the v1 Payments API |
| `create-payments-billing-plans` | `paypal.createPaymentsBillingPlans()` | `--description` `--merchant-preferences` `--name` `--payment-definitions` `--type` | 1 | Creates a PayPal billing plan using the legacy payments API (POST /v1/payments/billing-plans) |
| `create-plan` | `paypal.createPlan()` | `--billing-cycles` `--name` `--payment-preferences` `--product-id` | 4 | Creates a PayPal billing plan for subscription billing |
| `create-product` | `paypal.createProduct()` | `--name` | 6 | Creates a new product in PayPal's catalog |
| `create-subscription` ·common | `paypal.createSubscription()` | `--plan-id` | 8 | Creates a new PayPal subscription based on a billing plan |
| `create-template` | `paypal.createTemplate()` | `--name` | 5 | Creates a PayPal invoice template |
| `create-web-profile` | `paypal.createWebProfile()` | `--name` | 5 | Creates a PayPal web experience profile for customizing checkout |
| `create-webhook` | `paypal.createWebhook()` | `--event-types` `--url` | 0 | Creates a PayPal webhook endpoint to receive notifications about events |
| `create-webhook-lookup` | `paypal.createWebhookLookup()` | — | 0 | Creates a new PayPal webhook lookup to verify a webhook signature |
| `deactivate-plan` | `paypal.deactivatePlan()` | `--id` | 0 | Deactivates a PayPal billing plan, making it unavailable for new subscriptions while preserving existing subscriptions |
| `delete-external-payment` | `paypal.deleteExternalPayment()` | `--invoice-id` `--transaction-id` | 0 | Permanently deletes an external payment from a specified PayPal invoice |
| `delete-invoice` | `paypal.deleteInvoice()` | `--invoice-id` | 0 | Deletes a PayPal invoice by its ID |
| `delete-invoice-payment-record` | `paypal.deleteInvoicePaymentRecord()` | `--invoice-id` `--transaction-id` | 0 | Deletes a payment record from a PayPal invoice |
| `delete-invoice-refund-record` | `paypal.deleteInvoiceRefundRecord()` | `--invoice-id` `--transaction-id` | 0 | Permanently deletes a refund record from a specified PayPal invoice |
| `delete-payment-resource` | `paypal.deletePaymentResource()` | `--payment-resource-id` | 0 | Deletes a PayPal payment resource |
| `delete-template` | `paypal.deleteTemplate()` | `--template-id` | 0 | Deletes a PayPal invoice template by its ID |
| `delete-web-profile` | `paypal.deleteWebProfile()` | `--id` | 0 | Deletes a PayPal web experience profile by its ID |
| `delete-webhook` | `paypal.deleteWebhook()` | `--webhook-id` | 0 | Deletes a PayPal webhook by its ID |
| `fetch-node` | `paypal.fetchNode()` | `--node-id` | 0 | Fetches any object that extends the Node interface using its ID |
| `finalize-pay-pal-braintree-dispute` | `paypal.finalizePayPalBraintreeDispute()` | `--dispute-id` | 0 | Finalizes a Braintree dispute after adding evidence, submitting it to the cardholder's bank for review |
| `find-eligible-methods` | `paypal.findEligibleMethods()` | `--purchase-units` | 2 | Find a list of eligible payment methods for a customer |
| `generate-client-token` | `paypal.generateClientToken()` | — | 0 | Generate a client token for PayPal JavaScript SDK integration |
| `generate-next-invoice-number` | `paypal.generateNextInvoiceNumber()` | — | 0 | Generates the next invoice number from PayPal's invoicing service |
| `generate-next-invoice-number-v2` | `paypal.generateNextInvoiceNumberV2()` | — | 1 | Generates the next invoice number from PayPal's invoicing service using the v2 API |
| `generate-qr-code` | `paypal.generateQrCode()` | `--invoice-id` | 3 | Generates a QR code image for a PayPal invoice using the v2 invoicing API |
| `get-billing-subscriptions` | `paypal.getBillingSubscriptions()` | — | 6 | Lists PayPal billing subscriptions for the merchant account |
| `get-invoice` | `paypal.getInvoice()` | `--invoice-id` | 0 | Retrieves detailed information about a specific PayPal invoice by its ID |
| `get-invoicing-invoices-qr-code` | `paypal.getInvoicingInvoicesQrCode()` | `--invoice-id` | 3 | Generates a QR code image for a PayPal invoice |
| `get-invoicing-template` | `paypal.getInvoicingTemplate()` | `--template-id` | 0 | Retrieves detailed information about a specific PayPal invoice template by its ID |
| `get-order` ·common | `paypal.getOrder()` | `--order-id` | 1 | Retrieves detailed information about a specific PayPal order by its ID |
| `get-payment` | `paypal.getPayment()` | `--payment-id` | 0 | Retrieves details for a PayPal payment by its ID using the deprecated v1 Payments API |
| `get-payments-refund` ·common | `paypal.getPaymentsRefund()` | `--refund-id` | 0 | Retrieves details for a PayPal refund by its ID |
| `get-plan` | `paypal.getPlan()` | `--id` | 0 | Retrieves details for a specific PayPal billing plan by its ID |
| `get-product` | `paypal.getProduct()` | `--product-id` | 0 | Retrieves detailed information about a specific PayPal product by its ID |
| `get-subscription` ·common | `paypal.getSubscription()` | `--id` | 1 | Retrieves the details of a PayPal subscription by its ID |
| `get-user-info` | `paypal.getUserInfo()` | — | 1 | Retrieves user profile information from PayPal |
| `get-userinfo` | `paypal.getUserinfo()` | — | 1 | Retrieves user claims from PayPal using OpenID Connect |
| `get-web-profile` | `paypal.getWebProfile()` | `--id` | 0 | Retrieves detailed information about a PayPal web experience profile by its ID |
| `get-webhook` | `paypal.getWebhook()` | `--webhook-id` | 0 | Retrieves detailed information about a specific PayPal webhook by its ID |
| `get-webhook-lookup` | `paypal.getWebhookLookup()` | `--webhook-lookup-id` | 0 | Retrieves detailed information about a specific PayPal webhook lookup by its ID |
| `list-disputes` | `paypal.listDisputes()` | — | 7 | List PayPal customer disputes with optional filtering by date, transaction, or state |
| `list-invoices` | `paypal.listInvoices()` | — | 4 | List invoices from PayPal with pagination support |
| `list-legacy-billing-plans` | `paypal.listLegacyBillingPlans()` | — | 6 | Lists billing plans using the legacy PayPal payments API (v1/payments/billing-plans) |
| `list-payments` | `paypal.listPayments()` | — | 7 | Lists payment information for authorized payments |
| `list-plans` | `paypal.listPlans()` | — | 4 | Lists billing plans from PayPal with optional filtering and pagination |
| `list-products` | `paypal.listProducts()` | — | 3 | List products from the PayPal product catalog |
| `list-templates` | `paypal.listTemplates()` | — | 3 | List invoice templates from PayPal |
| `list-web-profiles` | `paypal.listWebProfiles()` | — | 3 | Lists web experience profiles from PayPal with optional pagination |
| `list-webhook-event-type-subscriptions` | `paypal.listWebhookEventTypeSubscriptions()` | `--webhook-id` | 0 | Lists event type subscriptions for a specific PayPal webhook |
| `list-webhook-event-types` | `paypal.listWebhookEventTypes()` | — | 0 | Lists all available PayPal webhook event types to which you can subscribe |
| `list-webhook-lookups` | `paypal.listWebhookLookups()` | — | 0 | Lists all webhook lookups associated with your PayPal application |
| `list-webhooks` | `paypal.listWebhooks()` | — | 1 | Lists webhooks configured for an application or PayPal account |
| `patch-orders` | `paypal.patchOrders()` | `--id` `--operations` | 0 | Partially updates a PayPal checkout order using JSON Patch (RFC 6902) operations |
| `patch-plan` | `paypal.patchPlan()` | `--id` `--patches` | 0 | Partially updates a PayPal billing plan using JSON Patch (RFC 6902) operations |
| `patch-subscription` | `paypal.patchSubscription()` | `--id` `--operations` | 0 | Update a PayPal subscription using JSON Patch operations |
| `patch-web-profile` | `paypal.patchWebProfile()` | `--id` `--patches` | 0 | Partially updates a PayPal web experience profile using JSON Patch (RFC 6902) operations |
| `ping-braintree` | `paypal.pingBraintree()` | — | 0 | Sends a ping query to the PayPal Braintree GraphQL API |
| `query-braintree-report` | `paypal.queryBraintreeReport()` | `--report-type` | 3 | Queries Braintree reports via GraphQL API |
| `retrieve-payment-resource` | `paypal.retrievePaymentResource()` | `--payment-resource-id` | 0 | Retrieve a PayPal payment resource by its ID |
| `search-invoices` | `paypal.searchInvoices()` | — | 19 | Search for PayPal invoices based on various filter criteria |
| `send-invoice` ·common | `paypal.sendInvoice()` | `--invoice-id` | 5 | Sends a PayPal invoice to the recipient via email |
| `simulate-webhook-event` | `paypal.simulateWebhookEvent()` | `--event-type` | 3 | Simulates a webhook event to test your webhook integration |
| `update-dispute` | `paypal.updateDispute()` | `--dispute-id` `--operations` | 0 | Partially update a PayPal dispute using JSON Patch operations |
| `update-invoice` | `paypal.updateInvoice()` | `--detail` `--invoice-id` | 11 | Fully updates a PayPal invoice by replacing the entire invoice with the provided data |
| `update-pay-pal-product` | `paypal.updatePayPalProduct()` | `--patches` `--product-id` | 0 | Partially updates a PayPal product using JSON Patch (RFC 6902) operations |
| `update-pay-pal-webhook` | `paypal.updatePayPalWebhook()` | `--patches` `--webhook-id` | 0 | Updates a PayPal webhook using JSON Patch (RFC 6902) operations |
| `update-templates` | `paypal.updateTemplates()` | `--id` `--name` | 5 | Fully updates a PayPal invoice template |
| `update-web-profile` | `paypal.updateWebProfile()` | `--id` `--name` | 4 | Updates a PayPal web experience profile |
| `verify-payment-method` | `paypal.verifyPaymentMethod()` | `--input` | 0 | Verifies a multi-use payment method to ensure it has passed fraud rules and is associated with a valid account |
| `verify-webhook-signature` | `paypal.verifyWebhookSignature()` | `--auth-algo` `--cert-url` `--transmission-id` `--transmission-sig` `--transmission-time` `--webhook-event` `--webhook-id` | 0 | Verifies the signature of a PayPal webhook notification to confirm its authenticity |

## Docs

- [run CLI](https://docs.boxd.sh/cli/run): Call connected integrations from the shell, connect new ones, and run automations.
- [Quickstart](https://docs.boxd.sh/guides/integrations/quickstart): Connect an integration, call it from the shell, and turn a script into an automation.
- [Connections](https://docs.boxd.sh/guides/integrations/connections): Connect an account once, for yourself or for your whole organization.
- [Scripts](https://docs.boxd.sh/guides/automations/scripts): Typed integrations, triggers, schedules and state in a .run.ts file.
- [Jobs](https://docs.boxd.sh/guides/automations/jobs): How a script becomes a background job: states, retries, sleep and wake.
- [Beyond the catalog](https://docs.boxd.sh/guides/automations/beyond-the-catalog): Reach your own APIs, databases and cloud accounts from a script.
