Updating of selling plan error 400

Topic summary

A developer is encountering a 400 error when attempting to update a selling plan (subscription option) via the /cart/change.js endpoint. The error message indicates: “Required parameter missing or invalid: ‘line’ or ‘id’ param is required.”

Current situation:

  • The developer followed Shopify’s official documentation for supporting purchase options
  • Code includes a select element for changing selling plans
  • Error occurs when trying to change the selling plan through the select element

Troubleshooting advice provided:

  • Log the data object being sent to verify it contains correct values for line, quantity, and id parameters
  • Review the Ajax API documentation to ensure the endpoint is being accessed correctly
  • Verify that data is being properly pulled from Shopify

Status: The issue remains unresolved; awaiting confirmation that the required parameters are being correctly passed to the cart update endpoint.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

Hi Jun,

It sounds like the request you’re sending to the /cart/change.js endpoint is incomplete or doesn’t contain correct values for the ‘line’ or ‘id’ parameters. Can you log the data object to check that it returns the correct line, quantity, and id values? If these are not being logged correctly then you can identify that data is not being pulled from Shopify correctly.

I’d also recommend reviewing the Ajax documentation to ensure you’re accessing the cart/change.js endpoint correctly.