HTML Variables for PayPal Payments Standard
Last updated: Sept 19th, 1:49am
PayPal Payments Standard payment buttons and the Cart Upload command support the following HTML variables.
Technical variables
Technical HTML variables control how PayPal responds technically when people click PayPal payment buttons or when third-party shopping carts or solution providers initiate payment processing with the Cart Upload command. They also control how your buttons interact with special PayPal features.
1<img src="https://www.paypalobjects.com/webstatic/en_US/i/btn/png/btn_buynow_107x26.png" alt="Buy Now" />
cmd value |
Description |
---|---|
_xclick |
The button that the person clicked was a Buy Now button. |
_cart |
For shopping cart purchases. The following variables specify the kind of shopping cart button that the person clicked:
|
_xclick-subscriptions |
The button that the person clicked was a Subscribe button. |
_xclick-auto-billing |
The button that the person clicked was an Automatic Billing 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, or the button was saved in the merchant's PayPal account. PayPal determines which kind of button was clicked by decoding the encrypted code or by looking up the saved button in the merchant's account. |
Name | Description |
---|---|
notify_url Optional
|
The URL to which PayPal posts information about the payment, in the form of Instant Payment Notification messages.Character Length: 255 |
hosted_button_id Requirement exception
Required for buttons that have been saved in PayPal accounts. Otherwise, not allowed. |
The ID of the button that was saved in a merchant's PayPal account. PayPal assigns the value when payment buttons are first created and saved in merchants' PayPal accounts. |
bn Optional
|
An identifier of the source that built the code for the button that the buyer clicked, sometimes known as the build notation. Specify a value using the following format: Company_Service_Product_Country
Substitute
Substitute
Substitute For example, a Buy Now button on your website that you coded yourself might have the following line of code: bn="DesignerFotos_BuyNow_WPS_US"
|
Individual items variables
These individual item variables specify information about a product or service for Buy Now and Add to Cart buttons, or they specify information about a contribution for Donate buttons.
Name | Description |
---|---|
amount See description for requirement
|
The price or amount of the product, service, or contribution, not including shipping, handling, or tax. If you omit this variable from Buy Now or Donate buttons, buyers enter their own amount at the time of payment.
|
discount_amount Optional
|
Discount amount associated with an item, which must be less than the
selling price of the item. If you specify
Valid only for Buy Now and Add to Cart buttons. |
discount_amount2 Optional
|
Discount amount associated with each additional quantity of the item,
which must be equal to or less than the selling price of the item. For
Valid only for Buy Now and Add to Cart buttons. |
discount_rate Optional
|
Discount rate, as a percentage, associated with an item.
Set to a value less than 100. If you do not set
Valid only for Buy Now and Add to Cart buttons. |
discount_rate2 Optional
|
Discount rate, as a percentage, associated with each additional quantity of the item.
Must be equal to or less than Valid only for Buy Now and Add to Cart buttons. |
discount_num Optional
|
Number of additional quantities of the item to which the discount applies.
Applicable when you specify Valid only for Buy Now and Add to Cart buttons. |
item_name See description for requirement
|
Description of item. If you omit this variable, buyers enter their own name during checkout.
|
item_number See description for requirement
|
Pass-through variable for you to track product or service purchased or the contribution made. The value you specify is passed back to you upon payment completion. Required if you want PayPal to track either inventory or profit and loss for the item the button sells.Character length: 127 |
quantity Optional
|
Number of items. If profile-based shipping rates are configured with a
basis of quantity, the sum of |
shipping Optional
|
The cost of shipping this item. If you specify
This By default, if profile-based shipping rates are configured, buyers are charged an amount according to the shipping methods they choose. |
shipping2 Optional
|
The cost of shipping each additional unit of this item. If you omit this variable and profile-based shipping rates are configured, buyers are charged an amount according to the shipping methods they choose.
This |
tax Optional
|
Transaction-based tax override variable. Set this variable to a flat tax amount to apply to the payment regardless of the buyer's location. This value overrides any tax settings set in your account profile. Valid only for Buy Now and Add to Cart buttons. By default, profile tax settings, if any, apply. |
tax_rate Optional
|
Transaction-based tax override variable. Set this variable to a
percentage that applies to the |
undefined_quantity Optional
|
Enables buyers to specify the quantity. For example,
|
weight Optional
|
Weight of items. If profile-based shipping rates are configured with a
basis of weight, the sum of A valid value is a decimal number with two significant digits to the right of the decimal point. |
weight_unit Optional
|
The unit of measure if Default is |
on0 Optional
|
First option field name and label. The
|
on1 Optional
|
Second option field name and label. The
You can specify a maximum of 7 option field names (6 with Subscribe
buttons) by incrementing the option name index (
|
os0 Optional
|
Option selection of the buyer for the first option field,
For priced options, include the price and currency symbol in the text of the option selections:
Add a corresponding
|
os1 Optional
|
Option selection of the buyer for the second option field, on1. If the option field is a dropdown menu or a set of radio buttons, each valid value is no more than 64 characters. If buyers enter this value in a text field, the maximum value is 200 characters long.
You can specify a maximum of seven option selections (6 with Subscribe
buttons) by incrementing the option selection index (
|
option_index See description for requirements
|
The cardinal number of the option field,
Default is |
option_select0 Optional
|
For priced options, the value of the first option selection of the
|
option_amount0 Optional
|
For priced options, the amount that you want to charge for the first
option selection of the
|
option_select1 Optional
|
For priced options, the value of the second option selection of the
You can specify a maximum of 10 option selections by incrementing the
option selection index (
|
option_amount1 Optional
|
For priced options, the amount that you want to charge for the second
option selection of the
You can specify a maximum of 10 option amounts by incrementing the
option amount index (
|
Payment transaction variables
Payment transaction variables provide information about entire payments, regardless of the individual items involved with the payment. You can use these variables with Add to Cart buttons and the Cart Upload command.
Name | Description |
---|---|
address_override Optional
|
For more information, see the Auto-fill PayPal checkout page variables. Character Length: 1 |
currency_code Optional
|
The currency of the payment. Default is For valid values, see Currencies Supported by PayPal. Character Length: 3 |
custom Optional
|
Pass-through variable for your own tracking purposes, which buyers do not see. By default, no variable is passed back to you. Character Length: 256 |
handling Optional
|
Handling charges. This variable is not quantity-specific. The same handling cost applies, regardless of the number of items on the order. By default, no handling charges are included. |
invoice Optional
|
Pass-through variable you can use to identify your invoice number for this purchase. By default, no variable is passed back to you. Character Length: 127 |
tax_cart Optional
|
Cart-wide tax, overriding any individual item
tax_x value
|
weight_cart Optional
|
If profile-based shipping rates are configured with a basis of weight,
PayPal uses this value to calculate the shipping charges for the
payment. This value overrides the A valid value is a decimal number with two significant digits to the right of the decimal point. |
weight_unit Optional
|
The unit of measure if Default is |
Shopping cart variables
Use these shopping carts variables with Add to Cart buttons, as well as with third-party shopping carts or custom carts that initiate payment processing with the Cart Upload command.
Name | Description |
---|---|
add See description for requirements
|
Add an item to the PayPal Shopping Cart. Set this variable, as follows: add="1"
Alternatively, use the
If you specify both |
amount_ Required
|
The amount associated with item Applies only to the Cart Upload command. |
business Required
|
Your PayPal ID or an email address associated with your PayPal account. Email addresses must be confirmed. |
discount_amount_cart Optional
|
Single discount amount charged cart-wide.
It must be less than the selling price of all items combined in the
cart. This variable overrides any individual item
Applies only to the Cart Upload command. |
discount_amount_x Optional
|
The discount amount associated with item It must be less than the selling price of the associated item. This amount is added to any other item discounts in the cart. Applies only to the Cart Upload command. |
discount_rate_cart Optional
|
Single Discount rate, as a percentage, to be charged cart-wide.
Set to a value less than 100. The variable overrides any individual
item Applies only to the Cart Upload command. |
discount_rate_x Optional
|
The discount rate associated with item
Set to a value less than 100. The variable takes into account all
quantities of item Applies only to the Cart Upload command. |
display See description for requirements
|
Display the contents of the PayPal Shopping Cart to the buyer. This variable must be set as follows: display="1"
The alternative is the
If both |
handling_cart Optional
|
Single handling fee charged cart-wide. If handling_cart is
used in multiple Add to Cart buttons, the
handling_cart value of the first item is used.
|
item_name_x Required
|
The name associated with item Applies only to the Cart Upload command. |
paymentaction Optional
|
Indicates whether the payment is a final sale or an authorization for a final sale, to be captured later.
Valid value is
Default is |
quantity_x Optional
|
The quantity associated with item x that is
uploaded from a shopping cart. To pass an aggregate quantity for the
entire cart, use quantity_1 .
|
shopping_url Optional
|
The URL of the page on the merchant website that buyers go to when they click the Continue Shopping button on the PayPal Shopping Cart page. For more information see Continue shopping on current the merchant web page. |
upload See description for requirements
|
Upload the contents of a third-party shopping cart or a custom shopping cart. Set this variable as follows: upload="1"
Alternatively, use the |
Recurring payment variables
Recurring payments variables set terms for different PayPal automatic payment plans. Recurring payment buttons are:
- Subscribe
- Automatic Billing
Name | Description |
---|---|
business Required
|
Your PayPal ID or an email address associated with your PayPal account. Email addresses must be confirmed. |
item_name Optional
|
Description of item being sold. If you are collecting aggregate
payments, the value can be a summary of all items purchased, a tracking
number, or a generic term such as, subscription . If you
omit this variable, buyers see a field in which they can enter the item
name.Character Length: 127
|
currency_code Optional
|
The currency of prices for trial periods and the subscription. Default
is For valid values, see Currencies Supported by PayPal. Character Length: 3 |
a1 Optional
|
Trial period 1 price. For a free trial period, specify 0 .
|
p1 See description for requirements
|
Trial period 1 duration. Required if you specify a1 .
Specify an integer value in the valid range for the units of duration
that you specify with t1 .Character Length: 2
|
t1 Required if you specify a1
|
Trial period 1 units of duration. Valid value is:
|
a2 Optional
|
Trial period 2 price. Can be specified only if you also specify
a1 .
|
p2 See description for requirements
|
Trial period 2 duration. Required if you specify a2 .
Specify an integer value in the valid range for the units of duration
that you specify with t2 .Character Length: 2
|
t2 See description for requirements
|
Trial period 2 units of duration. Valid value is:
|
a3 Required
|
Regular subscription price. |
p3 Required
|
Subscription duration. Specify an integer value in the Valid range for
the units of duration that you specify with t3 .Character Length: 2
|
t3 Required
|
Regular subscription units of duration. Valid value is:
|
src Optional
|
Recurring payments. Subscription payments recur unless subscribers
cancel their subscriptions before the end of the current billing cycle
or you limit the number of times that payments recur with the value
that you specify for Valid value is:
Default is 0. Character Length: 1 |
srt Optional
|
Recurring times. Number of times that subscription payments recur.
Specify an integer with a minimum value of 2 and a maximum value of 52.
Valid only if you specify src="1" .Character Length: 1
|
sra Optional
|
Reattempt on failure. If a recurring payment fails, PayPal attempts to collect the payment two more times before canceling the subscription. Valid value is:
Default is For more information, see Reattempting Failed Recurring Payments with Subscribe Buttons. Character Length: 1 |
no_note Required
|
Do not prompt buyers to include a note with their payments. Valid value is from Subscribe buttons:
For Subscribe buttons, always set |
custom Optional
|
User-defined field which PayPal passes through the system and returns to you in your merchant payment notification email. Subscribers do not see this field.Character Length: 255 |
invoice Optional
|
User-defined field which must be unique with each subscription. The invoice number is shown to subscribers with the other details of their paymentsCharacter Length: 127 |
Name | Description |
---|---|
set_customer_limit Required
|
Specify whether to let buyers enter maximum billing limits in a text box or choose from a list of maximum billing limits that you specify. Valid value is:
|
min_amount Optional
|
The minimum monthly billing limit, if you have one. Valid only if
set_customer_limit = max_limit_own .
|
PayPal checkout page variables
These variables control how PayPal checkout pages appear and function.
Name | Description |
---|---|
image_url Optional
|
The URL of the 150x50-pixel image displayed as your logo in the upper left corner of the PayPal checkout pages. Default is your business name, if you have a PayPal Business account or your email address, if you have PayPal Premier or Personal account. Character Length: 1,024 |
lc Optional
|
The locale of the checkout login or sign-up page. PayPal provides localized checkout pages for some countries and languages. For more information about locale codes and a list of supported locales, see the PayPal locale codes reference page. Character Length: 5 |
no_shipping Optional
|
Do not prompt buyers for a shipping address. Valid value is:
Default is |
return Optional
|
The URL to which PayPal redirects buyers' browser after they complete their payments. For example, specify a URL on your site that displays a thank you for your payment page. By default, PayPal redirects the browser to a PayPal webpage. Character Length: 1,024 |
rm Optional
|
Return method. The Valid value is:
Default is
Character Length: 1
|
cancel_return Optional
|
A URL to which PayPal redirects the buyers' browsers if they cancel checkout before completing their payments. For example, specify a URL on your website that displays the Payment Canceled page. By default, PayPal redirects the browser to a PayPal webpage. Character Length: 1,024 |
Auto-fill PayPal checkout page variables
HTML variables for filling out PayPal checkout pages automatically let you specify information about buyers. PayPal recommends that you include automatic fill-out variables with all of your payment buttons for consistent address handling in the checkout experience of your buyers. To determine how the checkout experience varies if you do not pass in automatic fill-out variables, see Address Handling (U.S. Merchants Only).
Name | Description |
---|---|
address1 Optional
|
Street (1 of 2 fields)Character Length: 100 |
address2 Optional
|
Street (2 of 2 fields)Character Length: 100 |
city Optional
|
CityCharacter Length: 40 |
country Optional
|
Sets shipping and billing country. For valid values, see Country and Region Codes. Character Length: 2 |
email Optional
|
Email addressCharacter Length: 127 |
first_name Optional
|
First nameCharacter Length: 32 |
last_name Optional
|
Last nameCharacter Length: 32 |
lc Optional
|
Sets the language for the billing information/log-in page only.
Default is For valid values, see Countries and Regions Supported by PayPal. Character Length: 2 |
charset Optional
|
Sets the character set and character encoding for the billing information/log-in page on the PayPal website. In addition, this variable sets the same values for information that you send to PayPal in your HTML button code. Default is based on the language encoding settings in your account profile. For valid values, see Setting the Character Set — charset. |
night_phone_a Optional
|
The area code for U.S. phone numbers, or the country code for phone numbers outside the U.S. PayPal fills in the buyer's home phone number automatically.see above |
night_phone_b Optional
|
The three-digit prefix for U.S. phone numbers, or the entire phone number for phone numbers outside the U.S., excluding country code. PayPal fills in the buyer's home phone number automatically.see above |
night_phone_c Optional
|
The four-digit phone number for U.S. phone numbers. PayPal fills in the buyer's home phone number automatically.see above |
state Optional
|
U.S. state. For valid values, see PayPal state and province codes. Character Length: 2 |
zip Optional
|
Postal code.Character Length: 32 |
Instant Update API variables
Set up the Cart Upload command for the Instant Update API callback. Establish your own Instant Update callback server before you use these variables. HTML variables for the Instant Update API set up the Cart Upload command for the Instant Update API callback. Establish your own Instant Update callback server before you use these variables.
Set up a payment for the Instant Update API
Some Instant Update variables set up the Cart Upload to use your callback server. Include the following required variables in the Cart Upload command to have PayPal send Instant Update requests to your callback server. Include the following optional variables when appropriate.
Name | Description |
---|---|
callback_url Required
|
The URL of your Instant Update callback serverCharacter Length: 1024 |
callback_timeout Required
|
The timeout in seconds for callback responses from your Instant Update callback server. After exceeding the timeout, PayPal uses the fallback values on the Review Your Payment page for tax, shipping, and insurance.
Valid value is from
Character Length: 1
|
callback_version Required
|
The version of the Instant Update API that your callback server uses. |
fallback_tax_amount Optional
|
Tax amount to use as a fallback, if the callback response times out |
fallback_shipping_option_name_x Required
|
Name and label of shipping option
Include one instance of this variable, with its index (
A valid value for |
fallback_shipping_option_amount_x Required
|
Shipping amount for option
Valid value for |
fallback_shipping_option_is_default_x Required
|
Indicates that shipping option
Only one shipping option can be the default for buyers. Check that you
set one instance only of
Valid value is:
Valid value for |
fallback_insurance_option_offered Optional
|
Indicates that insurance is offered and consumers can opt in to the
insurance during checkout. PayPal ignores this variable if you omit
Valid value is:
|
fallback_insurance_amount Optional
|
Insurance amount to use as a fallback, if the callback response times
out. Include the fallback_insurance_option_offered HTML
variable if you specify an insurance amount. The fallback insurance
amount applies to all shipping options that you specify.
|
Instant update variables for dimensions of individual items
Shipping charges are calculated sometimes by using the dimensions of individual items in the shopping cart. Include the following optional dimensional variables below in the Cart Upload command to provide the information to your callback server.
Name | Description |
---|---|
height_x Optional
|
Height of item A valid value is a positive integer. |
height_unit Optional
|
Unit of measure for the values specified by
A valid value is any value that you choose. PayPal passes the value to your callback server in callback requests. |
width_x Optional
|
Width of item A valid value is a positive integer. |
width_unit Optional
|
Unit of measure for the value specified by
A valid value is any value that you choose. PayPal passes the value to your callback server in callback requests. |
length_x Optional
|
Length of item Valid value is a positive integer. |
length_unit Optional
|
Unit of measure for the value specified by
Valid value is any value that you choose. PayPal passes the value to your callback server in callback requests. |
Deprecated variables
The following variables have been deprecated. Deprecated variables are ignored when you pass them to PayPal.
Name | Description | Deprecation date |
---|---|---|
cbt Optional
|
Sets the text for the Return to Merchant button on the PayPal Payment
Complete page. For Business accounts, the return button displays your
business name in place of
Character Length: 60
|
Dec. 2016 |
cn Optional
|
Related to the no_note variable. When
no_note is 0 , a text box is displayed at
checkout for buyers who would like to include any special instructions.
Use the cn field to enter a custom note or label for this
text box, such as, Enter any special instructions: .Character Length: 40
|
Sept. 2016 |
cpp_cart_border_color Optional
|
The HTML hex code for your principal identifying color. PayPal blends your color to white in a gradient fill that borders the cart review area of the PayPal checkout user interface. Valid value is 6 single-byte hexadecimal characters that represent an HTML hex code for a color.
|
Sept. 2016 |
cpp_header_image Optional
|
The image at the top left of the checkout page. The image's maximum size is 750 pixels wide by 90 pixels high. PayPal recommends that you provide an image that is stored only on a secure (https) server. For more information, see Customize PayPal Checkout Pages in the Merchant Setup and Administration Guide. Deprecated for Buy Now and Add to Cart buttons and the Cart Upload command. Character Length: No limit |
Sept. 2016 |
cpp_headerback_color Optional
|
The background color for the header of the checkout page. Valid value is case-insensitive six-character, HTML hexadecimal color code in ASCII. Deprecated for Buy Now and Add to Cart buttons and the Cart Upload command. Character Length: 6 |
Sept. 2016 |
cpp_headerborder_color Optional
|
The border color around the header of the checkout page. The border is a 2-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. Deprecated for Buy Now and Add to Cart buttons and the Cart Upload command. Character Length: 6 |
Sept. 2016 |
cpp_logo_image Optional
|
A URL to your logo image. Use a valid graphics format, such as
Valid value is 127 single-byte alphanumeric characters.
|
Sept. 2016 |
cpp_payflow_color Optional
|
The background color for the checkout page below the header. Valid value is case-insensitive six-character, HTML hexadecimal color code in ASCII. Deprecated for Buy Now and Add to Cart buttons and the Cart Upload command. Character Length: 6 |
Sept. 2016 |
max_text Optional
|
A description of the automatic billing plan. The Create a PayPal payment
button page uses the same value that you enter in the Description field.
Your button passes the description to PayPal to augment the item name in
authorization notices and transaction details. If you write the HTML
code for your button manually, the value of max_text and
the text above the button can differ.
|
Sept. 2016 |
modify Optional
|
Modification behavior. Valid value is:
Deprecation behavior: The |
March 15, 2019 for modify=1 and modify=2
|
no_note Optional
|
Do not prompt buyers to include a note with their payments. Valid value is:
Default is |
Sept. 2016 |
page_style Optional
|
The custom payment page style for checkout pages. Valid value is:
Default is |
Sept. 2016 |
_oe-gift-certificate Optional
|
The button that the person clicked was a Buy Gift Certificate button. |
Feb. 1, 2017 |
usr_manage Optional
|
Set to For more information, see Generate Subscriber User Names and Passwords. Character Length: 1 |
March 15, 2019 |