Skip to main content
GET

Intro

Returns the complete variation → sub-variation → sub-variant tree for a product, exactly as written by Create/Replace Product Variants.

Context

The read counterpart to Create/Replace Product Variants — since that endpoint’s own response is intentionally flat (no nested tree), this is the endpoint to call when you need the server-confirmed nested structure back, for example right after a POST, or when rendering a product’s options in a storefront integration. Works for any product you own or that belongs to an active sub-merchant in your marketplace.

Hows

Path Parameters

integer
required
A product you own, or a product owned by an active sub-merchant in your marketplace.

Response

If the product has no variants configured yet, this returns 200 with data: null — it is not a 404. Treat data === null as “no variants,” not as an error.
variations is ordered by order_index ascending; sub_variants is ordered by creation time (they don’t carry their own order_index). createdAt/updatedAt timestamps are stripped at every level of this response.

Error Codes

Whys

Returning data: null with a 200 (rather than a 404) when no variants exist reflects that “this product has no variants” is a normal, expected state for a simple product — not an error condition. A storefront rendering a product page can check data === null to decide whether to show variant selectors at all, without needing to special-case a 404 into “no variants” versus “product not found” (the latter is a real 404, from the product lookup itself, not this endpoint’s variant data).

Why nots

This is read-only — it does not accept updates. Any change to the tree, including adding a single new variant, goes through Create/Replace Product Variants, which requires sending the entire desired tree back. This endpoint also does not paginate — a product’s full variant tree is returned in one response regardless of size.