chore(docs): Generated API Reference (#2649)

Co-authored-by: kodiakhq[bot] <kodiakhq[bot]@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2022-11-28 10:59:43 +02:00
committed by GitHub
parent 546577a81a
commit 3cee0bc8fc
10 changed files with 464 additions and 3 deletions

View File

@@ -2937,6 +2937,160 @@ paths:
$ref: '#/components/responses/invalid_request_error'
'500':
$ref: '#/components/responses/500_error'
/product-types:
get:
operationId: GetProductTypes
summary: List Product Types
description: Retrieve a list of Product Types.
x-authenticated: true
parameters:
- in: query
name: limit
description: The number of types to return.
schema:
type: integer
default: 20
- in: query
name: offset
description: The number of items to skip before the results.
schema:
type: integer
default: 0
- in: query
name: order
description: The field to sort items by.
schema:
type: string
- in: query
name: discount_condition_id
description: The discount condition id on which to filter the product types.
schema:
type: string
- in: query
name: value
style: form
explode: false
description: The type values to search for
schema:
type: array
items:
type: string
- in: query
name: id
style: form
explode: false
description: The type IDs to search for
schema:
type: array
items:
type: string
- in: query
name: q
description: A query string to search values for
schema:
type: string
- in: query
name: created_at
description: Date comparison for when resulting product types were created.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Date comparison for when resulting product types were updated.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
x-codeSamples:
- lang: JavaScript
label: JS Client
source: >
import Medusa from "@medusajs/medusa-js"
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries:
3 })
// must be previously logged in or use api token
medusa.store.productTypes.list()
.then(({ product_types }) => {
console.log(product_types.length);
});
- lang: Shell
label: cURL
source: >
curl --location --request GET
'https://medusa-url.com/store/product-types' \
--header 'Authorization: Bearer {api_token}'
security:
- api_token: []
- cookie_auth: []
tags:
- Product Type
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
product_types:
$ref: '#/components/schemas/product_type'
count:
type: integer
description: The total number of items available
offset:
type: integer
description: The number of items skipped before these items
limit:
type: integer
description: The number of items per page
'400':
$ref: '#/components/responses/400_error'
'401':
$ref: '#/components/responses/unauthorized'
'404':
$ref: '#/components/responses/not_found_error'
'409':
$ref: '#/components/responses/invalid_state_error'
'422':
$ref: '#/components/responses/invalid_request_error'
'500':
$ref: '#/components/responses/500_error'
'/products/{id}':
get:
operationId: GetProductsProduct