On this page
No Headings
Last updated: June 4, 2026
This product is deprecated and should not be used for new integrations. Use Payment Links and Buttons instead. For information about migrating, visit the Upgrade Hub.
These code samples demonstrate various features for a PayPal-hosted Subscribe button:
Important: This page contains unencrypted button code for illustrative purposes only. To prevent malicious tampering of buttons on your live website, always encrypt your manually created buttons.
This sample HTML code illustrates a basic Subscribe button with these features:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- Identify your business so that you can collect the payments. --> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Weekly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the regular subscription. --> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="a3" value="5.00"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <!-- Set recurring payments until canceled. --> <input type="hidden" name="src" value="1"> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>This sample HTML code illustrates a Subscribe button with these features:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- Identify your business so that you can collect the payments. --> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Weekly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the 1st trial period. --> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="a1" value="0"> <input type="hidden" name="p1" value="7"> <input type="hidden" name="t1" value="D"> <!-- Set the terms of the 2nd trial period. --> <input type="hidden" name="a2" value="5.00"> <input type="hidden" name="p2" value="3"> <input type="hidden" name="t2" value="W"> <!-- Set the terms of the regular subscription. --> <input type="hidden" name="a3" value="49.99"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="Y"> <!-- Set recurring payments until canceled. --> <input type="hidden" name="src" value="1"> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>This sample HTML code illustrates a Subscribe button that requires renewal, with these features:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- Identify your business so that you can collect the payments. --> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Monthly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the recurring payments. --> <input type="hidden" name="a3" value="69.95"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <!-- Set recurring payments to stop after 6 billing cycles. --> <input type="hidden" name="src" value="1"> <input type="hidden" name="srt" value="6"> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>When you add product options to your Subscribe buttons with HTML code that you write yourself. You can have a maximum of 10 product options, each with their own sets of choices. The options can be either drop-down menus or text boxes.
When you add product options to your Subscribe buttons with HTML code that you write yourself. You can have a maximum of 10 product options, each with their own sets of choices. The options can be either drop-down menus or text boxes.
This sample HTML code illustrates a basic Subscribe button with a drop-down menu of product options.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- Identify your business so that you can collect the payments. --> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Weekly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the regular subscription. --> <input type="hidden" name="a3" value="5.00"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <!-- Set recurring payments until canceled. --> <input type="hidden" name="src" value="1"> <!-- Provide a drop-down menu option field. --> <input type="hidden" name="on0" value="Format">Format <br /> <select name="os0"> <option value="Select a format"></option> <option value="plaintext"></option> <option value="HTML"></option> </select> <br /> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>The Subscribe button with an options drop-down menu:
The Subscribe button with an options drop-down menu:
This sample code illustrates a basic Subscribe button with a text box for entering product options.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- Identify your business so that you can collect the payments. --> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Weekly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the regular subscription. --> <input type="hidden" name="a3" value="5.00"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <!-- Set recurring payments until canceled. --> <input type="hidden" name="src" value="1"> <!-- Provide the buyer with a text box option field. --> <input type="hidden" name="on0" value="Size"> <br /> <input type="text" name="os0" maxlength="60"> <br /> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>The Subscribe button with an options text box:
The Subscribe button with an options text box:
While other payment buttons are implemented by HTML form markup, Unsubscribe
buttons are image links to the subscription cancellation function on the
PayPal website. The URL for the image link is specified with the
HREF attribute, and it includes these URL-encoded parameters:
cmd – value i _subscr-find, which tells PayPal to cancel the current, active subscription of the PayPal account holder who clicked the Unsubscribe button.alias – value is the secure merchant account ID of the subscription provider's PayPal account. This value is in the My business info section of your PayPal account profile.This code implements an Unsubscribe button that lets subscribers cancel their current, active subscriptions.
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_subscr-find&alias=SGGGX43FAKKXN&switch_classic=true">
<img src="https://www.paypalobjects.com/en_US/i/btn/btn_unsubscribe_LG.gif">
</a>This code displays this button image:
This code displays this button image:
This sample HTML code illustrates a Subscribe button that has PayPal generate usernames and passwords automatically.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <!-- Identify your business so that you can collect the payments. --> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Weekly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the regular subscription. --> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="a3" value="19.95"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <!-- Set recurring payments until canceled. --> <input type="hidden" name="src" value="1"> <!-- Have PayPal generate usernames and passwords. --> <input type="hidden" name="usr_manage" value="1"> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_unsubscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>This sample HTML code illustrates a Subscribe button that has PayPal reattempt failed recurring payments before canceling subscriptions.
<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="hidden" name="business" value="alice@mystore.com"> <!-- Specify a Subscribe button. --> <input type="hidden" name="cmd" value="_xclick-subscriptions"> <!-- Identify the subscription. --> <input type="hidden" name="item_name" value="Alice's Weekly Digest"> <input type="hidden" name="item_number" value="DIG Weekly"> <!-- Set the terms of the regular subscription. --> <input type="hidden" name="currency_code" value="USD"> <input type="hidden" name="a3" value="19.95"> <input type="hidden" name="p3" value="1"> <input type="hidden" name="t3" value="M"> <!-- Set recurring payments until canceled. --> <input type="hidden" name="src" value="1"> <!-- PayPal reattempts failed recurring payments. --> <input type="hidden" name="sra" value="1"> <!-- Display the payment button. --> <input type="image" name="submit" src="https://www.paypalobjects.com/en_US/i/btn/btn_subscribe_LG.gif" alt="Subscribe"> <img alt="" width="1" height="1" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" > </form>The sample URL code in this section illustrates a basic Subscribe email payment link with these features:
The subscription ends only when the merchant or subscriber cancels it.
Important: The example email payment link is included for illustrative purposes only. In a production environment, you should always use a hosted email payment link to prevent malicious users from tampering with the code. Non-hosted email payment links are not secure.
https://www.paypal.com/cgi-bin/webscr?&business=alice@mystore.com&item_name=Alice%27s%20Weekly%20Digest&=&=&=M¤cy_code=USDFor information on pasting button code, see Copy and paste button code.