POST {proxyPathPrefix}/availability_checks

supercycleFetch(
  "POST",
  "/availability_checks",
  { body: JSON.stringify({ availabilityCheck: { variantId: 123456789 } })
}).then(console.log)

Availability check parameters

  • variantId Required. The variants Shopify ID.
  • locationId Optional. Filter by Shopify location

Return format

unavailableRanges will be a 2D array e.g.

[
  ["..2025-01-15", "2025-01-20..2025-01-25"],
  ["..2025-01-15", "2025-01-28.."],
  ["..2025-01-15"],
]

Each ROW represents an item. Each COLUMN represents a range of dates that are unavailable.

The range is represented as a string with two dates separated by .. an empty date means minus infinity or infinity.

DataMeaning
2025-01-20..2025-01-252025-01-20 TO 2025-01-25
..2025-01-15UNTIL 2025-01-15
2025-01-20..FROM 2025-01-20

So in the above example there a 3 items:

Item 1 is available from 2025-01-15 to 2025-01-20 and from 2025-01-25 onwards.

Item 2 is available from 2025-01-15 to 2025-01-28.

Item 3 is available from 2025-01-15 onwards.