Solved

Fixed and recurring pricing policies not working.

d_tehrani
Shopify Partner
56 1 13


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.

Accepted Solution (1)
qc11
Shopify Staff (Retired)
47 14 12

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:

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 9 (9)

qc11
Shopify Staff (Retired)
47 14 12

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?

To learn more visit the Shopify Help Center or the Community Blog.

d_tehrani
Shopify Partner
56 1 13

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
            }
          }
        ]
      }
    ]
  }
}

 

 

qc11
Shopify Staff (Retired)
47 14 12

Hi,

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

To learn more visit the Shopify Help Center or the Community Blog.

d_tehrani
Shopify Partner
56 1 13

Yes.

 

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

qc11
Shopify Staff (Retired)
47 14 12

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:

To learn more visit the Shopify Help Center or the Community Blog.

d_tehrani
Shopify Partner
56 1 13

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?

qc11
Shopify Staff (Retired)
47 14 12

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.

To learn more visit the Shopify Help Center or the Community Blog.

nhsanga12
Shopify Partner
1 0 0

Hi @qc11, I got the same issue with @d_tehrani. This is the pricingPolicy values of subscription contract.

pricingPolicy [
      {
        afterCycle: 0,
        adjustmentType: 'PERCENTAGE',
        adjustmentValue: {
          __typename: 'SellingPlanPricingPolicyPercentageValue',
          percentage: 35
        },
        computedPrice: { amount: '19.5', currencyCode: 'USD' }
      },
      {
        afterCycle: 1,
        adjustmentType: 'PERCENTAGE',
        adjustmentValue: {
          __typename: 'SellingPlanPricingPolicyPercentageValue',
          percentage: 40
        },
        computedPrice: { amount: '18.0', currencyCode: 'USD' }
      }
    ]

I have two pricing policies with two afterCycle values. And the message displayed when the customer makes a checkout saying "First payment $19.50, then $18.00 every day", but actually in the second payment cycle the Shopify still collects $19.50 instead of $18.

Any ideas for my case? Thanks!

EllaBrown2021
Excursionist
92 0 9

Have you solved this problem?

banned