Fixed and recurring pricing policies not working.

Solved
DanielTehrani
Excursionist
36 1 5


Hi.

 

I would like to create a subscription group that will discount 5% on the initial purchase and 10% from the second billing.

I've set the selling plan group's fixed pricing policy to 5% and set the recurring pricing policy to 10% with afterCycle = 1.

But the subscription is kept billing 5% off the price.

 

Appreciate it if someone could tell me what I'm doing wrong here.

Thanks.

0 Likes
qc11
Shopify Staff
Shopify Staff
12 3 5

Hi,

 

The way you setup the fixed and recurring billing policy sounds all good to me.

 

Would you be able to offer more details in terms of how it's not working:

Is it when you trying to charge your second order or the pricing policy you fetched doesn't match?

0 Likes
DanielTehrani
Excursionist
36 1 5

Hi. Thank you for the reply.

Below is the code that I used to create a selling plan group. The fetched pricing policies are correct, but when I try to charge a second order, the discount percentage of the order doesn't match.

mutation sellingPlanGroupCreate($input: SellingPlanGroupInput!, $resources: SellingPlanGroupResourceInput) {
  sellingPlanGroupCreate(input: $input, resources: $resources) {
    sellingPlanGroup {
      id
    }
    userErrors {
      code
      field
      message
    }
  }
}



{
  "resources": {
    "productIds": [
      "gid://shopify/Product/6132261257366"
    ]
  },
  "input": {
    "name": "test",
    "options": [
      "test-option-1"
    ],
    "sellingPlansToCreate": [
      {
        "options": [
          "test-option-1"
        ],
        "billingPolicy": {
          "recurring": {
            "interval": "MONTH",
            "intervalCount": 1
          }
        },
        "deliveryPolicy": {
          "recurring": {
            "interval": "MONTH",
            "intervalCount": 1
          }
        },
        "name": "selling-plan-test",
        "pricingPolicies": [
          {
            "fixed": {
              "adjustmentType": "PERCENTAGE",
              "adjustmentValue": {
                "percentage": 5
              }
            }
          },
          {
            "recurring": {
              "adjustmentType": "PERCENTAGE",
              "adjustmentValue": {
                "percentage": 10
              },
              "afterCycle": 1
            }
          }
        ]
      }
    ]
  }
}

 

 

0 Likes
EllaBrown2021
Excursionist
77 0 5

Have you solved this problem?

0 Likes
qc11
Shopify Staff
Shopify Staff
12 3 5

Hi,

Just want to make sure: did you try to charge the second order by using `subscriptionBillingAttemptCreate`?

DanielTehrani
Excursionist
36 1 5

Yes.

 

Please tell me if there is any other information you need.

0 Likes
qc11
Shopify Staff
Shopify Staff
12 3 5

This is an accepted solution.

Hi,

I think there might be some misunderstanding in terms of using the price.
Shopify doesn't automatically transition the contract after a cycle. You might still need to update the price of the contract line after the first cycle.

We store the `computedPrice` on the pricing policy where you could fetch and then apply it:

More info please see here:

DanielTehrani
Excursionist
36 1 5

Hi.

That makes sense.
Just want to make sure, should I update the currentPrice of a subscriptionLine, or the discountAllocation using subscriptionDraftDiscountAdd, after the first cycle?

0 Likes
qc11
Shopify Staff
Shopify Staff
12 3 5

Hi,

`SubscriptionCyclePriceAdjustment.computedPrice` should reflect the final price after applying pricing policy. So updating currentPrice with computedPrice would achieve the goal here.

`discountAllocation` works for the cases that any other discount applied on top of the pricing policy price.