Subscription Application Context
November 13, 2025 ยท View on GitHub
The application context, which customizes the payer experience during the subscription approval process with PayPal.
Structure
SubscriptionApplicationContext
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. Constraints: Minimum Length: 1, Maximum Length: 127, Pattern: ^.*$ | String getBrandName() | setBrandName(String brandName) |
Locale | String | Optional | The BCP 47-formatted locale of pages that the PayPal payment experience shows. PayPal supports a five-character code. For example, da-DK, he-IL, id-ID, ja-JP, no-NO, pt-BR, ru-RU, sv-SE, th-TH, zh-CN, zh-HK, or zh-TW.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) |
UserAction | ApplicationContextUserAction | Optional | Configures the label name to Continue or Subscribe Now for subscription consent experience.Default: ApplicationContextUserAction.SUBSCRIBE_NOWConstraints: Minimum Length: 1, Maximum Length: 24, Pattern: ^[A-Z_]+$ | ApplicationContextUserAction getUserAction() | setUserAction(ApplicationContextUserAction userAction) |
PaymentMethod | PaymentMethod | Optional | The customer and merchant payment preferences. | PaymentMethod getPaymentMethod() | setPaymentMethod(PaymentMethod paymentMethod) |
ReturnUrl | String | Required | The URL where the customer is redirected after the customer approves the payment. Constraints: Minimum Length: 10, Maximum Length: 4000 | String getReturnUrl() | setReturnUrl(String returnUrl) |
CancelUrl | String | Required | The URL where the customer is redirected after the customer cancels the payment. Constraints: Minimum Length: 10, Maximum Length: 4000 | String getCancelUrl() | setCancelUrl(String cancelUrl) |
Example (as JSON)
{
"shipping_preference": "GET_FROM_FILE",
"user_action": "SUBSCRIBE_NOW",
"return_url": "return_url0",
"cancel_url": "cancel_url2",
"brand_name": "brand_name8",
"locale": "locale2",
"payment_method": {
"payee_preferred": "UNRESTRICTED"
}
}