Hi Team,
We are trying to create an order using GraphQL mutations in Shopify. However, we’re facing an issue where we’re unable to include the sellingPlanId in the orderCreate mutation, although it can be added successfully in the cartCreate mutation. Could anyone suggest how to associate a sellingPlanId when using the orderCreate mutation?
Topic summary
A developer is attempting to create an order with a subscription plan (sellingPlanId) using Shopify’s GraphQL orderCreate mutation but cannot include the subscription parameter.
Key clarification provided:
- The orderCreate mutation does not support adding subscription plans directly
- The correct workflow requires:
- Creating a subscription contract first
- Triggering a billing attempt via subscriptionBillingAttemptCreate mutation
- This generates the order automatically
Alternative approach suggested:
- Use the Cart API (cartCreate, cartLinesAdd, checkoutUrl) for subscription-based orders
- Avoid orderCreate for subscription workflows as it’s not designed for this use case
Current status: The original poster has already created the subscription contract and is seeking confirmation on whether additional mutations are needed after the billing attempt.
You can’t add a subscription plan directly in the orderCreate mutation. Instead, you need to create a subscription contract first, then trigger a billing attempt to generate the order.
Thanks for your reply. We have already created the subscription contract. Is the order automatically created once the subscriptionBillingAttemptCreate mutation query is executed?. Or do we need to execute any additional mutations?
Hi,
Hope this will help. As you have already created a subscription contract
- DO use Cart API (cartCreate, cartLinesAdd, checkoutUrl).
- DON’T try to use orderCreate directly for subscriptions — it’s not built for that.