Skip to content

Feature Request: Multiple PR contributors payout distribution #12

@skndash96

Description

@skndash96

Node.js version

24

Database and its version

16.2

Operating system name and version

Linux

Browser name

No response

What happended?

As per the documentation, the GET cart endpoint supports returning items.variant.inventory_quantity
but it doesn't return. See actual behaviour section for the actual request and response.

Image

Expected behavior

Expected behaviour is that the GET cart API endpoint returns the items.variant.inventory_quantity when requests, but it ignores this field.

Actual behavior

  return await sdk.client
    .fetch<HttpTypes.StoreCartResponse>(`/store/carts/${id}`, {
      method: "GET",
      query: {
        fields:
          "*items, *region, *items.product, *items.variant, +items.variant.inventory_quantity, *items.thumbnail, *items.metadata, +items.total, *promotions, +shipping_methods.name",
      },
      headers,
      next,
      // cache: "force-cache",
    })

I tried the following:

*items.variant, +items.variant.inventory_quantity
The field is missing in the response

*items.variant.inventory_quantity
error: Entity 'ProductVariant' does not have property 'inventory_quantity'
ValidationError: Entity 'ProductVariant' does not have property 'inventory_quantity'

*items.variants.inventory_quantity and many other trials
TypeError: Cannot read properties of undefined (reading 'strategy')

What's the proper way to retrieve inventory_quantity during cart GET?
Why do I need this? Because I have to prevent this flow:

  1. A customer adds a product to the cart.
  2. Abandon cart for a day
  3. The product becomes out of stock
  4. Customer comes back and checkouts
  5. No error until the customer clicks Place Order

So i have to prevent this.

Pinned by bountic-bot

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions