Hi,
I’m currently building a custom subscription app and I’ve hit a roadblock regarding the “Subscription Proposal” workflow.
The Goal: I want to create a contract/checkout for a specific customer + product + selling plan, and trigger a native Shopify email (like the “Complete your purchase” invoice) so the customer can click a link and activate the subscription.
The Problem: I cannot find a way to combine “Selling Plans” with Shopify’s native invoicing system (orderInvoiceSend). Here is what I have tried:
Attempt 1: Draft Orders (The Standard Way) I tried using draftOrderCreate.
-
Result:
DraftOrderLineItemInputdoes not accept asellingPlanId. -
Outcome: I can send an invoice, but the resulting checkout is for a one-time purchase, not a subscription. The selling plan is stripped out.
Attempt 2: “Pending” Orders (The Workaround) I tried using orderCreate with financialStatus: "PENDING" and status: "OPEN", hoping to create an unpaid order and then use orderInvoiceSend.
-
Result: API Error:
Variable $order of type OrderCreateOrderInput! was provided invalid value for lineItems.0.sellingPlanId (Field is not defined on OrderCreateLineItemInput) -
Outcome: It seems I cannot attach a selling plan to an order during creation via the Admin API.
Attempt 3: Storefront API (Current Solution) I am currently using cartCreate via the Storefront API.
-
Result: This works perfectly for generating a checkout URL that does include the subscription (Selling Plan).
-
Outcome: However, I now have the URL, but I cannot trigger Shopify to email this URL to the customer. I have to send the email manually using an external service (AWS SES/SendGrid), which introduces domain verification and deliverability issues for my merchants.
My Question: Is there any Admin API mutation that allows us to create an unpaid order/draft with a sellingPlanId so we can use the native orderInvoiceSend mutation?
Or is the “Storefront Cart URL + External Email Service” strictly the only way to handle manual subscription creation?
Thanks!