chore(docs): Generated API Reference (#4706)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com> Co-authored-by: Shahed Nasser <shahednasser@gmail.com>
This commit is contained in:
co-authored by
olivermrbl
Shahed Nasser
parent
efdea04963
commit
658339767b
@@ -1,61 +1,122 @@
|
||||
get:
|
||||
operationId: GetVariants
|
||||
summary: Get Product Variants
|
||||
description: Retrieves a list of Product Variants
|
||||
description: >
|
||||
Retrieves a list of product variants. The product variants can be filtered
|
||||
by fields such as `id` or `title`. The product variants can also be
|
||||
paginated.
|
||||
|
||||
|
||||
For accurate and correct pricing of the product variants based on the
|
||||
customer's context, it's highly recommended to pass fields such as
|
||||
|
||||
`region_id`, `currency_code`, and `cart_id` when available.
|
||||
|
||||
|
||||
Passing `sales_channel_id` ensures retrieving only variants of products
|
||||
available in the specified sales channel.
|
||||
|
||||
You can alternatively use a publishable API key in the request header
|
||||
instead of passing a `sales_channel_id`.
|
||||
externalDocs:
|
||||
description: How to pass product pricing parameters
|
||||
url: >-
|
||||
https://docs.medusajs.com/modules/products/storefront/show-products#product-pricing-parameters
|
||||
parameters:
|
||||
- in: query
|
||||
name: ids
|
||||
description: A comma separated list of Product Variant ids to filter by.
|
||||
description: >-
|
||||
Filter by a comma-separated list of IDs. If supplied, it overrides the
|
||||
`id` parameter.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: id
|
||||
style: form
|
||||
explode: false
|
||||
description: >-
|
||||
Filter by one or more IDs. If `ids` is supplied, it's overrides the
|
||||
value of this parameter.
|
||||
schema:
|
||||
oneOf:
|
||||
- type: string
|
||||
description: Filter by an ID.
|
||||
- type: array
|
||||
description: Filter by IDs.
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
name: sales_channel_id
|
||||
description: A sales channel id for result configuration.
|
||||
description: >-
|
||||
"Filter by sales channel IDs. When provided, only products available in
|
||||
the selected sales channels are retrieved. Alternatively, you can pass a
|
||||
publishable API key in the request header and this will have the same
|
||||
effect."
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: expand
|
||||
description: A comma separated list of Product Variant relations to load.
|
||||
description: >-
|
||||
Comma-separated relations that should be expanded in the returned
|
||||
product variants.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: fields
|
||||
description: >-
|
||||
Comma-separated fields that should be included in the returned product
|
||||
variants.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: offset
|
||||
description: How many product variants to skip in the result.
|
||||
description: The number of products to skip when retrieving the product variants.
|
||||
schema:
|
||||
type: number
|
||||
default: '0'
|
||||
- in: query
|
||||
name: limit
|
||||
description: Maximum number of Product Variants to return.
|
||||
description: Limit the number of product variants returned.
|
||||
schema:
|
||||
type: number
|
||||
default: '100'
|
||||
- in: query
|
||||
name: cart_id
|
||||
description: The id of the Cart to set prices based on.
|
||||
description: >-
|
||||
The ID of the cart. This is useful for accurate pricing based on the
|
||||
cart's context.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: region_id
|
||||
description: The id of the Region to set prices based on.
|
||||
description: >-
|
||||
The ID of the region. This is useful for accurate pricing based on the
|
||||
selected region.
|
||||
schema:
|
||||
type: string
|
||||
- in: query
|
||||
name: currency_code
|
||||
description: The currency code to use for price selection.
|
||||
style: form
|
||||
explode: false
|
||||
description: >-
|
||||
A 3 character ISO currency code. This is useful for accurate pricing
|
||||
based on the selected currency.
|
||||
schema:
|
||||
type: string
|
||||
externalDocs:
|
||||
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
|
||||
description: See a list of codes.
|
||||
- in: query
|
||||
name: title
|
||||
style: form
|
||||
explode: false
|
||||
description: product variant title to search for.
|
||||
description: Filter by title
|
||||
schema:
|
||||
oneOf:
|
||||
- type: string
|
||||
description: a single title to search by
|
||||
description: a single title to filter by
|
||||
- type: array
|
||||
description: multiple titles to search by
|
||||
description: multiple titles to filter by
|
||||
items:
|
||||
type: string
|
||||
- in: query
|
||||
@@ -64,23 +125,23 @@ get:
|
||||
schema:
|
||||
oneOf:
|
||||
- type: number
|
||||
description: a specific number to search by.
|
||||
description: A specific number to filter by.
|
||||
- type: object
|
||||
description: search using less and greater than comparisons.
|
||||
description: Filter using less and greater than comparisons.
|
||||
properties:
|
||||
lt:
|
||||
type: number
|
||||
description: filter by inventory quantity less than this number
|
||||
description: Filter by inventory quantity less than this number
|
||||
gt:
|
||||
type: number
|
||||
description: filter by inventory quantity greater than this number
|
||||
description: Filter by inventory quantity greater than this number
|
||||
lte:
|
||||
type: number
|
||||
description: filter by inventory quantity less than or equal to this number
|
||||
description: Filter by inventory quantity less than or equal to this number
|
||||
gte:
|
||||
type: number
|
||||
description: >-
|
||||
filter by inventory quantity greater than or equal to this
|
||||
Filter by inventory quantity greater than or equal to this
|
||||
number
|
||||
x-codegen:
|
||||
method: list
|
||||
@@ -91,7 +152,7 @@ get:
|
||||
source:
|
||||
$ref: ../code_samples/Shell/store_variants/get.sh
|
||||
tags:
|
||||
- Variants
|
||||
- Product Variants
|
||||
responses:
|
||||
'200':
|
||||
description: OK
|
||||
|
||||
Reference in New Issue
Block a user