Files
medusa-store/docs/api/admin/paths/discounts_{discount_id}_conditions.yaml
2022-12-22 17:09:49 +02:00

72 lines
2.0 KiB
YAML

post:
operationId: PostDiscountsDiscountConditions
summary: Create a Condition
description: >-
Creates a DiscountCondition. Only one of `products`, `product_types`,
`product_collections`, `product_tags`, and `customer_groups` should be
provided.
x-authenticated: true
parameters:
- in: path
name: discount_id
required: true
description: The ID of the Product.
schema:
type: string
- in: query
name: expand
description: >-
(Comma separated) Which fields should be expanded in each product of the
result.
schema:
type: string
- in: query
name: fields
description: >-
(Comma separated) Which fields should be included in each product of the
result.
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminPostDiscountsDiscountConditions.yaml
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: >-
../code_samples/JavaScript/discounts_{discount_id}_conditions/postundefined
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/discounts_{discount_id}_conditions/postundefined
security:
- api_token: []
- cookie_auth: []
tags:
- Discount Condition
responses:
'200':
description: OK
content:
application/json:
schema:
type: object
properties:
discount:
$ref: ../components/schemas/Discount.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