PayPal
Process payments and manage PayPal orders, subscriptions, and invoices
Integrates PayPal into your workflow. Create and capture orders, manage billing subscriptions, create invoices, and handle payment lifecycle events. Supports sandbox mode for testing.
Create a PayPal order for a payment
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
intent | string | Yes | Payment intent: CAPTURE or AUTHORIZE |
amount | number | Yes | Payment amount |
currencyCode | string | Yes | ISO currency code (e.g. USD, EUR) |
description | string | No | Order description |
returnUrl | string | No | URL to redirect after approval |
cancelUrl | string | No | URL to redirect on cancellation |
| Parameter | Type | Description |
|---|
order | json | The created PayPal order object |
metadata | json | Order metadata: id, status, intent |
Capture payment for an approved PayPal order
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
orderId | string | Yes | The PayPal order ID to capture |
| Parameter | Type | Description |
|---|
order | json | The captured PayPal order object |
metadata | json | Order metadata: id, status |
Retrieve details of a PayPal order by ID
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
orderId | string | Yes | The PayPal order ID to retrieve |
| Parameter | Type | Description |
|---|
order | json | The PayPal order object |
metadata | json | Order metadata: id, status, intent |
Create a PayPal subscription for a billing plan
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
planId | string | Yes | The PayPal billing plan ID |
subscriberGivenName | string | No | Subscriber first name |
subscriberSurname | string | No | Subscriber last name |
subscriberEmail | string | No | Subscriber email address |
returnUrl | string | No | URL to redirect after approval |
cancelUrl | string | No | URL to redirect on cancellation |
| Parameter | Type | Description |
|---|
subscription | json | The created PayPal subscription object |
metadata | json | Subscription metadata: id, status, plan_id |
Retrieve details of a PayPal subscription by ID
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
subscriptionId | string | Yes | The PayPal subscription ID |
| Parameter | Type | Description |
|---|
subscription | json | The PayPal subscription object |
metadata | json | Subscription metadata: id, status, plan_id |
Cancel an active PayPal subscription
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
subscriptionId | string | Yes | The PayPal subscription ID to cancel |
reason | string | No | Reason for cancellation |
| Parameter | Type | Description |
|---|
metadata | json | Cancellation result metadata |
Create a PayPal invoice to send to a customer
| Parameter | Type | Required | Description |
|---|
sandbox | boolean | No | Use PayPal sandbox environment for testing |
currencyCode | string | Yes | ISO currency code (e.g. USD, EUR) |
invoiceNumber | string | No | Custom invoice number |
note | string | No | Note to include on the invoice |
payerEmail | string | No | Email address of the payer |
items | json | No | Invoice line items as JSON array: [{name, quantity, unitAmount, description?}] |
| Parameter | Type | Description |
|---|
invoice | json | The created PayPal invoice object |
metadata | json | Invoice metadata: id, status |