JavaScript SDK script configuration

SDKCurrentLast updated: March 10th 2022, @ 3:33:50 pm


The JavaScript SDK displays relevant, PayPal-supported payment methods on your page, giving your buyers a personalized and streamlined checkout experience.

Add the SDK

There are a couple of ways you can integrate the SDK.

  • You can add it in a script tag. This loads the main object paypal to the global window scope of the browser. Replace YOUR_CLIENT_ID with your client ID.

    <script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID"></script>
    

    Note: Load the JavaScript SDK directly from https://www.paypal.com/sdk/js. Don't include it in a bundle or host it yourself. For more information, see Load the JavaScript SDK from the PayPal server.

  • You can use it as a module. Loading the SDK as a module brings certain advantages, especially when working with a JavaScript framework. For example, you can optimize performance because the module lets you control loading behavior in JavaScript instead of HTML. It can also help reduce bugs by encapsulating data.

    • Use the paypal-js npm package to integrate with front-end tools.

      import { loadScript } from "@paypal/paypal-js";
      loadScript({ "client-id": YOUR_CLIENT_ID })
      .then((paypal) => {
          // start to use the PayPal JS SDK script
      })
      .catch((err) => {
          console.error("failed to load the PayPal JS SDK script", err);
      });
      
    • Use the react-paypal-js npm package within the React.js framework.

      // App.js
      import { PayPalScriptProvider } from "@paypal/react-paypal-js";
      export default function App() {
          return (
              <PayPalScriptProvider options={{ "client-id": YOUR_CLIENT_ID }}/>
          );
      }
      

Configure and customize your integration

You can configure and customize your integration by passing query parameters and script parameters in the JavaScript SDK script tag. These parameters personalize your setup and help PayPal decide the optimal funding sources and buttons to show to your buyers.

Query parameters

Query parameters help define specific content or actions based on the data being passed. Each piece of data you send:

  • Is made up of a key-value pair. Keys define the piece of information needed and the value provides that information. The key is separated from the value by an equal sign (=).
  • Is proceeded by a question mark (?) to annotate that a question for a piece of information is being asked.
  • Is followed by an ampersand (&) if you need to provide more than one set at a time.
  • Contains necessary information that PayPal needs to handle your request.

For example, PayPal needs your authorization credentials and where you are to process your request:

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&locale=en_US"></script>

Use these test parameters to see JavaScript SDK results. If you don't pass a parameter, the default value is used.

OptionExample valueDefaultDescription
client-idtestn/aRequired.

Your PayPal REST client ID. This identifies your PayPal account, and determines where any transactions are paid to. While you're testing in sandbox, you can use client-id=sb as a shortcut.
buyer-countryUS, CA, GB, DE, FRautomaticThe buyer country. Available in Sandbox for testing.
committrue, falsetrueSet to true if the transaction is completed on the PayPal review page or false if the amount captured changes after the buyer returns to your site. Not applicable for subscriptions.
Important: If you're integrating with a PayPal API, make sure the commit value you pass in the API call matches the value you pass in the JavaScript call.
componentsbuttonsbuttonsA comma-separated list of components to enable. Defaults to allow checkout buttons. Other components are optional.
currencyUSD, CAD, EURUSDThe currency of the transaction or subscription plan.
debugtrue, falsefalseEnable debug mode for ease of debugging. Do not enable for production traffic.
disable-cardvisanoneDeprecated. Cards to disable from showing in the checkout buttons.
disable-fundingcard, credit, bancontactnoneFunding sources to disallow from showing in the checkout buttons. Do not use this query parameter to disable advanced credit and debit card payments.
enable-fundingvenmo, paylaternoneFunding sources to allow in the checkout buttons.
integration-date2018-11-30automaticThe date of integration. Used to ensure backwards compatibility.
intentcapture, authorize, subscription, tokenizecaptureDetermines whether the funds are captured immediately on checkout or if the buyer authorizes the funds to be captured later.
Important: If you're integrating with a PayPal API, make sure the intent value you pass in the API call matches the value you pass in the JavaScript call.
localeen_US, fr_FR, de_DEautomaticThe locale used to localize any components. PayPal recommends not setting this parameter, as the buyer's locale is automatically set by PayPal.
merchant-idABC123automaticThe merchant for whom you are facilitating a transaction.
vaulttrue, falsefalseSet to true if the transaction sets up a billing agreement or subscription.

Client ID

The client ID identifies the PayPal account that sets up and finalizes transactions. By default, funds from any transactions are settled into this account.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID"></script>

If you are facilitating transactions on behalf of other merchants and capturing funds into their accounts, see merchant ID.

Buyer country

The buyer country determines which funding sources are eligible for a given buyer. Defaults to the buyer's IP geolocation.

Note: Buyer country is valid only in sandbox and you should not pass it in production.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&buyer-country=DE"></script>

Any country that you can pass as a locale is a valid buyer country.

Commit

The commit status of the transaction. Determines whether to show a Pay Now or Continue button in the Checkout flow.

  • Use the Pay Now button when the buyer completes payment on the PayPal review page, for example, digitally-delivered items without shipping costs.
  • Use the Continue button when the buyer completes payment on your site to account for shipping, tax, and other items before submitting the order.

Important: If you're integrating with a PayPal API, make sure the commit value you pass in the API call matches the value you pass in the JavaScript call.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&commit=false"></script>
OptionDescription
trueDefault.
Show a Pay Now button in the PayPal Checkout flow. The final amount does not change after the buyer returns from PayPal to your site.
falseShow a Continue button in the PayPal Checkout flow. The final amount might change after the buyer returns from PayPal to your site, due to shipping, tax, or other fees.

Components

The PayPal components you intend to render on your page. Each component you use must be separated by a comma (,). If you don't pass any components, the default payment buttons component automatically renders all eligible buttons in a single location on your page. Components available to you:

OptionDescription
buttonsPlaces all of the eligible checkout buttons on your page.
marksPresents other funding sources on your page alongside PayPal using Radio Buttons.
messagesDisplays messaging for the most relevant Pay Later offer for every purchase.
funding-eligibilityAllows you to choose the individual payment buttons (methods) you want to display on your web page.
hosted-fieldsShows your own hosted credit and debit card fields.

For example, you want to offer your buyers Pay Later options when they choose PayPal along with other payment options.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&components=buttons,marks,messages="></script>

Currency

The currency for the transaction. Funds are captured into your account in the specified currency. Defaults to USD.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&currency=EUR"></script>
Currency Code
Australian dollar AUD
Brazilian real BRL
Canadian dollar CAD
Czech koruna CZK
Danish krone DKK
Euro EUR
Hong Kong dollar HKD
Hungarian forint HUF
Israeli new shekel ILS
Japanese yen JPY
Malaysian ringgit MYR
Mexican peso MXN
New Taiwan dollar TWD
New Zealand dollar NZD
Norwegian krone NOK
Philippine peso PHP
Polish złoty PLN
Pound sterling GBP
Russian ruble RUB
Singapore dollar SGD
Swedish krona SEK
Swiss franc CHF
Thai baht THB
United States dollar USD

Debug

Set to true to enable debug mode. Debug mode is recommended only for testing and debugging. This causes a significant increase in the size of the script and negative impact performance impact. Defaults to false.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&debug=true"></script>
OptionDescription
trueEnable debug mode.
falseDisable debug mode.

Disable card

This parameter is deprecated. In previous versions of the JavaScript SDK that displayed individual card icons, this parameter disabled specific cards for the transaction. Any cards passed were not displayed in the checkout buttons.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&disable-card=amex,jcb"></script>
OptionDescription
visaVisa
mastercardMastercard
amexAmerican Express
discoverDiscover
jcbJCB
eloElo
hiperHiper

Disable funding

The disabled funding sources for the transaction. Any funding sources passed are not displayed in the checkout buttons. By default, funding source eligibility is determined based on a variety of factors. Do not use this query parameter to disable advanced credit and debit card payments.

Note: Pass credit in disable-funding for merchants that fall into these categories:

  • Real money gaming merchants
  • Non-US merchants who do not have the correct licenses and approvals to display the Credit button
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&disable-funding=credit,card"></script>
OptionDescription
cardCredit or debit cards
creditPayPal Credit (US, UK)
paylaterPay Later (US, UK), Pay in 4 (AU), 4X PayPal (France), Später Bezahlen (Germany)
bancontactBancontact
blikBLIK
epseps
giropaygiropay
idealiDEAL
mercadopagoMercado Pago
mybankMyBank
p24Przelewy24
sepaSEPA-Lastschrift
sofortSofort
venmoVenmo

Enable funding

The enabled funding sources for the transaction. By default, funding source eligibility is determined based on a variety of factors. Enable funding can be used to ensure a funding source is rendered, if eligible.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&enable-funding=venmo"></script>
OptionDescription
cardCredit or debit cards
creditPayPal Credit (US, UK)
paylaterPay Later (US, UK), Pay in 4 (AU), 4X PayPal (France), Paga en 3 plazos (Spain), Paga in 3 rate (Italy), Später Bezahlen (Germany)
venmoVenmo
bancontactBancontact
blikBLIK
epseps
giropaygiropay
idealiDEAL
mercadopagoMercado Pago
mybankMyBank
p24Przelewy24
sepaSEPA-Lastschrift
sofortSofort

Integration date

The integration date of the script, passed as a YYYY-MM-DD value. Defaults to the date when your client ID was created, and if passed, reflects the date that you added the PayPal integration to your site. This parameter ensures backwards compatibility.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&integration-date=2018-11-07"></script>

How this works:

  • Your site automatically gets any backward-compatible changes made to the PayPal script. These changes include:

    • New funding sources
    • Buttons
    • Updated user interfaces
    • Bug fixes
    • Security fixes
    • Performance optimizations
  • You do not need to change integration-date to enable new features.

  • Your site does not get any backward incompatible updates made to the PayPal script after the specified integration-date, or after the date your client-id was created, if you do not pass the integration-date parameter.

  • If your client-id does not change, you can safely omit the integration-date parameter and the PayPal script guarantees backward compatibility.

  • If your client-id changes dynamically, you must pass an integration date, which ensures that no breaking changes are made to your integration. This could be the case if you build a cart app, which enables merchants to dynamically set a client ID to add PayPal to their store.

Intent

The intent for the transaction. This determines whether the funds are captured immediately while the buyer is present on the page. Defaults to capture.

Important: If you're integrating with a PayPal API, make sure the intent value you pass in the API call matches the value you pass in the JavaScript call.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&intent=authorize"></script>
OptionDescription
captureThe funds are captured immediately while the buyer is present on your site.
authorizeThe funds are authorized immediately and then reauthorized or captured later.
subscriptionUsed along with vault=true to specify this is a subscription transaction.
tokenizeUsed along with vault=true and createBillingAgreement() to specify this is a billing (without purchase) transaction.
Intent options when integrating with older APIs

If you're integrating the JavaScript SDK with an older API like the Orders V1 REST API or one of our NVP/SOAP solutions, you can use the following options.

OptionDescription
capture or saleThe funds are captured immediately while the buyer is present on your site. The value you use should match the intent value in the API call.
authorizeThe funds are authorized immediately and then reauthorized or captured later.
orderThe funds are validated without an authorization and you can reauthorize or capture later.

Locale

The locale renders components. By default PayPal detects the correct locale for the buyer based on their geolocation and browser preferences. It is recommended to pass this parameter only if you need the PayPal buttons to render in the same language as the rest of your site.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&locale=fr_FR"></script>

CountryCountry codeLocales
ALBANIAALen_AL
ALGERIADZar_DZ, en_DZ, fr_DZ, es_DZ, zh_DZ
ANDORRAADen_AD, fr_AD, es_AD, zh_AD
ANGOLAAOen_AO, fr_AO, es_AO, zh_AO
ANGUILLAAIen_AI, fr_AI, es_AI, zh_AI
ANTIGUA & BARBUDAAGen_AG, fr_AG, es_AG, zh_AG
ARGENTINAARes_AR, en_AR
ARMENIAAMen_AM, fr_AM, es_AM, zh_AM
ARUBAAWen_AW, fr_AW, es_AW, zh_AW
AUSTRALIAAUen_AU
AUSTRIAATde_AT, en_AT
AZERBAIJANAZen_AZ, fr_AZ, es_AZ, zh_AZ
BAHAMASBSen_BS, fr_BS, es_BS, zh_BS
BAHRAINBHar_BH, en_BH, fr_BH, es_BH, zh_BH
BARBADOSBBen_BB, fr_BB, es_BB, zh_BB
BELARUSBYen_BY
BELGIUMBEen_BE, nl_BE, fr_BE
BELIZEBZen_BZ, es_BZ, fr_BZ, zh_BZ
BENINBJfr_BJ, en_BJ, es_BJ, zh_BJ
BERMUDABMen_BM, fr_BM, es_BM, zh_BM
BHUTANBTen_BT
BOLIVIABOes_BO, en_BO, fr_BO, zh_BO
BOSNIA & HERZEGOVINABAen_BA
BOTSWANABWen_BW, fr_BW, es_BW, zh_BW
BRAZILBRpt_BR, en_BR
BRITISH VIRGIN ISLANDSVGen_VG, fr_VG, es_VG, zh_VG
BRUNEIBNen_BN
BULGARIABGen_BG
BURKINA FASOBFfr_BF, en_BF, es_BF, zh_BF
BURUNDIBIfr_BI, en_BI, es_BI, zh_BI
CAMBODIAKHen_KH
CAMEROONCMfr_CM, en_CM
CANADACAen_CA, fr_CA
CAPE VERDECVen_CV, fr_CV, es_CV, zh_CV
CAYMAN ISLANDSKYen_KY, fr_KY, es_KY, zh_KY
CHADTDfr_TD, en_TD, es_TD, zh_TD
CHILECLes_CL, en_CL, fr_CL, zh_CL
CHINACNzh_CN
COLOMBIACOes_CO, en_CO, fr_CO, zh_CO
COMOROSKMfr_KM, en_KM, es_KM, zh_KM
CONGO-BRAZZAVILLECGen_CG, fr_CG, es_CG, zh_CG
CONGO-KINSHASACDfr_CD, en_CD, es_CD, zh_CD
COOK ISLANDSCKen_CK, fr_CK, es_CK, zh_CK
COSTA RICACRes_CR, en_CR, fr_CR, zh_CR
CÔTE D’IVOIRECIfr_CI, en_CI
CROATIAHRen_HR
CYPRUSCYen_CY
CZECH REPUBLICCZcs_CZ, en_CZ, fr_CZ, es_CZ, zh_CZ
DENMARKDKda_DK, en_DK
DJIBOUTIDJfr_DJ, en_DJ, es_DJ, zh_DJ
DOMINICADMen_DM, fr_DM, es_DM, zh_DM
DOMINICAN REPUBLICDOes_DO, en_DO, fr_DO, zh_DO
ECUADORECes_EC, en_EC, fr_EC, zh_EC
EGYPTEGar_EG, en_EG, fr_EG, es_EG, zh_EG
EL SALVADORSVes_SV, en_SV, fr_SV, zh_SV
ERITREAERen_ER, fr_ER, es_ER, zh_ER
ESTONIAEEen_EE, ru_EE, fr_EE, es_EE, zh_EE
ETHIOPIAETen_ET, fr_ET, es_ET, zh_ET
FALKLAND ISLANDSFKen_FK, fr_FK, es_FK, zh_FK
FAROE ISLANDSFOda_FO, en_FO, fr_FO, es_FO, zh_FO
FIJIFJen_FJ, fr_FJ, es_FJ, zh_FJ
FINLANDFIfi_FI, en_FI, fr_FI, es_FI, zh_FI
FRANCEFRfr_FR, en_FR
FRENCH GUIANAGFen_GF, fr_GF, es_GF, zh_GF
FRENCH POLYNESIAPFen_PF, fr_PF, es_PF, zh_PF
GABONGAfr_GA, en_GA, es_GA, zh_GA
GAMBIAGMen_GM, fr_GM, es_GM, zh_GM
GEORGIAGEen_GE, fr_GE, es_GE, zh_GE
GERMANYDEde_DE, en_DE
GIBRALTARGIen_GI, fr_GI, es_GI, zh_GI
GREECEGRel_GR, en_GR, fr_GR, es_GR, zh_GR
GREENLANDGLda_GL, en_GL, fr_GL, es_GL, zh_GL
GRENADAGDen_GD, fr_GD, es_GD, zh_GD
GUADELOUPEGPen_GP, fr_GP, es_GP, zh_GP
GUATEMALAGTes_GT, en_GT, fr_GT, zh_GT
GUINEAGNfr_GN, en_GN, es_GN, zh_GN
GUINEA - BISSAUGWen_GW, fr_GW, es_GW, zh_GW
GUYANAGYen_GY, fr_GY, es_GY, zh_GY
HONDURASHNes_HN, en_HN, fr_HN, zh_HN
HONG KONG SAR CHINAHKen_HK, zh_HK
HUNGARYHUhu_HU, en_HU, fr_HU, es_HU, zh_HU
ICELANDISen_IS
INDIAINen_IN
INDONESIAIDid_ID, en_ID
IRELANDIEen_IE, fr_IE, es_IE, zh_IE
ISRAELILhe_IL, en_IL
ITALYITit_IT, en_IT
JAMAICAJMen_JM, es_JM, fr_JM, zh_JM
JAPANJPja_JP, en_JP
JORDANJOar_JO, en_JO, fr_JO, es_JO, zh_JO
KAZAKHSTANKZen_KZ, fr_KZ, es_KZ, zh_KZ
KENYAKEen_KE, fr_KE, es_KE, zh_KE
KIRIBATIKIen_KI, fr_KI, es_KI, zh_KI
KUWAITKWar_KW, en_KW, fr_KW, es_KW, zh_KW
KYRGYZSTANKGen_KG, fr_KG, es_KG, zh_KG
LAOSLAen_LA
LATVIALVen_LV, ru_LV, fr_LV, es_LV, zh_LV
LESOTHOLSen_LS, fr_LS, es_LS, zh_LS
LIECHTENSTEINLIen_LI, fr_LI, es_LI, zh_LI
LITHUANIALTen_LT, ru_LT, fr_LT, es_LT, zh_LT
LUXEMBOURGLUen_LU, de_LU, fr_LU, es_LU, zh_LU
MACEDONIAMKen_MK
MADAGASCARMGen_MG, fr_MG, es_MG, zh_MG
MALAWIMWen_MW, fr_MW, es_MW, zh_MW
MALAYSIAMYen_MY
MALDIVESMVen_MV
MALIMLfr_ML, en_ML, es_ML, zh_ML
MALTAMTen_MT
MARSHALL ISLANDSMHen_MH, fr_MH, es_MH, zh_MH
MARTINIQUEMQen_MQ, fr_MQ, es_MQ, zh_MQ
MAURITANIAMRen_MR, fr_MR, es_MR, zh_MR
MAURITIUSMUen_MU, fr_MU, es_MU, zh_MU
MAYOTTEYTen_YT, fr_YT, es_YT, zh_YT
MEXICOMXes_MX, en_MX
MICRONESIAFMen_FM
MOLDOVAMDen_MD
MONACOMCfr_MC, en_MC
MONGOLIAMNen_MN
MONTENEGROMEen_ME
MONTSERRATMSen_MS, fr_MS, es_MS, zh_MS
MOROCCOMAar_MA, en_MA, fr_MA, es_MA, zh_MA
MOZAMBIQUEMZen_MZ, fr_MZ, es_MZ, zh_MZ
NAMIBIANAen_NA, fr_NA, es_NA, zh_NA
NAURUNRen_NR, fr_NR, es_NR, zh_NR
NEPALNPen_NP
NETHERLANDSNLnl_NL, en_NL
NETHERLANDS ANTILLESANen_AN, fr_AN, es_AN, zh_AN
NEW CALEDONIANCen_NC, fr_NC, es_NC, zh_NC
NEW ZEALANDNZen_NZ, fr_NZ, es_NZ, zh_NZ
NICARAGUANIes_NI, en_NI, fr_NI, zh_NI
NIGERNEfr_NE, en_NE, es_NE, zh_NE
NIGERIANGen_NG
NIUENUen_NU, fr_NU, es_NU, zh_NU
NORFOLK ISLANDNFen_NF, fr_NF, es_NF, zh_NF
NORWAYNOno_NO, en_NO
OMANOMar_OM, en_OM, fr_OM, es_OM, zh_OM
PALAUPWen_PW, fr_PW, es_PW, zh_PW
PANAMAPAes_PA, en_PA, fr_PA, zh_PA
PAPAUA NEW GUINEAPGen_PG, fr_PG, es_PG, zh_PG
PARAGUAYPYes_PY, en_PY
PERUPEes_PE, en_PE, fr_PE, zh_PE
PHILIPPINESPHen_PH
PITCAIRN ISLANDSPNen_PN, fr_PN, es_PN, zh_PN
POLANDPLpl_PL, en_PL
PORTUGALPTpt_PT, en_PT
QATARQAen_QA, fr_QA, es_QA, zh_QA, ar_QA
RÉUNIONREen_RE, fr_RE, es_RE, zh_RE
ROMANIAROen_RO, fr_RO, es_RO, zh_RO
RUSSIARUru_RU, en_RU
RWANDARWfr_RW, en_RW, es_RW, zh_RW
SAMOAWSen_WS
SAN MARINOSMen_SM, fr_SM, es_SM, zh_SM
SÃO TOMÉ & PRÍNCIPESTen_ST, fr_ST, es_ST, zh_ST
SAUDI ARABIASAar_SA, en_SA, fr_SA, es_SA, zh_SA
SENEGALSNfr_SN, en_SN, es_SN, zh_SN
SERBIARSen_RS, fr_RS, es_RS, zh_RS
SEYCHELLESSCfr_SC, en_SC, es_SC, zh_SC
SIERRA LEONESLen_SL, fr_SL, es_SL, zh_SL
SINGAPORESGen_SG
SLOVAKIASKsk_SK, en_SK, fr_SK, es_SK, zh_SK
SLOVENIASIen_SI, fr_SI, es_SI, zh_SI
SOLOMON ISLANDSSBen_SB, fr_SB, es_SB, zh_SB
SOMALIASOen_SO, fr_SO, es_SO, zh_SO
SOUTH AFRICAZAen_ZA, fr_ZA, es_ZA, zh_ZA
SOUTH KOREAKRko_KR, en_KR
SPAINESes_ES, en_ES
SRI LANKALKen_LK
ST. HELENASHen_SH, fr_SH, es_SH, zh_SH
ST. KITTS & NEVISKNen_KN, fr_KN, es_KN, zh_KN
ST. LUCIALCen_LC, fr_LC, es_LC, zh_LC
ST. PIERRE & MIQUELONPMen_PM, fr_PM, es_PM, zh_PM
ST. VINCENT & GRENADINESVCen_VC, fr_VC, es_VC, zh_VC
SURINAMESRen_SR, fr_SR, es_SR, zh_SR
SVALBARD & JAN MAYENSJen_SJ, fr_SJ, es_SJ, zh_SJ
SWAZILANDSZen_SZ, fr_SZ, es_SZ, zh_SZ
SWEDENSEsv_SE, en_SE
SWITZERLANDCHde_CH, fr_CH, en_CH
TAIWANTWzh_TW, en_TW
TAJIKISTANTJen_TJ, fr_TJ, es_TJ, zh_TJ
TANZANIATZen_TZ, fr_TZ, es_TZ, zh_TZ
THAILANDTHth_TH, en_TH
TOGOTGfr_TG, en_TG, es_TG, zh_TG
TONGATOen_TO
TRINIDAD & TOBAGOTTen_TT, fr_TT, es_TT, zh_TT
TUNISIATNar_TN, en_TN, fr_TN, es_TN, zh_TN
TURKMENISTANTMen_TM, fr_TM, es_TM, zh_TM
TURKS & CAICOS ISLANDSTCen_TC, fr_TC, es_TC, zh_TC
TUVALUTVen_TV, fr_TV, es_TV, zh_TV
TURKEYTRtr_TR, en_TR
UGANDAUGen_UG, fr_UG, es_UG, zh_UG
UKRAINEUAen_UA, ru_UA, fr_UA, es_UA, zh_UA
UNITED ARAB EMIRATESAEen_AE, fr_AE, es_AE, zh_AE, ar_AE
UNITED KINGDOMGBen_GB
UNITED STATESUSen_US, fr_US, es_US, zh_US
URUGUAYUYes_UY, en_UY, fr_UY, zh_UY
VANUATUVUen_VU, fr_VU, es_VU, zh_VU
VATICAN CITYVAen_VA, fr_VA, es_VA, zh_VA
VENEZUELAVEes_VE, en_VE, fr_VE, zh_VE
VIETNAMVNen_VN
WALLIS & FUTUNAWFen_WF, fr_WF, es_WF, zh_WF
YEMENYEar_YE, en_YE, fr_YE, es_YE, zh_YE
ZAMBIAZMen_ZM, fr_ZM, es_ZM, zh_ZM
ZIMBABWEZWen_ZW

Merchant ID

The merchant ID of a merchant for whom you are facilitating a transaction.

Use this parameter only for partner, marketplaces, and cart solutions when you are acting on behalf of another merchant to facilitate their PayPal transactions. This parameter is essential to guarantee the merchant sees the best possible combination of PayPal buttons.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&merchant-id=XXX"></script>
IntegrationUse caseClient IDMerchant IDOther
Standalone integrationI am capturing funds directly into my PayPal account.Pass a client ID associated with your account.Do not pass merchant ID (it is automatically derived).
Partner or Marketplace integrationI am facilitating payments on behalf of other merchants.Pass a client ID associated with your partner or marketplace account.You must pass the merchant ID of the merchant for whom you are facilitating payments.
Cart integrationI am facilitating payments on behalf of other merchants and I have the client IDs for those merchants.Pass the client ID of the merchant for whom you are facilitating payments.Do not pass a merchant ID.Pass the integration date parameter to ensure your integration does not break as new client IDs onboard to your site.

Vault

The vault status of the transaction. Vaulting allows you to store your customers' payment information for billing agreements, subscriptions, or recurring payments.

Note: Not all payment methods can be vaulted.

If the vault status is set to true:

  • It shows only the funding source you can add to the vault.
  • Sets up a billing agreement, reference transaction, or subscription.

Defaults to false.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID&vault=true"></script>
OptionDescription
trueShow only funding sources that you can vault or use to create a billing agreement, subscription, or recurring payment.
falseShow all funding sources.

Script parameters

Script parameters are additional key value pairs you can add to the script tag to provide information you need for your site to work, a nonce, or information you'd like to capture on a page for analytics reasons.

For example, a token that identifies your buyer:

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID" data-client-token="abc123xyz=="></script>
OptionDescription
data-csp-nonceCSP nonce used for rendering the button.
data-client-tokenClient token used for identifying your buyers.
data-page-typeLog page type and interactions for the JavaScript SDK.
data-partner-attribution-idPartner attribution ID used for revenue attribution.

CSP nonce

Pass a Content Security Policy nonce, a one time authorization code or token, if you use them on your site. See Content Security Policy for details.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID" data-csp-nonce="MY_CSP_NONCE"></script>

Client token

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID" data-client-token="abc123xyz=="></script>

Page type

Pass a page type to log the type of page where the JavaScript SDK loads and any interactions with the components you use. This attribute accepts these page types: product-listing, search-results, product-details, mini-cart, cart or checkout as values.

<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID" data-page-type="product-details"></script>

Partner attribution ID

Pass your partner attribution ID, or build notation (BN) code, to receive revenue attribution. Your BN code is issued to you as part of the partner onboarding process and provides tracking on all transactions that originate or are associated with you. To find your BN code:

  1. Log in to the Developer Dashboard with your PayPal account.
  2. In the left-hand navigation menu, select My Apps & Credentials.
  3. Select your app.
  4. Under App Settings, find your BN code.
<script src="https://www.paypal.com/sdk/js?client-id=YOUR_CLIENT_ID" data-partner-attribution-id="MY_PARTNER_ATTRIBUTION_ID"></script>

See also