Experience Context
June 5, 2026 ยท View on GitHub
Customizes the payer experience during the approval process for the payment.
Structure
ExperienceContext
Fields
| Name | Type | Tags | Description | Getter | Setter |
|---|---|---|---|---|---|
BrandName | String | Optional | The label that overrides the business name in the PayPal account on the PayPal site. The pattern is defined by an external party and supports Unicode. Constraints: Minimum Length: 1, Maximum Length: 127, Pattern: ^.*$ | String getBrandName() | setBrandName(String brandName) |
Locale | String | Optional | The language tag for the language in which to localize the error-related strings, such as messages, issues, and suggested actions. The tag is made up of the ISO 639-2 language code, the optional ISO-15924 script tag, and the ISO-3166 alpha-2 country code or M49 region code. Constraints: Minimum Length: 2, Maximum Length: 10, Pattern: ^[a-z]{2}(?:-[A-Z][a-z]{3})?(?:-(?:[A-Z]{2}|[0-9]{3}))?$ | String getLocale() | setLocale(String locale) |
ShippingPreference | ExperienceContextShippingPreference | Optional | The location from which the shipping address is derived. Default: ExperienceContextShippingPreference.GET_FROM_FILEConstraints: Minimum Length: 1, Maximum Length: 24, Pattern: ^[A-Z_]+$ | ExperienceContextShippingPreference getShippingPreference() | setShippingPreference(ExperienceContextShippingPreference shippingPreference) |
ReturnUrl | String | Optional | Describes the URL. | String getReturnUrl() | setReturnUrl(String returnUrl) |
CancelUrl | String | Optional | Describes the URL. | String getCancelUrl() | setCancelUrl(String cancelUrl) |
Example (as JSON)
{
"shipping_preference": "GET_FROM_FILE",
"brand_name": "brand_name0",
"locale": "locale4",
"return_url": "return_url2",
"cancel_url": "cancel_url4"
}