ORGINAL PAGE (Always use Original page for updated variables, this page is actual as of October 24, 2008 12PM EST).

Technical HTML Variables

Technical HTML variables control how PayPal responds technically when buyers click Buy Now, Donation, Add to Cart, View Cart, Subscription, and Gift Certificate buttons or when third party shopping carts or custom carts initiate payment processing.

Allowed Values for cmd HTML Variable

Value of cmd Description
_xclick The button that the person clicked was a Buy Now button.
_cart The button that the person clicked was an Add to Cart button or a View Cart button for the PayPal Shopping Cart, or the command was sent by a third party shopping cart or custom cart uploading the cart contents to PayPal.
_oe-gift-certificate The button that the person clicked was a Buy Gift Certificate button.
_xclick-subscriptions The button that the person clicked was a Subscribe button.
_donations The button that the person clicked was a Donate button.
_s-xclick The button that the person clicked was protected from tampering by using encryption.
For more information, see Encrypted Website Payments.


HTML Variables: IPN notify_url

Name Description Required or Optional Character Length
notify_url The URL to which PayPal posts information about the transaction via Instant Payment Notification. Must be URL-encoded. Optional 255

HTML Variables for Individual Items

HTML variables for individual items specify information about a product or service for Buy Now and Add to Cart buttons, or they specify information about a contribution for Donation buttons.

HTML Variables: Item Information

Name Description Required or Optional Character Length
amount The price or amount of the purchase, not including shipping, handling, or tax. If omitted in Buy Now or Donations, customers can enter an amount at time of purchase.
 •  Optional for Buy Now or Donations
 •  Required for Shopping Cart
See description.
item_name Description of item. If omitted in Buy Now or Donations, customers can enter an item name at time of purchase.
 •  Optional for Buy Now or Donations
 •  Required for Shopping Cart
See description. 127
item_number Passthrough variable for you to track purchases or donations, passed back to you at payment completion. Optional 127
quantity Number of items. If profile-based shipping rates are configured with a basis of quantity, the sum of quantity values is used to calculate the shipping charges for the transaction.
PayPal appends a sequence number to uniquely identify the item in the PayPal Shopping Cart (e.g., quantity1, quantity2).

Note: The value for quantity must be a positive integer. Null, zero, or negative numbers are not allowed.
Optional
undefined_
quantity
1: allows buyer to specify the quantity.

Note: This variable is allowed only in Buy Now or Donations, and not allowed in shopping carts.
Optional 1
weight Weight of items. If profile-based shipping rates are configured with a basis of weight, the sum of weight values is used to calculate the shipping charges for the transaction. Optional  
weight_unit The unit of measure if weight is specified. Possible values are:
 •  lbs
 •  kgs
Defaults to lbs.
Optional  
on0 First option field name. If omitted, no variable is passed back to you. The os0 variable contains the corresponding value for the label specified in this variable. For example, if on0 is "size" then os0 could be "large". Optional 64
on1 Second option field name. If omitted, no variable is passed back to you. The os1 variable contains the corresponding value for the label specified in this variable. For example, if on1 is "color" then os1 could be "blue". Optional 64
os0 Option selected by the buyer from the first set of option values. If this option is selected through a text box or radio button, each value should be no more than 64 characters. If this value is entered by the customer in a text field, there is a 200 character limit. If omitted, no variable is passed back to you.

Note: on0 must also be defined. For example, it could be "size".
Optional 64 or 200

See description.
os1 Option selected by the buyer from the second set of option values. If this option is selected through a text box or radio button, each value should be no more than 64 characters. If this value is entered by the customer in a text field, there is a 200-character limit. If omitted, no variable is passed back to you.

Note: on1 must also be defined. For example, it could be "color".
Optional 64 or 200

See description.

HTML Variables for Payment Transactions

HTML variables for payment transactions provide information about entire transactions, regardless of the individual items involved with the payment. You can use these variables with Buy Now, Donation, and View Cart buttons.

HTML Variables for Payment Transactions

Name Description Required or Optional Character Length
address_
override
1: The address specified in prepopulation variables overrides the user's stored address. The customer is shown the passed-in address but cannot edit it. If the address is not valid such as missing any required fields, including country) or not included, no address is shown. Optional 1
currency_
code
The currency of the payment. Defines the currency in which the monetary variables (amount, shipping, shipping2, handling, tax) are denominated.
Default: all monetary fields are denominated as USD.
Optional
custom Passthrough variable never presented to your customer. Optional 256
handling Handling charges. This is not quantity-specific. The same handling cost is charged regardless of the number of items on the order.
Default: no handling charges are included.
Optional
invoice Passthrough variable you can use to identify your invoice number for this purchase. Optional 127
shipping The cost of shipping this item, if you enabled the override of automatic shipping calculations per transaction through your Account Profile. If shipping is used and shipping2 is not defined, this flat amount is charged regardless of the quantity of items purchased.

Note: If you use this variable, you do not need to set up shipping rates in your Account Profile. However, shipping rates you set up in your Profile take priority over values specified with this variable, unless you select the Override shipping methods per transaction checkboxes in the shipping methods you defined; the checkboxes are deselected by default. For more information, see Overriding Shipping Calculations on Individual Transactions.

Default: if profile-based shipping is enabled, buyers are charged an amount according to the shipping methods they choose.
Optional  
shipping2 The cost of shipping each additional item. If omitted, and Profile-based shipping is enabled, buyers are charged an amount according to the shipping methods they choose. Optional  
tax Transaction-based tax override variable. Set this to a flat tax amount to apply to the transaction regardless of the buyer's location. This value overrides any tax settings set in your Profile. Default: Profile tax settings (if any) apply. Optional  
tax_cart Cart-wide tax, overriding any individual item tax_x value Optional  
weight_cart If profile-based shipping rates are configured with a basis of weight, this value is used to calculate the shipping charges for the transaction. This value overrides the weight values of individual items. Optional  
weight_unit The unit of measure if weight_cart is specified. Possible values are:
 •  lbs
 •  kgs
Defaults to lbs.
Optional  

HTML Variables for Shopping Carts

HTML variables for shopping carts can be used with Add to Cart and View Cart buttons, as well as with third party shopping carts or custom carts that initiate payment processing.

HTML Variables for Shopping Carts

Name Required or Optional Description Allowable Values
add See description Add an item to the PayPal-hosted shopping cart.
This variable must be set as follows:
add=1
The alternative is the display=1 variable, which allows the user to view the contents of the PayPal Shopping Cart.
If both add and display are specified, display takes precedence.
1
amount Required Price of the item or the total price of all items in the shopping cart. Any valid currency amount
business Required Email address for your PayPal account. Your email address
display See description Display the contents of the PayPal Shopping Cart to the buyer. This variable must be set as follows:
display=1
The alternative is the add=1 variable, which adds an item to the PayPal Shopping Cart.
If both add and display are specified, display takes precedence.
1
handling_
cart
Optional Single handling fee to be charged cart-wide. If handling_cart is used in multiple Add to Cart buttons, the handling_cart value of the first item is used. Any valid currency amount
item_name Required Name of the item or a name for the entire Shopping Cart
paymentaction Optional Indicates whether transaction is payment on a final sale or an authorization for a final sale, with payments to be captured later. The default value is "sale". Set the value to "authorization" to authorize capture of a single payment. Set the value to "order" to authorize capture of multiple, partial payments.

For more information, see the Website Payments Pro Integration Guide.

Important: If you set "paymentaction" to "order", you must use the Authorization & Capture API to capture the transaction payments. The merchant tools on the PayPal website let you capture payments only for authorizations, not for orders.
sale
authorization
order
upload See description Upload the contents of a third party shopping cart or a custom shopping cart. This variable must be set as follows:
upload=1
The alternatives are the add=1 variable and the display=1 variable, which are used with the PayPal Shopping Cart.
1


HTML Variables for Individual Items in Third Party Shopping Carts

Name Required or Optional Description Character Length
amount_x Required Price of item #x. This is only required if you specify upload=1.
handling_x Optional The cost of handling for item #x
item_name_x Required Name of item #x in the cart. Must be alphanumeric 127
item_number_x Optional Variable for you to track order or other purchase.
Default: no variable is passed back to you.
127
on0_x Optional First optional field name for item #x 64
on1_x Optional Second optional field name for item #x 64
os0_x Optional First set of optional value(s) for item #x. Requires that on0_x also be set. 200
os1_x Optional Second set of optional value(s) for item #x. Requires that on1_x also be set. 200
quantity_x Optional Quantity of the item #x. The value of quantity_x must be a positive integer. Null, zero, or negative numbers are not allowed.
shipping_x Optional The cost of shipping item #x. This variable excludes the item from automatic shipping calculations; the amount is added to the shipping charges calculated automatically on other items in the cart.
tax_x Optional The tax amount for item #x.
weight_x Optional The weight of item #x.  
weight_unit Optional The unit of measure if weight_x is specified. Possible values are:
 •  lbs
 •  kgs
Defaults to lbs.
 

HTML Variables for Subscriptions

HTML variables for subscriptions specify information for Subscription buttons, such as trial periods, regular subscription periods and subscription renewals.

HTML Variables for Subscriptions

Variable Name Required or Optional Description
cmd Required Must be set to "_xclick-subscriptions"
business Required This is your PayPal ID, or email address. This email address must be confirmed and linked to your Verified Business or Premier account.
item_name Optional Description of item being sold (maximum 127 characters). If omitted, customer will see a field in which they have the option of entering an Item Name.
return Optional An internet URL where the user will be returned after completing the payment. For example, a URL on your site that hosts a "Information on your new subscription" page. If omitted, users will be taken to the PayPal site.
rm Optional Return URL behavior. If set to "1" and if a "return" value is submitted, upon completion of the payment the buyer will be sent back to the return URL using a GET method, and no transaction variables will be submitted. If set to "2" and if a "return" value is submitted, the buyer will be sent back to the return URL using a POST method, to which all available transaction variables will also be posted. If omitted or set to "0", GET methods will be used for all Subscriptions transactions and Buy Now, Donations, or PayPal Shopping Cart transactions in which IPN is not enabled. POST methods with variables will be used for the rest.
cancel_return Optional An internet URL where the user will be returned if payment is cancelled. For example, a URL on your site which hosts a "Payment Cancelled" page. If if omitted, users will be taken to the PayPal site.
a1 Optional Trial amount 1. This is the price of the first trial period. For a free trial, use a value of 0
p1 Optional Trial period 1. This is the length of the first trial period. The number is modified by the trial period 1 units (t1, below).
t1 Optional Trial period 1 units. This is the units of trial period 1 (p1, above). Acceptable values are: D (days), W (weeks), M (months), Y (years).
a2 Optional Trial amount 2. This is the price of the second trial period.
p2 Optional Trial period 2. This is the length of the second trial period. The number is modified by the trial period 1 units (t2, below).
t2 Optional Trial period 2 units. This is the units of trial period 2 (p2, above). Acceptable values are: D (days), W (weeks), M (months), Y (years) (t2, below).
a3 Required Regular rate. This is the price of the subscription.
p3 Required Regular billing cycle. This is the length of the billing cycle. The number is modified by the regular billing cycle units (t3, below).
t3 Required Regular billing cycle units. This is the units of the regular billing cycle (p3, above) Acceptable values are: D (days), W (weeks), M (months), Y (years).
src Optional Recurring payments. If set to "1," the payment will recur unless your customer cancels the subscription before the end of the billing cycle. If omitted, the subscription payment will not recur at the end of the billing cycle.
sra Optional Reattempt on failure. If set to "1," and the payment fails, the payment will be reattempted two more times. After the third failure, the subscription will be cancelled. If omitted and the payment fails, payment will not be reattempted and the subscription will be immediately cancelled.
srt Optional Recurring Times. This is the number of payments which will occur at the regular rate. If omitted, payment will continue to recur at the regular rate until the subscription is cancelled.
no_note Required This field makes sure your subscriber is not prompted to include a note with the subscription, a function which PayPal Subscriptions does not support. This field must be included, and the value must be set to 1.
custom Optional User-defined field (maximum 255 characters) which will be passed through the system and returned to user in payment notification emails. This field will not be shown to your subscribers.
invoice Optional User- defined field (maximum 127 characters) which must be unique with each subscription. The invoice number will be shown to subscribers with the other details of their transactions.
usr_manage Optional Username and password generation field. If set to "1" PayPal will generate usernames and passwords for your subscribers. For use with Password Management (see page 33). If omitted, no passwords will be generated.
cn Optional Label that will appear above the note field (maximum 30 characters). This value is not saved and will not appear in any of your notifications. If omitted, no variable will be passed back to you. "Special instructions (optional):" will be displayed.
cs Optional Sets the background color of your payment pages. If set to "1," the background color will be black. If omitted or set to "0" the background color will be white.
on0 Optional First option field name (maximum 30 characters). If omitted, no variable will be passed back to you.
os0 Optional First set of option value(s). If this option is selected through a text box (or radio button), each value should be no more than 30 characters. If this value is entered by the customer through a text box, there is a 200- character limit. If omitted, no variable will be passed back to you. "on0" must be defined in order for "os1" to be recognized.
on1 Optional Second option field name (maximum 30 characters). If omitted, no variable will be passed back to you.
os1 Optional Second set of option value(s). If this option is selected through a text box (or radio button), each value should be no more than 30 characters. If this value is entered by the customer through a text box, there is a 200- character limit. If omitted, no variable will be passed back to you. "on1" must be defined in order for "os1" to be recognized.
modify Optional Modification behavior. 0 or null = The button allows buyers to only create new subscriptions. 1 = The button allows buyers to modify current subscriptions if they have any and to sign up for new subscriptions if they do not. 2 = The button allows buyers only to modify existing subscriptions according to the other parameters specified by the button and does not allow sign-up for new subscriptions.
page_style Optional Sets the Custom Payment Page Style for payment pages associated with this button/link. The value of page_style is the same as the Page Style Name you chose when adding or editing the page style. You can add and edit Custom Payment Page Styles from the Profile section of the My Account tab. If you would like the button/link to always reference the style you make Primary, set this variable equal to "primary." If you would like the button/link to reference the default PayPal page style, set this variable equal to "paypal." The page_style variable has a maximum length of 30 characters. Valid character set is alphanumeric ASCII lower 7-bit characters only, plus underscore. It cannot include spaces.

HTML Variables for Displaying PayPal Payment Pages

HTML variables for displaying PayPal payment pages control how the pages appear and function.

HTML Variables: Display Information.

Name Description Required or Optional Character Length
cancel_
return
A URL to which the customer's browser is returned if payment is canceled; for example, a URL on your website that displays a "Payment Canceled" page.
Default: Browser is directed to the PayPal website.
Optional
cbt Sets the text for the Continue button on the PayPal Payment Complete page.

Note: The return variable must also be set.
Optional 60
cn Label above the note field. This value is not saved and does not appear in any of your notifications. If omitted, no variable is passed back to you. Optional 40
cpp_header_
image
Sets the image at the top left of the payment page. The image's maximum size is 750 pixels wide by 90 pixels high, and it must be URL-encoded. PayPal recommends that you provide an image that is stored only on a secure server (https). Optional No limit
cpp_
headerback_
color
Sets the background color for the header of the payment page.
Valid value is case-insensitive six-character HTML hexadecimal color code in ASCII.
Optional
cpp_
headerborder_
color
Sets the border color around the header of the payment page.
The border is a two-pixel perimeter around the header space, which has a maximum size of 750 pixels wide by 90 pixels high. Valid value is case-insensitive six-character HTML hexadecimal color code in ASCII.
Optional
cpp_payflow_
color
Sets the background color for the payment page below the header. Valid value is case-insensitive six-character HTML hexadecimal color code in ASCII.

Note: Background colors that conflict with PayPal's error messages are not allowed; in these cases, the default color is white.
Optional
cs Sets the background color of your payment pages.
Default or 0 = background color is white.
1 = background color is black.
Optional
image_url The URL of the 150x50-pixel image displayed as your logo in the upper left corner of PayPal's pages. Must be URL-encoded.
Default: your business name (if you have a Business account) or your email address (if you have Premier account).
Optional
lc Sets the default country and associated language for the login or signup page that buyers see when they click your button. If this variable is absent, the default will be set from the user's cookie, or will be set to the U.S. if there is no cookie. Can be set to any of the countries currently available on PayPal. Optional
no_note Prompt customer to include a note with payment.
Default or 0: customer is prompted to include a note.
1: customer is not prompted to include a note.
Optional 1
no_shipping Prompt customer for shipping address.
Default or 0: customer is prompted to include a shipping address.
1: customer is not asked for a shipping address.
2: customer must provide a shipping address.
Optional 1
page_style Sets the Custom Payment Page Style for payment pages associated with this button/link. Alphanumeric ASCII lower 7-bit characters only, plus underscore. No spaces.
somePageStyleName: The name of a page style you have defined.
primary: always use the page style set as primary.
paypal: use the PayPal default style.
Optional 30
return The URL to which the customer's browser is returned after completing the payment; for example, a URL on your site that displays a "Thank you for your payment" page.
Default: customer is taken to the PayPal website.
Optional
rm Return method GET or POST: the FORM METHOD used to send data to the URL specified by the return variable after payment completion.

Note: The rm variable takes effect only if the return variable is also set.

Default or 0: GET method is used for all Shopping Cart transactions.
1: GET. The customer's browser is redirected to the return URL by the GET method, and no transaction variables are sent.
2: POST. The customer's browser is redirected to the return URL by the POST method, and all transaction variables are also posted.
Optional

HTML Variables for Prepopulating PayPal Payment Pages

HTML variables for prepopulating PayPal payment pages let you specify information about the payer.

HTML Variables for Prepopulating Payment Pages with Buyer Information

Variable Description Requirements Character Limit
address1 Street (1 of 2 fields) Alphanumeric 100
address2 Street (2 of 2 fields) Alphanumeric 100
city City Alphanumeric 40
country Sets shipping and billing country. Alphabetic 2
email Email address, used for new PayPal accounts. Alphanumeric 127
first_name First name Alphabetic 32
last_name Last name Alphabetic 32
night_
phone_a
The area code for U.S. phone numbers, or the country code for phone numbers outside the U.S. This will prepopulate the buyer's home phone number. Numeric  
night_
phone_b
The three-digit prefix for U.S. phone numbers, or the entire phone number for phone numbers outside the U.S., excluding country code. This will prepopulate the buyer's home phone number. Numeric  
night_
phone_c
The four-digit phone number for U.S. phone numbers. This will prepopulate the buyer's home phone number. Numeric 4
state State Must be two-character official U.S. or Canadian abbreviation. 2
zip Postal code Numeric 32