The SubscriptionContract contains BillingPolicy and DeliveryPolicy but the lines contain pricingPolicy. Just to test things out, I created a SubscriptionContract with the BillingPolicy interval set to 3 and DeliveryPolicy interval set to 1 (prepaid policy), then I updated the SubscriptionContract to change the BillingPolicy interval to 1 so that it would be a pay per delivery policy.
Then I took at the line data and saw this:
{
"id": "gid://shopify/SubscriptionLine/037c21da-dc0c-4c95-897d-d118ef1c7aff",
"quantity": 1,
"productId": "gid://shopify/Product/6716443918493",
"variantId": "gid://shopify/ProductVariant/39954168414365",
"currentPrice": {
"amount": "408.0",
"currencyCode": "CAD"
},
...
"pricingPolicy": {
"basePrice": {
"amount": "170.0",
"currencyCode": "CAD"
},
"cycleDiscounts": [
{
"afterCycle": 0,
"computedPrice": {
"amount": "408.0",
"currencyCode": "CAD"
},
"adjustmentType": "PERCENTAGE",
"adjustmentValue": {
"percentage": 20
}
},
{
"afterCycle": 3,
"computedPrice": {
"amount": "459.0",
"currencyCode": "CAD"
},
"adjustmentType": "PERCENTAGE",
"adjustmentValue": {
"percentage": 10
}
}
]
},
"sellingPlanId": "gid://shopify/SellingPlan/622559389",
"sellingPlanName": "sup prepaid",
"discountAllocations": [],
"lineDiscountedPrice": {
"amount": "408.0",
"currencyCode": "CAD"
}
}
The price of 1 unit is supposed to be $170 but I’m seeing several conflicting prices within the line, specifically:
- currentPrice
- pricingPolicy.basePrice
- pricingPolicy.cycleDiscounts[0].computedPrice
- pricingPolicy.cycleDiscounts[1].computedPrice
The output I’m seeing doesn’t make sense to me when comparing to the docs, some prices are reflecting the prepaid price and some are reflecting the payperdelivery price but I figured they should all reflect payperdelivery price because I just changed the BillingPolicy and DeliveryPolicy to reflect payperdelivery. From what I currently understand, I’m supposed to update the line prices for contracts with recurring discounts as suggested in this thread:
https://community.shopify.com/post/1163554
but I’m not sure what’s expected in this case when I’m just switching billing/delivery policies, or any other fields of a SubscriptionContract for that matter. Also, when updating the line do I just update the currentPrice or both currentPrice and pricingPolicy.basePrice, and what about the cycleDiscounts?
I’m really confused as to when and what exactly should I update so the pricing stays in sync for the lines and contract, hoping someone can help set me straight on these issues.