NAME

WWW::PayPal::API::Plans - PayPal Billing Plans API (v1)

VERSION

version 0.001

SYNOPSIS

# Simple monthly flat-price plan
my $plan = $pp->plans->create_monthly(
    product_id => $product->id,
    name       => 'Monthly VIP',
    price      => '9.99',
    currency   => 'EUR',
);

# Or full control:
my $plan = $pp->plans->create(
    product_id     => $product->id,
    name           => 'Yearly VIP with 7 day trial',
    billing_cycles => [ ... ],
    payment_preferences => { ... },
);

$pp->plans->deactivate($plan->id);
$pp->plans->activate($plan->id);

DESCRIPTION

Controller for PayPal's Billing Plans API. A plan defines the billing cycle (frequency + pricing) that a subscription follows. Plans belong to a product.

create

my $plan = $pp->plans->create(
    product_id     => $pid,
    name           => 'Plan name',
    billing_cycles => [ ... ],
    payment_preferences => { ... },
);

Creates a plan with full control over the billing cycles and payment preferences. See PayPal's docs for the full schema.

create_monthly

my $plan = $pp->plans->create_monthly(
    product_id => $pid,
    name       => 'Monthly VIP',
    price      => '9.99',
    currency   => 'EUR',           # default: EUR
    trial_days => 7,               # optional free trial
    total_cycles => 0,             # 0 = infinite, default
);

Convenience shortcut for the common case: a monthly recurring plan with a single fixed price and optional free trial. For anything more complex use "create".

get

my $plan = $pp->plans->get($id);

list

my $plans = $pp->plans->list(product_id => $pid);

activate

deactivate

$pp->plans->deactivate($id);
$pp->plans->activate($id);

Activates / deactivates a plan. Deactivated plans can't be used for new subscriptions but existing subscriptions continue to bill.

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-paypal/issues.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.