Hi,
I’m trying to implement “Try before you buy” functionality with the headless store. To achieve this I’m using Selling Plan Group with products associated with the created Selling Plan.
I’m following these guidelines: https://shopify.dev/docs/apps/selling-strategies/purchase-options/deferred/deferred-purchase-options
I am able to successfully create a Selling Plan Group and Selling Plan, add products to it (which is reflected in Shopify’s admin panel). Then, when I’m adding the product to the cart which works fine. Later in the checkout, I can see that the plan is added to the line items I’ve chosen, which is also correct. Meaning, my line items have “14-day free trial” description.
But, the problem is at the checkout where value of “Total due today” has full $ amount, while “Total due later” is $0.00. This should be other way around, since the “Try before you buy” functionality I’m trying to implement suppose to charge buyer after trial period (14 days in this case).
This is Admin API Selling Plan Group GraphQL call I’m using (exactly the same as the one from the docs in the above link under “Try before you buy”, but with products added):
mutation {
sellingPlanGroupCreate(
input: {
name: "Try before you buy"
merchantCode: "try-before-you-buy"
options: [
"Try before you buy"
]
position: 1
sellingPlansToCreate: [
{
name: "14-day free trial"
category: TRY_BEFORE_YOU_BUY
options: [
"Try free for 14 days"
]
billingPolicy: {
fixed: {
checkoutCharge: {type: PRICE, value: {fixedValue: 0}}
remainingBalanceChargeTrigger: TIME_AFTER_CHECKOUT
remainingBalanceChargeTimeAfterCheckout: "P14D"
}
}
deliveryPolicy: {fixed: {fulfillmentTrigger: ASAP}}
inventoryPolicy: {reserve: ON_SALE}
}
]
}
resources: { productIds: ["gid://shopify/Product/XXX"], productVariantIds: [] }
) {
sellingPlanGroup {
id
sellingPlans(first: 1) {
edges {
node {
id
}
}
}
}
userErrors {
field
message
}
}
}
The most important part of the call is that the billing policy has fixed value of 0 for checkout charge. This I think should cause the “Total due today” amount to not be included in the “Total due today”, but included in “Total due later”. I also tried it with other amounts for the checkout charge to check if it changes anything. It does not.
It looks to me that’s something wrong in the way the selling plan is created, or there’s some extra step to be done. I would greatly appreciate if someone could point out to me if I’m missing something.
Take care,
Marcin