LineItemSellingPlan

Topic summary

Problem: Using the Python Shopify library (REST) to fetch order line_items did not return selling plan data; only standard attributes were present. A brief code snippet showed line item attributes lacking any selling plan field.

Key clarification: Shopify’s REST Admin API does not support selling plans (subscription plan info tied to a line item). Access to selling plan data requires the Admin GraphQL API.

Next steps requested: The original poster confirmed they were using REST and asked for a sample GraphQL query to retrieve, over a date range, these fields: order_name, lineitem_name, lineitem_variant_title, lineitem_selling_plan_id. The responder also offered to investigate if provided an Order ID and Shop ID.

Status: No sample GraphQL query provided yet; the thread remains open, pending an example query or further guidance on how to query orders by date range and extract selling plan fields via GraphQL.

Summarized with AI on January 12. AI used: gpt-5.

Hi, I am using Python shopify library to retrieve data on orders. When querying shopify.Order.find()[0].attributes[‘line_items’][0].attributes the selling plan isn’t in the returned attributes. All I get is [‘id’, ‘admin_graphql_api_id’, ‘fulfillable_quantity’, ‘fulfillment_service’, ‘fulfillment_status’, ‘gift_card’, ‘grams’, ‘name’, ‘price’, ‘price_set’, ‘product_exists’, ‘product_id’, ‘properties’, ‘quantity’, ‘requires_shipping’, ‘sku’, ‘taxable’, ‘title’, ‘total_discount’, ‘total_discount_set’, ‘variant_id’, ‘variant_inventory_management’, ‘variant_title’, ‘vendor’, ‘tax_lines’, ‘duties’, ‘discount_allocations’]. Could you please advise? Thanks

Hey Sasha,
Does your order actually contain a selling plan? Are you using our GraphQL admin API, or are you still using REST? Our REST APIs do not support selling plans.
If you believe everything is configured correctly, I could take a look on our end if you provide an Order ID and Shop ID.
Hope that context helps!

  • Daniel.

Thank you for your reply Daniel, it was indeed REST. Can you provide a sample GraphQL query to retrieve the following information: order_name, lineitem_name, lineitem_variant_title, lineitem_selling_plan_id for orders between start_date and end_date