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

Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-01-11 18:08:33 +02:00
committed by GitHub
parent f521260a8f
commit f7e23afff2
51 changed files with 4342 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
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.admin.productCategories.list()
.then(({ product_category, limit, offset, count }) => {
console.log(product_category.length);
});

View File

@@ -0,0 +1,9 @@
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.admin.productCategories.create({
name: 'Jeans',
})
.then(({ productCategory }) => {
console.log(productCategory.id);
});

View File

@@ -0,0 +1,7 @@
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.admin.productCategories.delete(product_category_id)
.then(({ id, object, deleted }) => {
console.log(id);
});

View File

@@ -0,0 +1,7 @@
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.admin.productCategories.retrieve("pcat-id")
.then(({ productCategory }) => {
console.log(productCategory.id);
});

View File

@@ -0,0 +1,9 @@
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.admin.salesChannels.removeLocation(sales_channel_id, {
location_id: 'App'
})
.then(({ sales_channel }) => {
console.log(sales_channel.id);
});

View File

@@ -0,0 +1,9 @@
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.admin.salesChannels.addLocation(sales_channel_id, {
location_id: 'App'
})
.then(({ sales_channel }) => {
console.log(sales_channel.id);
});

View File

@@ -0,0 +1,7 @@
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.admin.stockLocations.list()
.then(({ stock_locations, limit, offset, count }) => {
console.log(stock_locations.length);
});

View File

@@ -0,0 +1,10 @@
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.admin.stockLocations.create({
name: 'Main Warehouse',
location_id: 'sloc'
})
.then(({ stock_location }) => {
console.log(stock_location.id);
});

View File

@@ -0,0 +1,7 @@
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.admin.stockLocations.retrieve(stock_location_id)
.then(({ stock_location }) => {
console.log(stock_location.id);
});

View File

@@ -0,0 +1,9 @@
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.admin.stockLocations.update(stock_location_id, {
name: 'App'
})
.then(({ stock_location }) => {
console.log(stock_location.id);
});

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/product-categories' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/product-categories' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "Jeans",
}'

View File

@@ -0,0 +1,2 @@
curl --location --request DELETE 'https://medusa-url.com/admin/product-categories/{id}' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/product-categories/{id}' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,6 @@
curl --location --request DELETE 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"locaton_id": "stock_location_id"
}'

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/sales-channels/{id}/stock-locations' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"locaton_id": "stock_location_id"
}'

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/stock-locations' \
--header 'Authorization: Bearer {api_token}'

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/stock-locations' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "App"
}'

View File

@@ -0,0 +1,2 @@
curl --location --request GET 'https://medusa-url.com/admin/stock-locations/{id}' \
--header 'Authorization: Bearer {api_token}' \

View File

@@ -0,0 +1,6 @@
curl --location --request POST 'https://medusa-url.com/admin/stock-locations/{id}' \
--header 'Authorization: Bearer {api_token}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "App"
}'

View File

@@ -0,0 +1,7 @@
type: object
required:
- location_id
properties:
location_id:
description: The ID of the stock location
type: string

View File

@@ -0,0 +1,21 @@
type: object
required:
- name
properties:
name:
type: string
description: The name to identify the Product Category by.
handle:
type: string
description: >-
An optional handle to be used in slugs, if none is provided we will
kebab-case the title.
is_internal:
type: boolean
description: A flag to make product category an internal category for admins
is_active:
type: boolean
description: A flag to make product category visible/hidden in the store front
parent_category_id:
type: string
description: The ID of the parent product category

View File

@@ -0,0 +1,7 @@
type: object
required:
- location_id
properties:
location_id:
description: The ID of the stock location
type: string

View File

@@ -0,0 +1,15 @@
type: object
properties:
name:
description: the name of the stock location
type: string
address_id:
description: the stock location address ID
type: string
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white
address:
$ref: ./StockLocationAddressInput.yaml

View File

@@ -0,0 +1,17 @@
type: object
required:
- name
properties:
name:
description: the name of the stock location
type: string
address_id:
description: the stock location address ID
type: string
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white
address:
$ref: ./StockLocationAddressInput.yaml

View File

@@ -0,0 +1,22 @@
title: Create Stock Location Input
description: Represents the Input to create a Stock Location
type: object
required:
- name
properties:
name:
type: string
description: The stock location name
address_id:
type: string
description: The Stock location address ID
address:
description: Stock location address object
allOf:
- $ref: ./StockLocationAddressInput.yaml
- type: object
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white

View File

@@ -42,6 +42,10 @@ properties:
fulfillment
type: string
example: manual
location_id:
description: The id of the stock location the fulfillment will be shipped from
type: string
example: sloc_01G8TJSYT9M6AVS5N4EMNFS1EK
provider:
description: Available if the relation `provider` is expanded.
$ref: ./FulfillmentProvider.yaml

View File

@@ -33,6 +33,13 @@ properties:
that will be used to complete the purchase.
type: boolean
example: true
is_initiated:
description: >-
A flag to indicate if a communication with the third party provider has
been initiated.
type: boolean
example: true
default: false
status:
description: >-
Indicates the status of the Payment Session. Will default to `pending`,

View File

@@ -0,0 +1,56 @@
title: ProductCategory
description: Represents a product category
x-resourceId: ProductCategory
type: object
required:
- name
properties:
id:
type: string
description: The product category's ID
example: pcat_01G2SG30J8C85S4A5CHM2S1NS2
name:
type: string
description: The product category's name
example: Regular Fit
handle:
description: 'A unique string that identifies the Category - example: slug structures.'
type: string
example: regular-fit
mpath:
type: string
description: >-
A string for Materialized Paths - used for finding ancestors and
descendents
example: pcat_id1.pcat_id2.pcat_id3
is_internal:
type: boolean
description: A flag to make product category an internal category for admins
default: false
is_active:
type: boolean
description: A flag to make product category visible/hidden in the store front
default: false
category_children:
description: Available if the relation `category_children` are expanded.
type: array
items:
type: object
description: A product category object.
parent_category:
description: >-
A product category object. Available if the relation `parent_category` is
expanded.
type: object
created_at:
type: string
description: The date with timezone at which the resource was created.
format: date-time
updated_at:
type: string
description: The date with timezone at which the resource was updated.
format: date-time
deleted_at:
type: string
description: The date with timezone at which the resource was deleted.
format: date-time

View File

@@ -0,0 +1,58 @@
title: Stock Location Address
description: Represents a Stock Location Address
type: object
required:
- address_1
- country_code
- created_at
- updated_at
properties:
id:
type: string
description: The stock location address' ID
example: laddr_51G4ZW853Y6TFXWPG5ENJ81X42
address_1:
type: string
description: Stock location address
example: 35, Jhon Doe Ave
address_2:
type: string
description: Stock location address' complement
example: apartment 4432
city:
type: string
description: Stock location address' city
example: Mexico city
country_code:
type: string
description: Stock location address' country
example: MX
phone:
type: string
description: Stock location address' phone number
example: +1 555 61646
postal_code:
type: string
description: Stock location address' postal code
example: HD3-1G8
province:
type: string
description: Stock location address' province
example: Sinaloa
created_at:
type: string
description: The date with timezone at which the resource was created.
format: date-time
updated_at:
type: string
description: The date with timezone at which the resource was updated.
format: date-time
deleted_at:
type: string
description: The date with timezone at which the resource was deleted.
format: date-time
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white

View File

@@ -0,0 +1,40 @@
title: Stock Location Address Input
description: Represents a Stock Location Address Input
type: object
required:
- address_1
- country_code
properties:
address_1:
type: string
description: Stock location address
example: 35, Jhon Doe Ave
address_2:
type: string
description: Stock location address' complement
example: apartment 4432
city:
type: string
description: Stock location address' city
example: Mexico city
country_code:
type: string
description: Stock location address' country
example: MX
phone:
type: string
description: Stock location address' phone number
example: +1 555 61646
postal_code:
type: string
description: Stock location address' postal code
example: HD3-1G8
province:
type: string
description: Stock location address' province
example: Sinaloa
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white

View File

@@ -0,0 +1,44 @@
title: Stock Location
description: Represents a Stock Location
type: object
required:
- id
- name
- address_id
- created_at
- updated_at
properties:
id:
type: string
description: The stock location's ID
example: sloc_51G4ZW853Y6TFXWPG5ENJ81X42
address_id:
type: string
description: Stock location address' ID
example: laddr_05B2ZE853Y6FTXWPW85NJ81A44
name:
type: string
description: The name of the stock location
example: Main Warehouse
address:
description: The Address of the Stock Location
allOf:
- $ref: ./StockLocationAddressDTO.yaml
- type: object
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white
created_at:
type: string
description: The date with timezone at which the resource was created.
format: date-time
updated_at:
type: string
description: The date with timezone at which the resource was updated.
format: date-time
deleted_at:
type: string
description: The date with timezone at which the resource was deleted.
format: date-time

View File

@@ -0,0 +1,20 @@
title: Update Stock Location Input
description: Represents the Input to update a Stock Location
type: object
properties:
name:
type: string
description: The stock location name
address_id:
type: string
description: The Stock location address ID
address:
description: Stock location address object
allOf:
- $ref: ./StockLocationAddressInput.yaml
- type: object
metadata:
type: object
description: An optional key-value map with additional details
example:
car: white

View File

@@ -347,6 +347,10 @@ paths:
$ref: paths/price-lists_{id}_variants_{variant_id}_prices.yaml
/price-lists/{id}/products:
$ref: paths/price-lists_{id}_products.yaml
/product-categories:
$ref: paths/product-categories.yaml
/product-categories/{id}:
$ref: paths/product-categories_{id}.yaml
/product-tags:
$ref: paths/product-tags.yaml
/product-types:
@@ -411,6 +415,8 @@ paths:
$ref: paths/returns_{id}_receive.yaml
/sales-channels/{id}/products/batch:
$ref: paths/sales-channels_{id}_products_batch.yaml
/sales-channels/{id}/stock-locations:
$ref: paths/sales-channels_{id}_stock-locations.yaml
/sales-channels:
$ref: paths/sales-channels.yaml
/sales-channels/{id}:
@@ -423,6 +429,10 @@ paths:
$ref: paths/shipping-profiles.yaml
/shipping-profiles/{id}:
$ref: paths/shipping-profiles_{id}.yaml
/stock-locations:
$ref: paths/stock-locations.yaml
/stock-locations/{id}:
$ref: paths/stock-locations_{id}.yaml
/store/currencies/{code}:
$ref: paths/store_currencies_{code}.yaml
/store:

View File

@@ -0,0 +1,146 @@
post:
operationId: PostProductCategories
summary: Create a Product Category
description: Creates a Product Category.
x-authenticated: true
parameters:
- in: query
name: expand
description: >-
(Comma separated) Which fields should be expanded in each product
category.
schema:
type: string
- in: query
name: fields
description: >-
(Comma separated) Which fields should be retrieved in each product
category.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostProductCategoriesReq.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/product-categories/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/product-categories/postundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Product Category
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
productCategory:
$ref: ../components/schemas/ProductCategory.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
get:
operationId: GetProductCategories
summary: List Product Categories
description: Retrieve a list of product categories.
x-authenticated: true
parameters:
- in: query
name: q
description: Query used for searching product category names orhandles.
schema:
type: string
- in: query
name: is_internal
description: Search for only internal categories.
schema:
type: boolean
- in: query
name: is_active
description: Search for only active categories
schema:
type: boolean
- in: query
name: parent_category_id
description: Returns categories scoped by parent
schema:
type: string
- in: query
name: offset
description: How many product categories to skip in the result.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of product categories returned.
schema:
type: integer
default: 100
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/product-categories/getundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/product-categories/getundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Product Categories
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
product_category:
type: array
items:
$ref: ../components/schemas/ProductCategory.yaml
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.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml

View File

@@ -0,0 +1,105 @@
delete:
operationId: DeleteProductCategoriesCategory
summary: Delete a Product Category
description: Deletes a ProductCategory.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/product-categories_{id}/deleteundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/product-categories_{id}/deleteundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Product Category
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The ID of the deleted product category.
object:
type: string
description: The type of the object that was deleted.
default: product_category
deleted:
type: boolean
description: Whether the product category was deleted successfully or not.
default: true
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
get:
operationId: GetProductCategoriesCategory
summary: Get a Product Category
description: Retrieves a Product Category.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Product Category
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/product-categories_{id}/getundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/product-categories_{id}/getundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Category
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
productCategory:
$ref: ../components/schemas/ProductCategory.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml

View File

@@ -0,0 +1,121 @@
post:
operationId: PostSalesChannelsSalesChannelStockLocation
summary: Associate a stock location to a Sales Channel
description: Associates a stock location to a Sales Channel.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Sales Channel.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminPostSalesChannelsChannelStockLocationsReq.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/sales-channels_{id}_stock-locations/postundefined
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/sales-channels_{id}_stock-locations/postundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Sales Channel
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
sales_channel:
$ref: ../components/schemas/SalesChannel.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
delete:
operationId: DeleteSalesChannelsSalesChannelStockLocation
summary: Remove a stock location from a Sales Channel
description: Removes a stock location from a Sales Channel.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Sales Channel.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: >-
../components/schemas/AdminDeleteSalesChannelsChannelStockLocationsReq.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/sales-channels_{id}_stock-locations/deleteundefined
- lang: Shell
label: cURL
source:
$ref: >-
../code_samples/Shell/sales-channels_{id}_stock-locations/deleteundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Sales Channel
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
id:
type: string
description: The ID of the removed stock location from a sales channel
object:
type: string
description: The type of the object that was removed.
default: stock-location
deleted:
type: boolean
description: Whether or not the items were deleted.
default: true
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml

View File

@@ -0,0 +1,217 @@
post:
operationId: PostStockLocations
summary: Create a Stock Location
description: Creates a Stock Location.
x-authenticated: true
parameters:
- in: query
name: expand
description: Comma separated list of relations to include in the results.
schema:
type: string
- in: query
name: fields
description: Comma separated list of fields to include in the results.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostStockLocationsReq.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/stock-locations/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/stock-locations/postundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Stock Location
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
stock_location:
$ref: ../components/schemas/StockLocationDTO.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
get:
operationId: GetStockLocations
summary: List Stock Locations
description: Retrieves a list of stock locations
x-authenticated: true
parameters:
- in: query
name: id
description: ID of the stock location
schema:
type: string
- in: query
name: name
description: Name of the stock location
schema:
type: string
- in: query
name: order
description: The field to order the results by.
schema:
type: string
- in: query
name: created_at
description: Date comparison for when resulting collections 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 collections 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
- in: query
name: deleted_at
description: Date comparison for when resulting collections were deleted.
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: offset
description: How many stock locations to skip in the result.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of stock locations returned.
schema:
type: integer
default: 20
- in: query
name: expand
description: >-
(Comma separated) Which fields should be expanded in each stock location
of the result.
schema:
type: string
- in: query
name: fields
description: >-
(Comma separated) Which fields should be included in each stock location
of the result.
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/stock-locations/getundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/stock-locations/getundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Sales Channel
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
stock_locations:
type: array
items:
$ref: ../components/schemas/StockLocationDTO.yaml
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.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml

View File

@@ -0,0 +1,109 @@
get:
operationId: GetStockLocationsStockLocation
summary: Get a Stock Location
description: Retrieves the Stock Location.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Stock Location.
schema:
type: string
- in: query
name: expand
description: Comma separated list of relations to include in the results.
schema:
type: string
- in: query
name: fields
description: Comma separated list of fields to include in the results.
schema:
type: string
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/stock-locations_{id}/getundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/stock-locations_{id}/getundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Stock Location
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
stock_location:
$ref: ../components/schemas/StockLocationDTO.yaml
post:
operationId: PostStockLocationsStockLocation
summary: Update a Stock Location
description: Updates a Stock Location.
x-authenticated: true
parameters:
- in: path
name: id
required: true
description: The ID of the Stock Location.
schema:
type: string
- in: query
name: expand
description: Comma separated list of relations to include in the results.
schema:
type: string
- in: query
name: fields
description: Comma separated list of fields to include in the results.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostStockLocationsLocationReq.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/stock-locations_{id}/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/stock-locations_{id}/postundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Stock Location
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
stock_location:
$ref: ../components/schemas/StockLocationDTO.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml