Subscriptions in Payment Link Orders and discounts

I have a few questions regarding the way subscriptions, payment links, and discounts work together. My end goal is to be able to include discounts in the payment link for the subscription plan.

First, can you create a payment link with a subscription plan in the order? I am able to create a payment link order with a subscription_plan_id in the checkout_options and a singular line item with a base_price_money, but I’m not sure that it will work. My fear is the the subscription and the order are not actually linked properly in the request. Here’s an example of the payment link body request I’m talking about:

My next question is if this payment link order is properly linked to the order, does the discount in the order apply to the first payment, the first phase, or all phases?

Finally, if it isn’t possible to create a payment link for a subscription plan with a discount, is the only way to discount a subscription plan to create a new variation?

Thanks,
Tim

At this time creating a link with the subscription plan in the order isn’t currently available. When the link is created you’ll be creating the subscription for the line item in the order.

The discount will apply to all the phases. If you’d like the discount to apply to only one phase of the subscription you’ll want to add it to the subscription instead of the order. For example:

{
    "idempotency_key": "{UNIQUE_KEY}",
    "object": {
      "type": "SUBSCRIPTION_PLAN_VARIATION",
      "id": "#1",
      "subscription_plan_variation_data": {
        "name": "Coffee of the Month Club",
        "phases": [
          {
            "cadence": "MONTHLY",
            "ordinal": 0,
            "periods": 1,
            "pricing": {
              "type": "STATIC",
              "price": {
                "amount": 1000,
                "currency": "USD"
              }
            }
          },
          {
            "cadence": "MONTHLY",
            "ordinal": 1,
            "pricing": {
              "type": "RELATIVE",
              "discount_ids": [
                "5PFBH6YH5SB2F63FOIHJ7HWR"
              ]
            }
          }
        ],
        "subscription_plan_id": "VVH3YXQSQATSL3XR4LIKD3QM"
      }
    }
  }

:slightly_smiling_face: