Create Subscription Request

January 21, 2026 ยท View on GitHub

The create subscription request details.

Structure

CreateSubscriptionRequest

Fields

NameTypeTagsDescriptionGetterSetter
PlanIdStringRequiredThe ID of the plan.

Constraints: Minimum Length: 26, Maximum Length: 26, Pattern: ^P-[A-Z0-9]*$
String getPlanId()setPlanId(String planId)
StartTimeStringOptionalThe date and time, in Internet date and time format. Seconds are required while fractional seconds are optional. Note: The regular expression provides guidance but does not reject all invalid dates.

Constraints: Minimum Length: 20, Maximum Length: 64, Pattern: ^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])[T,t]([0-1][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)([.][0-9]+)?([Zz]|[+-][0-9]{2}:[0-9]{2})$
String getStartTime()setStartTime(String startTime)
QuantityStringOptionalThe quantity of the product in the subscription.

Constraints: Minimum Length: 1, Maximum Length: 32, Pattern: ^([0-9]+|([0-9]+)?[.][0-9]+)$
String getQuantity()setQuantity(String quantity)
ShippingAmountMoneyOptionalThe currency and amount for a financial transaction, such as a balance or payment due.Money getShippingAmount()setShippingAmount(Money shippingAmount)
SubscriberSubscriberRequestOptionalThe subscriber request information .SubscriberRequest getSubscriber()setSubscriber(SubscriberRequest subscriber)
AutoRenewalBooleanOptionalDEPRECATED. Indicates whether the subscription auto-renews after the billing cycles complete.

Default: false
Boolean getAutoRenewal()setAutoRenewal(Boolean autoRenewal)
ApplicationContextSubscriptionApplicationContextOptionalDEPRECATED. The application context, which customizes the payer experience during the subscription approval process with PayPal.SubscriptionApplicationContext getApplicationContext()setApplicationContext(SubscriptionApplicationContext applicationContext)
CustomIdStringOptionalThe custom id for the subscription. Can be invoice id.

Constraints: Minimum Length: 1, Maximum Length: 127, Pattern: ^[\x20-\x7E]+
String getCustomId()setCustomId(String customId)
PlanPlanOverrideOptionalAn inline plan object to customise the subscription. You can override plan level default attributes by providing customised values for the subscription in this object.PlanOverride getPlan()setPlan(PlanOverride plan)

Example (as JSON)

{
  "plan_id": "plan_id8",
  "auto_renewal": false,
  "start_time": "start_time0",
  "quantity": "quantity2",
  "shipping_amount": {
    "currency_code": "currency_code0",
    "value": "value6"
  },
  "subscriber": {
    "email_address": "email_address8",
    "payer_id": "payer_id8",
    "name": {
      "given_name": "given_name2",
      "surname": "surname8"
    },
    "shipping_address": {
      "name": {
        "full_name": "full_name6"
      },
      "email_address": "email_address8",
      "phone_number": {
        "country_code": "country_code2",
        "national_number": "national_number6"
      },
      "type": "PICKUP_IN_STORE",
      "options": [
        {
          "id": "id2",
          "label": "label2",
          "type": "SHIPPING",
          "amount": {
            "currency_code": "currency_code6",
            "value": "value0"
          },
          "selected": false
        }
      ]
    },
    "payment_source": {
      "card": {
        "name": "name6",
        "number": "number6",
        "expiry": "expiry4",
        "security_code": "security_code8",
        "type": "UNKNOWN"
      }
    }
  }
}