Skip to content

Configurable product Add To Cart API not working properly with superAttribute option. #569

@harshit-webkul

Description

@harshit-webkul

Describe the bug
When attempting to add a configurable product to the cart using the Add To Cart API, the request fails or does not process correctly when the superAttribute option is passed.
The API does not identify or validate the selected variant based on the provided super attributes.

To Reproduce
Steps to reproduce the behavior:

  1. Create a configurable product with attributes (e.g., size, color).
  2. On the storefront or Postman, hit the Add To Cart API (e.g., /api/checkout/cart/add).
  3. Pass the required payload, including:
    • product_id
    • quantity
    • super_attribute
  4. Observe the API response.

Expected behavior
API should correctly identify the child variant based on the provided superAttribute.

Actual Result:
API is not processing the superAttributes correctly.

Response:

{
"errors": [
{
"message": "Options are missing for this product.",
"locations": [
{
"line": 2,
"column": 5

Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions