Query and script parameters

Pass aditional data to PayPal to further configure your integration.

Overview

You can include the optional queryParams and scriptParams options in the paypalConfig to personalise your setup and help PayPal determine which funding sources and buttons to display to your shoppers.

Query parameters help define specific content or actions based on the data being passed, while script parameters allow you to provide information you need for your site to work, a single-use token, or information you'd like to capture on a page for analytics reasons.

Query parameters

{
  queryParams: {
    buyerCountry: "string",
    debug: boolean,
    integrationDate: "string",
    merchantId: "string"
}

Property

Description

queryParams
object

Details about the optional query parameters.

queryParams.buyerCountry
string

The country code for the buyer's country, in ISO-3166-1 alpha-2 format. This determines the eligible funding sources for a given buyer. Any country that you can pass as a locale is a valid buyer country. Defaults to the buyer's IP geolocation.

Note: buyerCountry is only used in the sandbox. Don't pass this query parameter in production.

queryParams.debug
boolean

Whether to use debug mode. Debug mode is recommended only for testing and debugging, because it increases the size of the script and negatively impacts performance. Defaults to false.

queryParams.integrationDate
string

The date when your PayPal client ID was created (YYYY-MM-DD). This helps the PayPal script automatically apply any backward-compatible updates introduced after that date.

queryParams.merchantId
string

The merchant ID of the merchant for whom you're 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.

Script parameters

{
  scriptParams: {
    cspNonce: "string",
    clientToken: "string",
    pageType: "string",
    userIdToken: "string"
  }
}

Parameter

Description

scriptParams
object

Details about the optional script parameters.

scriptParams.cspNonce
string

A single-use Content Security Policy (CSP) token, if you use them on your site.

scriptParams.clientToken
string

The client token used to identify your shoppers.

scriptParams.pageType
string (enum)

The type of page. Use this to log page type and interactions.

Possible values:

  • product-listing
  • search-results
  • product-details
  • mini-cart
  • cart
  • checkout

scriptParams.userIdToken
string

Your user ID token.

Example

{
  queryParams: {
    buyerCountry: "US",
    debug: false,
    integrationDate: "2025-07-01",
    merchantId: "ABC123"
  },
  scriptParams: {
    cspNonce: "YOUR_CSP_NONCE",
    clientToken: "abc123xyz==",
    pageType: "checkout",
    userIdToken: "YOUR_USER_ID_TOKEN"
  }
}