Back to Explore

skndash96/bountic #8

Feature Request: Multiple PR contributors payout distribution #3
LOCKEDBounty

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.

<img width="1287" height="829" alt="Image" src="https://github.com/user-attachments/assets/cf88c559-024e-404d-8035-d1531972cfbe" />

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.

View on GitHub

Total Bounty

$ 5.00

USDC

Funder Leaderboard

#1 Anonymous$5.00

Maintainers must login via GitHub to approve payout.

Activity Feed
  • Bounty locked after merge of PR #9

    BOUNTY LOCKEDApr 28, 3:43 PM

  • PR #9 by @skndash96 is competing for this bounty

    PR COMPETINGApr 28, 3:43 PM

  • Anonymous added $5.00 via WEB

    FUNDING ADDEDApr 28, 3:42 PM

  • @skndash96 added Bounty label

    BOUNTY CREATEDApr 28, 3:41 PM