PayPal, guarded

v0.3.0
io.github.Fizzl13/paypal-guard Checked 7 hours ago Published 22 days ago

PayPal's Agent Toolkit with limits on refunds and the owner's Approve/Deny above them.

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

create_invoice

Create Invoices on PayPal. This function creates a draft invoice, specifying a currency code, the invoicer's business information, one or more recipients to bill, and line items. Once created, the invoice can be sent to the customer for payment. primary_recipients and items use PayPal's real nested shape (billing_info/shipping_info for recipients; unit_amount/tax/discount for items); other fields use a simplified flat shape. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

create_recurring_series

Create a recurring invoice series on PayPal. This function creates a recurring invoice series that automatically generates and sends invoices to a customer on a schedule, specifying a billing frequency, a start date, a currency code, a primary recipient, and line items for the series template. primary_recipients and items use PayPal's real nested shape (billing_info/shipping_info for recipients; unit_amount/tax/discount for items); other fields use a simplified flat shape. A newly created series is in DRAFT status and will not generate invoices until activated -- call activate_recurring_ser…

activate_recurring_series

Activate a recurring invoice series on PayPal. This function activates a recurring invoice series by its ID, moving it out of DRAFT status. Once activated, PayPal automatically generates and sends invoices to the customer based on the series' configured schedule. Call this after create_recurring_series to make the series active. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
recurring_series_id *stringThe ID of the recurring invoice series to activate.

get_recurring_series

Get a recurring invoice series from PayPal. This function retrieves details of a specific recurring invoice series using its ID, including its schedule, status, template, and recipient information.

ParameterTypeDescription
recurring_series_id *stringThe ID of the recurring invoice series to retrieve.

cancel_recurring_series

Cancel a recurring invoice series on PayPal. This function cancels a recurring invoice series by its ID. Once cancelled, PayPal stops generating and sending further invoices for the series. This action cannot be undone. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
recurring_series_id *stringThe ID of the recurring invoice series to cancel.

delete_recurring_series

Delete a recurring invoice series on PayPal. This function permanently deletes a recurring invoice series by its ID. Only series in DRAFT status can be deleted -- for a series that has already been activated, use cancel_recurring_series instead. This action cannot be undone. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
recurring_series_id *stringThe ID of the recurring invoice series to delete. Only series in DRAFT status can be deleted; use cancel_recurring_series for an activated series.

list_invoices

List invoices from PayPal. This function retrieves a list of invoices with optional pagination parameters.

ParameterTypeDescription
pagenumberThe page number of the result set to fetch.
page_sizenumberThe number of records to return per page (maximum 100).
total_requiredbooleanIndicates whether the response should include the total count of items.

get_invoice

Get an invoice from PayPal. This function retrieves details of a specific invoice using its ID.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice to retrieve.

send_invoice

Send an invoice to the recipient(s). This function sends a previously created invoice to its intended recipients. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice to send.
additional_recipientsarrayAdditional email addresses to which to send the invoice.
notestringA note to the recipient.
send_to_recipientbooleanIndicates whether to send the invoice to the recipient.

send_invoice_reminder

Send a reminder for an invoice. This function sends a reminder for an invoice that has already been sent but hasn't been paid yet.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice for which to send a reminder.
additional_recipientsarrayAdditional email addresses to which to send the reminder.
notestringA note to the recipient.
subjectstringThe subject of the reminder email.

cancel_sent_invoice

Cancel a sent invoice. This function cancels an invoice that has already been sent to the recipient(s). Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice to cancel.
additional_recipientsarrayAdditional email addresses to which to send the cancellation.
notestringA cancellation note to the recipient.
send_to_recipientbooleanIndicates whether to send the cancellation to the recipient.

delete_invoice

Delete a draft or scheduled invoice on PayPal. This function permanently deletes an invoice that is in the draft or scheduled state, by ID. It does not work on invoices that have already been sent -- use cancel_sent_invoice for those instead. After deletion, the invoice's details can no longer be retrieved, but its invoice number can be reused. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
invoice_id *stringThe ID of the draft or scheduled invoice to delete.

setup_invoice_auto_reminders

Initialize the invoice auto reminder configuration for the merchant's PayPal account. This function sets up automatic reminders for unpaid invoices, for BEFORE_DUE and/or AFTER_DUE reminder types.

ParameterTypeDescription
configurationsarrayAn array of up to two invoice auto reminder configurations, one for BEFORE_DUE and one for AFTER_DUE. If omitted, both reminder types are created with the default configuration in INACTIVE state. If o…

update_invoice_auto_reminder

Update an existing invoice auto reminder configuration by its configuration ID. This function performs a full update of the reminder configuration's timing interval, repetition count and notification preferences.

ParameterTypeDescription
interval *objectThe interval at which to send the reminder. The interval unit is always DAY.
reminder_configuration_id *stringThe ID of the auto reminder configuration to update.
repetition *integerThe number of times to send the reminder. Must be 1 for BEFORE_DUE reminders.
type *string
notificationobjectNotification settings for the reminder.
statusstringSelect an option.

search_invoicing

Search for invoices or recurring invoice series on PayPal. Use resource_type "invoice" with invoice_filters, or "recurring_series" with recurring_series_filters -- only set the matching filters object. Recurring series search covers only the past 3 years.

update_invoicing

Update an existing invoice or recurring invoice series on PayPal. For invoices, the recipient (primary_recipients) can only be changed 2 times within any 72-hour window -- avoid unnecessary recipient edits. Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

cancel_invoice_auto_reminder

Cancel all scheduled automatic reminders for an invoice. This function permanently cancels every automatic reminder scheduled for a specific invoice, by invoice ID. This action is irreversible -- once cancelled, automatic reminders cannot be re-enabled for that invoice. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or denies.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice for which to cancel all scheduled automatic reminders.

generate_invoice_qr_code

Generate a QR code for an invoice. This function generates a QR code for an invoice, which can be used to pay the invoice using a mobile device or scanning app.

ParameterTypeDescription
invoice_id *stringThe invoice id to generate QR code for
heightnumberThe QR code height
widthnumberThe QR code width

generate_invoice_number

Generate the next invoice number available to the merchant. This function generates the next invoice number by using the prefix and suffix from the merchant's last invoice number and incrementing the numeric portion by one (e.g. INVOICE-1234 -> INVOICE-1235).

record_payment_for_invoice

Record a payment for an invoice on PayPal. This function records an external or manual payment (for example, cash, check, bank transfer, or a PayPal transaction) against an invoice, by invoice ID. If the recorded amount covers the full amount due, PayPal marks the invoice PAID; otherwise it is marked PARTIALLY_PAID. This does not process a new payment -- it only logs one that was already collected. method is required. payment_id applies only to PAYPAL-type payments. Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice to record the payment against.
method *stringThe payment mode or method through which the invoicer can accept the payments.
amountobjectThe currency and amount for a financial transaction.
notestringA note associated with an external cash or check payment.
payment_datestringThe date when the invoicer recorded the payment, in yyyy-MM-dd format.
payment_date_timestringThe date and time when the invoicer recorded the payment, in Internet date and time format (ISO 8601), for example 2018-05-13T21:20:00Z or 2018-05-13T21:20:00.000-08:00. Seconds are required.
payment_idstringThe ID for a PayPal payment transaction. Required for the PAYPAL payment type.
shipping_infoobjectThe shipping information associated with this payment.

record_refund_for_invoice

Record a refund for an invoice on PayPal. This function records a refund against an invoice, by invoice ID. If all payments made against the invoice are refunded, PayPal marks the invoice REFUNDED; otherwise it is marked PARTIALLY_REFUNDED. This does not process a new refund -- it only logs one that was already issued. method is required. Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice to mark as refunded.
method *stringThe payment mode or method through which the invoicer can accept the payments.
amountobjectThe currency and amount for a financial transaction.
refund_datestringThe date when the invoicer recorded the refund, in yyyy-MM-dd format.

create_conditional_rules_for_invoice

Create conditional rules for an invoice on PayPal.

ParameterTypeDescription
invoice_id *stringThe ID of the invoice for which the conditional rules are to be created.
rules *arrayThe list of conditional rules to create for the invoice.

create_product

Create a product in PayPal using product catalog - create products API. This function creates a new product that will be used in subscription plans, subscriptions. Required parameters are: name (product name), type (product type). High level: - id: (auto-generated or specify SKU of the product) The ID of the product - name: {product_name} (required) - description: {product_description} (optional) - type {DIGITAL | PHYSICAL | SERVICE} (required) - category: {product_category} (optional) - image_url: {image_url} (optional) - home_url: {home_url} (optional) Below i…

ParameterTypeDescription
name *stringThe product name.
type *stringThe product type. Value is PHYSICAL, DIGITAL, or SERVICE.
categorystringThe product category.
descriptionstringThe product description.
home_urlstringThe home page URL for the product.
image_urlstringThe image URL for the product.

list_products

List products from PayPal. This function retrieves a list of products with optional pagination parameters.

ParameterTypeDescription
pagenumberThe page number of the result set to fetch.
page_sizenumberThe number of records to return per page (maximum 100).
total_requiredbooleanIndicates whether the response should include the total count of products.

update_product

Update a product in PayPal. This function updates an existing product using JSON Patch operations. Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

ParameterTypeDescription
operations *arrayThe PATCH operations to perform on the product.
product_id *stringThe ID of the product to update.

show_product_details

List products from PayPal. This function retrieves a list of products with optional pagination parameters.

ParameterTypeDescription
product_id *stringThe ID of the product to update.

create_subscription_plan

Create a subsctiption plan in PayPal using subscription - create plan API. This function creates a new subscription plan that defines pricing and billing cycle details for subscriptions. Required parameters are: product_id (the ID of the product for which to create the plan), name (subscription plan name), billing_cycles (billing cycle details). High level: product_id, name, description, taxes, status: {CREATED|INACTIVE|ACTIVE}, billing_cycles, payment_preferences are required in json object. While creating billing_cycles object, trial(second) billing cycle should precede regular billing cycle…

ParameterTypeDescription
billing_cycles *arrayThe billing cycles of the plan.
name *stringThe subscription plan name.
product_id *stringThe ID of the product for which to create the plan.
descriptionstringThe subscription plan description.
payment_preferencesobjectThe payment preferences for the subscription plan.
taxesobjectThe tax details.

list_subscription_plans

List subscription plans from PayPal. This function retrieves a list of subscription plans with optional product filtering and pagination parameters.

ParameterTypeDescription
pagenumberThe page number of the result set to fetch.
page_sizenumberThe number of records to return per page (maximum 100).
product_idstringThe ID of the product for which to get subscription plans.
total_requiredbooleanIndicates whether the response should include the total count of plans.

show_subscription_plan_details

Show subscription plan details from PayPal. This function retrieves the details of a specific subscription plan using its ID. Required parameters are: plan_id (the ID of the subscription plan).

ParameterTypeDescription
plan_id *stringThe ID of the subscription plan to show.

create_subscription

Create a subscription in PayPal using the subscription - create subscription API. This function allows you to create a new subscription for a specific plan, enabling the management of recurring payments. The only required parameter is plan_id (the ID of the subscription plan). All other fields are optional and can be omitted if not provided. The subscriber field is optional. If no subscriber information is provided, omit the subscriber field in the request payload. The shipping address is optional. If no shipping address is provided, set the shipping_preference to GET_FROM_FILE in the applicat…

ParameterTypeDescription
plan_id *stringThe ID of the subscription plan to create.
application_contextobjectThe application context for the subscription.
quantitynumberThe quantity of the product in the subscription.
shipping_amountobjectThe shipping amount for the subscription.
subscriberobjectThe subscriber details.

show_subscription_details

Show subscription details from PayPal. This function retrieves the details of a specific subscription using its ID. Required parameters are: subscription_id (the ID of the subscription).

ParameterTypeDescription
subscription_id *stringThe ID of the subscription to show details.
get_additional_detailsbooleanGet all detailed information for the subscription.

cancel_subscription

Cancel a customer subscription in PayPal. This function cancels an active subscription for a customer. It requires the subscription ID and an optional reason for cancellation. Required parameters are: subscription_id (the ID of the subscription to be canceled). Below is the payload request structure: { "reason": "Customer requested cancellation" } You MUST ask the user for: - subscription_id - reason for cancellation. Return all of the above as structured JSON in your response. Checked by fizzl-paypal-guard before it runs: within the owner's limits; above them the owner approves or d…

ParameterTypeDescription
payload *objectPayload for subscription cancellation.
subscription_id *stringThe ID of the subscription to show details.

update_subscription

Update a customer subscription in PayPal. This function updates an active or suspended subscription for a customer. It requires the subscription ID and payload of allowed keys to update to the subscription. Required parameters are: subscription_id (the ID of the subscription to be updated), and at-least one key to update Return response as structured JSON in your response. Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

ParameterTypeDescription
subscription_id *stringThe ID of the subscription to update.
auto_bill_outstandingbooleanIndicates whether to automatically bill outstanding amounts.
currency_codestringCurrency code of the amount.
custom_idstringThe custom id for the subscription
fixed_priceobjectThe fixed price for a billing cycle.
outstanding_balancestringOutstanding Balance in the subscription
payment_failure_thresholdnumberThe number of failed payments before the subscription is canceled.
shipping_addressobjectThe shipping address.
shipping_amountstringThe value of the shipping amount.
taxes_inclusivebooleanIndicates whether the tax is inclusive.
taxes_percentagestringThe tax percentage.

create_shipment_tracking

Create a shipment for a transaction in PayPal. This function creates a shipment record for a specific transaction, allowing you to track the shipment status and details. The transaction_id can fetch from the captured payment details in the order information. Required parameters are: tracking_number (the tracking number for the shipment), transaction_id (the transaction ID associated with the shipment). High level: tracking_number, transaction_id, status (optional), carrier (optional) are required json objects. Below is the payload request structure: { "tracking_number": "1234567890",…

ParameterTypeDescription
tracking_number *stringThe tracking number for the shipment. Id is provided by the shipper. This is required to create a shipment.
transaction_id *stringThe transaction ID associated with the shipment. Transaction id available after the order is paid or captured. This is required to create a shipment.
carrierstringThe carrier handling the shipment.
order_idstringThe ID of the order for which to create a shipment
statusstringThe status of the shipment. It can be "ON_HOLD", "SHIPPED", "DELIVERED", or "CANCELLED".

get_shipment_tracking

Get tracking information for a shipment by ID. This function retrieves tracking information for a specific shipment using the transaction ID and tracking number. The transaction_id can fetch from the captured payment details in the order information. Below is the payload request structure:

ParameterTypeDescription
order_idstringThe ID of the order for which to create a shipment.
transaction_idstringThe transaction ID associated with the shipment tracking to retrieve.

update_shipment_tracking

Update tracking information for a shipment by ID and status. This tool updates tracking information such as the carrier or the tracking number for a specific shipment using the transaction ID and status.

ParameterTypeDescription
status *stringThe status of the item shipment. It can be "CANCELLED", "DELIVERED", "LOCAL_PICKUP", "ON_HOLD", or "SHIPPED".
tracking_number *stringThe tracking number that you want to update.
transaction_id *stringThe transaction ID associated with the shipment tracking to retrieve.
carrierstringThe carrier handling the shipment.
new_tracking_numberstringThe new tracking number for the shipment if being updated.

create_order

Create an order in PayPal. This tool is used to create a new order in PayPal. This is typically the first step in initiating a payment flow. It sets up an order with specified details such as item(s) to be purchased, quantity, amount, currency, and other details.

ParameterTypeDescription
currencyCode *stringCurrency code of the amount.
items *array
cancelUrlstring
discountnumberThe discount amount for the order.
notes
returnUrlstring
shippingAddressThe shipping address for the order.
shippingCostnumberThe cost of shipping for the order.

get_order

Retrieves the order details from PayPal for a given order ID. This tool is used to retrieve details of an existing order in PayPal. It provides information about the order, including items, amounts, status, and other relevant details.

ParameterTypeDescription
id *stringThe order id generated during create call

pay_order

Capture a payment for an order. This tool is used to capture a payment for an order. It allows you to capture funds that have been authorized for a specific order but not yet captured.

ParameterTypeDescription
id *stringThe order id generated during create call

list_disputes

List disputes from PayPal. This function retrieves a list of disputes with optional pagination and filtering parameters.

ParameterTypeDescription
dispute_statestringOPEN_INQUIRIES
disputed_transaction_id
pagenumber
page_sizenumber

get_dispute

Get details for a specific dispute from PayPal. This tool is used to lists disputes with a summary set of details, which shows the dispute_id, reason, status, dispute_state, dispute_life_cycle_stage, dispute_channel, dispute_amount, create_time and update_time fields.

ParameterTypeDescription
dispute_id *stringThe order id generated during create call

accept_dispute_claim

Accept liability for a dispute claim. This tool is used to accept liability for a dispute claim. When you accept liability for a dispute claim, the dispute closes in the customer's favor and PayPal automatically refunds money to the customer from the merchant's account. Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

ParameterTypeDescription
dispute_id *string
note *stringA note about why the seller is accepting the claim

list_transactions

List transactions from PayPal. This tool is used to list transactions with optional filtering parameters within a date range of 31 days. This tool can also be used to list details of a transaction given the transaction ID. - The start_date and end_date should be specified in ISO8601 date and time format. Example dates: 1996-12-19T16:39:57-08:00, 1985-04-12T23:20:50.52Z, 1990-12-31T23:59:60Z - The transaction_status accepts the following 4 values: 1. "D" - represents denied transactions. 2. "P" - represents pending transactions. 3. "S" - represents successful transactions. 4.…

ParameterTypeDescription
end_datestringFilters the transactions in the response by an end date and time, in ISO8601 date and time format. Seconds are required. Fractional seconds are optional. The maximum supported range is 31 days.
pagenumber
page_sizenumber
search_monthsnumberNumber of months to search back for a transaction by ID. Default is 12 months.
start_datestringFilters the transactions in the response by a start date and time, in ISO8601 date and time format. Seconds are required. Fractional seconds are optional.
transaction_idThe ID of the transaction to retrieve.
transaction_statusstring

update_plan

Update a billing plan in PayPal using the Plans API (PATCH). This function updates an existing plan with status CREATED or ACTIVE. For INACTIVE plans, only status updates are allowed. You can patch the following attributes and objects in one call: - name - description - payment_preferences.auto_bill_outstanding - payment_preferences.payment_failure_threshold - payment_preferences.setup_fee - payment_preferences.setup_fee_failure_action - taxes.percentage Checked by fizzl-paypal-guard before it runs: the owner approves or denies each one.

ParameterTypeDescription
operations *stringThe PATCH operations to perform on the plan
plan_id *stringThe ID of the plan to update.
auto_bill_outstandingstringAuto bill outstanding
descriptionstringPlan description.
namestringPlan name
payment_failure_thresholdstringPayment failure threshold
percentagestringTaxes percentage
setup_feeobjectSetup fee
setup_fee_failure_actionstringSetup fee failure action

create_refund

Initiate a refund for a PayPal payment capture. If you have an order ID instead of a capture ID, first use the get order tool to obtain the capture ID from the order details. This function allows you to return funds to a customer by refunding a previously captured payment. You can issue a full refund or specify a partial amount. If multiple captures exist for an order, request clarification on which specific capture to refund. Required parameters: - Capture ID: The ID of the capture to refund - Amount (optional): For partial refunds, specify the amount to refund (must be less than or equal to…

ParameterTypeDescription
capture_id *stringThe ID of the capture to refund.
amountobjectThe amount to refund. If not specified, the full captured amount is refunded.
invoice_idstringThe invoice ID that is used to track this payment.
note_to_payerstringA note to the payer.

get_refund

Retrieve detailed information about a PayPal payment refund. If you have an order ID instead of a refund ID, first use the get order tool to obtain the refund ID from the order details. This function returns comprehensive details about a refund, including its current status (completed, pending, cancelled), refunded amount, and processing information. When multiple refunds exist for an order or capture, request clarification on which specific refund to retrieve. Response details include: - Refund status and ID - Refunded amount and currency - Reason for refund (if provided) - Source transacti…

ParameterTypeDescription
refund_id *stringThe ID of the refund to get details for.

get_merchant_insights

Retrieve business intelligence metrics and analytics for a merchant, filtered by start date, end date, insight type, and time interval. This tool returns actionable insights into orders and sales data, supporting data-driven business decisions.

ParameterTypeDescription
end_date *stringThe end date range to filter insights
insight_type *stringThe type of insight to retrieve. It can be "ORDERS" or "SALES"
start_date *stringThe start date range to filter insights
time_interval *stringThe time periods used for segmenting metrics data. It can be "DAILY", "WEEKLY", "MONTHLY", "QUARTERLY", or "YEARLY"

paypal_guard_status

What fizzl-paypal-guard allows and has done: the owner's limits, how much of today's limits is used, approvals waiting for the owner, and the latest decisions (from a log the agent doesn't write). With approval_id: what became of that one approval.

ParameterTypeDescription
approval_idstringAn approvalId from a result with "waiting": true

paypal_guard_check

Dry run: what fizzl-paypal-guard would decide for a PayPal tool call (allow, ask the owner, or deny, and why), without running it, counting it or asking anyone. Reads the payment, invoice or dispute at PayPal.

ParameterTypeDescription
tool *stringA PayPal tool name, like create_refund
argumentsobjectThe arguments you would pass to it