Files
medusa-store/docs/api/admin/paths/price-lists.yaml
2022-08-05 14:06:12 +02:00

264 lines
7.7 KiB
YAML

post:
operationId: PostPriceListsPriceList
summary: Creates a Price List
description: Creates a Price List
x-authenticated: true
requestBody:
content:
application/json:
schema:
required:
- name
- description
- type
- prices
properties:
name:
description: The name of the Price List
type: string
description:
description: A description of the Price List.
type: string
starts_at:
description: The date with timezone that the Price List starts being valid.
type: string
format: date
ends_at:
description: The date with timezone that the Price List ends being valid.
type: string
format: date
type:
description: The type of the Price List.
type: string
enum:
- sale
- override
status:
description: The status of the Price List.
type: string
enum:
- active
- draft
prices:
description: The prices of the Price List.
type: array
items:
required:
- amount
- variant_id
properties:
region_id:
description: >-
The ID of the Region for which the price is used. Only
required if currecny_code is not provided.
type: string
currency_code:
description: >-
The 3 character ISO currency code for which the price will
be used. Only required if region_id is not provided.
type: string
externalDocs:
url: https://en.wikipedia.org/wiki/ISO_4217#Active_codes
description: See a list of codes.
amount:
description: The amount to charge for the Product Variant.
type: integer
variant_id:
description: The ID of the Variant for which the price is used.
type: string
min_quantity:
description: The minimum quantity for which the price will be used.
type: integer
max_quantity:
description: The maximum quantity for which the price will be used.
type: integer
customer_groups:
type: array
description: A list of customer groups that the Price List applies to.
items:
required:
- id
properties:
id:
description: The ID of a customer group
type: string
tags:
- Price List
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
price_list:
$ref: ../components/schemas/price_list.yaml
get:
operationId: GetPriceLists
summary: List Price Lists
description: Retrieves a list of Price Lists.
x-authenticated: true
parameters:
- in: query
name: limit
description: The number of items to get
schema:
type: number
default: '10'
- in: query
name: offset
description: The offset at which to get items
schema:
type: number
default: '0'
- in: query
name: expand
description: >-
(Comma separated) Which fields should be expanded in each item of the
result.
schema:
type: string
- in: query
name: order
description: field to order results by.
schema:
type: string
- in: query
name: id
description: ID to search for.
schema:
type: string
- in: query
name: q
description: >-
query to search in price list description, price list name, and customer
group name fields.
schema:
type: string
- in: query
name: status
style: form
explode: false
description: Status to search for.
schema:
type: array
items:
type: string
enum:
- active
- draft
- in: query
name: name
description: price list name to search for.
schema:
type: string
- in: query
name: customer_groups
style: form
explode: false
description: Customer Group IDs to search for.
schema:
type: array
items:
type: string
- in: query
name: type
style: form
explode: false
description: Type to search for.
schema:
type: array
items:
type: string
enum:
- sale
- override
- in: query
name: created_at
description: Date comparison for when resulting price lists 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 price lists 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 price lists 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
tags:
- Price List
responses:
'200':
description: OK
content:
application/json:
schema:
properties:
price_lists:
type: array
items:
$ref: ../components/schemas/price_list.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