Skip to content

Commit 717c634

Browse files
author
github-actions
committed
feat: Update OpenAPI file replicated from CMS4
1 parent d085dc2 commit 717c634

1 file changed

Lines changed: 269 additions & 90 deletions

File tree

openapi/openapi.yaml

Lines changed: 269 additions & 90 deletions
Original file line numberDiff line numberDiff line change
@@ -34849,94 +34849,7 @@ paths:
3484934849
coupons:
3485034850
type: array
3485134851
items:
34852-
type: object
34853-
additionalProperties: false
34854-
required:
34855-
- code
34856-
- creationTime
34857-
- discountType
34858-
- amount
34859-
- ratio
34860-
- minPrice
34861-
- currency
34862-
- template
34863-
- shippingPrice
34864-
- validFrom
34865-
- validTo
34866-
- reusable
34867-
- usedCount
34868-
- remark
34869-
properties:
34870-
code:
34871-
type: string
34872-
description: 'code of discount coupon'
34873-
examples:
34874-
- DC14585431
34875-
creationTime:
34876-
$ref: '#/components/schemas/typeDateTimeNullable'
34877-
description: 'date and time, when the discount coupon was created'
34878-
discountType:
34879-
type: string
34880-
enum:
34881-
- percentual
34882-
- fixed
34883-
description: 'type of discount. Percentual (`percentual`) or absolute discount (`fixed`)'
34884-
examples:
34885-
- percentual
34886-
amount:
34887-
$ref: '#/components/schemas/typePriceNullable'
34888-
description: 'amount of absolute discount (default eshop VAT rate is used)'
34889-
ratio:
34890-
oneOf:
34891-
-
34892-
$ref: '#/components/schemas/typePriceRatio'
34893-
-
34894-
type: 'null'
34895-
description: 'amount of percentual discount'
34896-
minPrice:
34897-
$ref: '#/components/schemas/typePriceNullable'
34898-
description: 'minimum price of order (default eshop VAT rate is used)'
34899-
currency:
34900-
$ref: '#/components/schemas/typeCurrencyCodeNullable'
34901-
description: 'currency of fixed discount.'
34902-
template:
34903-
$ref: '#/components/schemas/typeGuid'
34904-
description: 'template used for the discount coupon creation.'
34905-
shippingPrice:
34906-
type:
34907-
- string
34908-
- 'null'
34909-
enum:
34910-
- cart
34911-
- free
34912-
- beforeDiscount
34913-
- null
34914-
description: 'how the transport prices are calculated: according to the cart before discounts (beforeDiscount), according to the displayed value of the cart (cart), or free (free)'
34915-
examples:
34916-
- cart
34917-
validFrom:
34918-
$ref: '#/components/schemas/typeDateNullable'
34919-
description: 'starting date of coupon validity'
34920-
validTo:
34921-
$ref: '#/components/schemas/typeDateNullable'
34922-
description: 'ending date of coupon validity'
34923-
reusable:
34924-
type: boolean
34925-
description: 'Is the discount coupon reusable?'
34926-
examples:
34927-
- true
34928-
usedCount:
34929-
type: integer
34930-
description: 'number of times the discount coupon has been used'
34931-
examples:
34932-
- 0
34933-
remark:
34934-
type:
34935-
- string
34936-
- 'null'
34937-
description: 'remark for the discount coupon.'
34938-
examples:
34939-
- 'Note: This is a test discount coupon'
34852+
$ref: '#/components/schemas/discountCoupon'
3494034853
errors:
3494134854
$ref: '#/components/schemas/Errors'
3494234855
metadata:
@@ -35008,7 +34921,273 @@ paths:
3500834921
$ref: '#/components/schemas/typePriceNullable'
3500934922
description: 'Amount of fixed discount (default eshop VAT rate is used). This items needs to be omitted when `discountType` is set to `percentual`'
3501034923
examples:
35011-
- '100.0'
34924+
- '100.00'
34925+
ratio:
34926+
type:
34927+
- string
34928+
- 'null'
34929+
pattern: '[0-1]\.[0-9]{4}$'
34930+
description: 'Amount of percentual discount. This items needs to be omitted when `discountType` is set to `fixed`. 4 decimal places accuracy, from `0.0000` (0% discount) to `1.0000` (100% discount).'
34931+
examples:
34932+
- '0.1000'
34933+
minPrice:
34934+
$ref: '#/components/schemas/typePriceNullable'
34935+
description: 'Minimum price of order (default eshop VAT rate is used)'
34936+
examples:
34937+
- '100.00'
34938+
currency:
34939+
$ref: '#/components/schemas/typeCurrencyCodeNullable'
34940+
description: 'Currency of fixed discount. It can be null only when `discountType` is set to `percentual` and `minPrice` is set to null'
34941+
examples:
34942+
- CZK
34943+
template:
34944+
$ref: '#/components/schemas/typeGuid'
34945+
description: 'GUID of discount coupon template'
34946+
shippingPrice:
34947+
type: string
34948+
enum:
34949+
- cart
34950+
- free
34951+
- beforeDiscount
34952+
description: 'How the transport prices are calculated: according to the cart before discounts (beforeDiscount), according to the displayed value of the cart (cart), or free (free)'
34953+
examples:
34954+
- cart
34955+
validFrom:
34956+
$ref: '#/components/schemas/typeDateNullable'
34957+
description: 'Starting date of coupon validity'
34958+
validTo:
34959+
$ref: '#/components/schemas/typeDateNullable'
34960+
description: 'Ending date of coupon validity'
34961+
reusable:
34962+
type: boolean
34963+
description: 'Is the discount coupon reusable?'
34964+
examples:
34965+
- true
34966+
remark:
34967+
type:
34968+
- string
34969+
- 'null'
34970+
description: 'Discount coupon note'
34971+
examples:
34972+
- 'This is a discount coupon for the first purchase.'
34973+
parameters:
34974+
-
34975+
$ref: '#/components/parameters/DefaultContentType'
34976+
patch:
34977+
responses:
34978+
200:
34979+
description: OK
34980+
content:
34981+
application/json:
34982+
schema:
34983+
type: object
34984+
properties:
34985+
data:
34986+
type: object
34987+
additionalProperties: false
34988+
required:
34989+
- coupons
34990+
properties:
34991+
coupons:
34992+
type: array
34993+
items:
34994+
$ref: '#/components/schemas/discountCoupon'
34995+
errors:
34996+
$ref: '#/components/schemas/Errors'
34997+
metadata:
34998+
$ref: '#/components/schemas/Metadata'
34999+
required:
35000+
- data
35001+
- errors
35002+
- metadata
35003+
additionalProperties: false
35004+
examples:
35005+
duplicateCode:
35006+
value:
35007+
data:
35008+
coupons:
35009+
-
35010+
code: DISCOUNT10
35011+
amount: '100.00'
35012+
minPrice: null
35013+
creationTime: '2024-01-15T10:00:00+0100'
35014+
validFrom: null
35015+
validTo: null
35016+
ratio: null
35017+
template: 01b39ad8-8686-11e9-968c-08002774f818
35018+
currency: CZK
35019+
reusable: true
35020+
usedCount: 0
35021+
remark: null
35022+
discountType: fixed
35023+
shippingPrice: cart
35024+
errors:
35025+
-
35026+
errorCode: discount-coupon-code-duplicated
35027+
message: 'Discount coupon code "DISCOUNT10" is duplicated.'
35028+
instance: 'data.coupons[1].code'
35029+
metadata:
35030+
requestId: 019c8c34-64f3-7328-af43-bf1e34fa39d7
35031+
403:
35032+
description: Forbidden
35033+
content:
35034+
application/json:
35035+
schema:
35036+
type: object
35037+
properties:
35038+
data:
35039+
type: 'null'
35040+
errors:
35041+
$ref: '#/components/schemas/Errors'
35042+
metadata:
35043+
$ref: '#/components/schemas/Metadata'
35044+
required:
35045+
- data
35046+
- errors
35047+
- metadata
35048+
additionalProperties: false
35049+
examples:
35050+
missingModule:
35051+
value:
35052+
data: null
35053+
errors:
35054+
-
35055+
errorCode: missing-module
35056+
message: 'Method requires active discountCoupons module in eshop.'
35057+
instance: discountCoupons
35058+
metadata:
35059+
requestId: 019c8c34-64f3-7328-af43-bf1e34fa39d7
35060+
422:
35061+
description: 'Unprocessable Entity'
35062+
content:
35063+
application/json:
35064+
schema:
35065+
type: object
35066+
properties:
35067+
data:
35068+
type: object
35069+
errors:
35070+
$ref: '#/components/schemas/Errors'
35071+
metadata:
35072+
$ref: '#/components/schemas/Metadata'
35073+
required:
35074+
- data
35075+
- errors
35076+
- metadata
35077+
additionalProperties: false
35078+
examples:
35079+
couponNotFound:
35080+
value:
35081+
data:
35082+
coupons: []
35083+
errors:
35084+
-
35085+
errorCode: discount-coupon-not-found
35086+
message: 'Discount coupon with code "UNKNOWN" was not found.'
35087+
instance: 'data.coupons[0].code'
35088+
metadata:
35089+
requestId: 019c8c34-64f3-7328-af43-bf1e34fa39d7
35090+
validationErrors:
35091+
value:
35092+
data:
35093+
coupons: []
35094+
errors:
35095+
-
35096+
errorCode: invalid-request-data
35097+
message: 'For "percentual" discount type you cannot provide "amount" property'
35098+
instance: 'data.coupons[0].amount'
35099+
-
35100+
errorCode: invalid-request-data
35101+
message: 'For "fixed" discount type you cannot provide "ratio" property'
35102+
instance: 'data.coupons[1].ratio'
35103+
-
35104+
errorCode: invalid-request-data
35105+
message: 'Field "ratio" is required when "discountType" is "percentual".'
35106+
instance: 'data.coupons[2].ratio'
35107+
-
35108+
errorCode: invalid-request-data
35109+
message: 'Field "amount" is required when "discountType" is "fixed".'
35110+
instance: 'data.coupons[3].amount'
35111+
-
35112+
errorCode: invalid-request-data
35113+
message: 'Missing "currency" field. It is required when price is specified in body.'
35114+
instance: 'data.coupons[4].currency'
35115+
-
35116+
errorCode: invalid-request-data
35117+
message: 'Field "discountType" is required when "currency" is provided without "minPrice".'
35118+
instance: 'data.coupons[5].discountType'
35119+
-
35120+
errorCode: invalid-request-data
35121+
message: 'Invalid value number "0.00" for property "amount". Value must be higher than zero.'
35122+
instance: 'data.coupons[6].amount'
35123+
-
35124+
errorCode: invalid-request-data
35125+
message: 'No fields to update were provided.'
35126+
instance: 'data.coupons[7]'
35127+
metadata:
35128+
requestId: 019c8c34-64f3-7328-af43-bf1e34fa39d7
35129+
summary: 'Bulk discount coupon update'
35130+
operationId: bulkUpdateDiscountCoupons
35131+
description: |-
35132+
Bulk partial update of existing discount coupons. Each coupon in the request
35133+
must include `code` as the identifier. All remaining fields are optional and
35134+
applied as a partial update — only provided fields are changed.
35135+
35136+
When `discountType` is `percentual`, `amount` must not be provided. When
35137+
`discountType` is `fixed`, `ratio` must not be provided.
35138+
35139+
The `currency` field is required when `discountType` is `fixed` or `minPrice`
35140+
is not null.
35141+
35142+
Invalid coupons or coupons not found by `code` are skipped and reported in `errors[]`.
35143+
tags:
35144+
- 'Discount coupons'
35145+
requestBody:
35146+
content:
35147+
application/json:
35148+
schema:
35149+
type: object
35150+
additionalProperties: false
35151+
required:
35152+
- data
35153+
properties:
35154+
data:
35155+
type: object
35156+
additionalProperties: false
35157+
required:
35158+
- coupons
35159+
properties:
35160+
coupons:
35161+
type: array
35162+
description: 'Discount coupons. Minimal 1 item, maximal 999 items.'
35163+
minItems: 1
35164+
maxItems: 999
35165+
items:
35166+
type: object
35167+
additionalProperties: false
35168+
required:
35169+
- code
35170+
properties:
35171+
code:
35172+
type: string
35173+
minLength: 1
35174+
maxLength: 16
35175+
description: 'Code of the discount coupon to update. Used as the identifier.'
35176+
examples:
35177+
- DISCOUNT10
35178+
discountType:
35179+
type: string
35180+
enum:
35181+
- percentual
35182+
- fixed
35183+
description: 'Type of discount. Percentual (percentual) or fixed discount (fixed)'
35184+
examples:
35185+
- percentual
35186+
amount:
35187+
$ref: '#/components/schemas/typePriceNullable'
35188+
description: 'Amount of fixed discount (default eshop VAT rate is used). This items needs to be omitted when `discountType` is set to `percentual`'
35189+
examples:
35190+
- '100.00'
3501235191
ratio:
3501335192
type:
3501435193
- string
@@ -35021,7 +35200,7 @@ paths:
3502135200
$ref: '#/components/schemas/typePriceNullable'
3502235201
description: 'Minimum price of order (default eshop VAT rate is used)'
3502335202
examples:
35024-
- '100.0'
35203+
- '100.00'
3502535204
currency:
3502635205
$ref: '#/components/schemas/typeCurrencyCodeNullable'
3502735206
description: 'Currency of fixed discount. It can be null only when `discountType` is set to `percentual` and `minPrice` is set to null'

0 commit comments

Comments
 (0)