Skip to content

Commit a26ec1f

Browse files
committed
Merge remote-tracking branch 'origin/discounts-rest' into discounts-rest
2 parents 6e427e6 + 4d2f690 commit a26ec1f

File tree

5 files changed

+265
-311
lines changed

5 files changed

+265
-311
lines changed

docs/api/rest_api/rest_api_reference/input/examples/discount_codes/apply/POST/DiscountCodeResponse.json.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"DiscountCode": {
33
"_media-type": "application\/vnd.ibexa.api.DiscountCode+json",
44
"id": 1,
5-
"code": "my_secret_code",
5+
"code": "summer10",
66
"created_at": {
77
"date": "2025-06-10 14:14:06.000000",
88
"timezone_type": 3,

docs/api/rest_api/rest_api_reference/input/ibexa-discounts-codes.raml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ displayName: Discount Codes
1515
application/vnd.ibexa.api.DiscountCode+json
1616
body:
1717
application/vnd.ibexa.api.DiscountCode+json:
18-
type: DiscountCode
18+
type: DiscountCodeWrapper
1919
example: !include examples/discount_codes/apply/POST/DiscountCode.json.example
2020
responses:
2121
200:
2222
description: Discount applied successfully
2323
body:
2424
application/vnd.ibexa.api.DiscountCode+json:
25-
type: DiscountCode
25+
type: DiscountCodeWrapper
2626
example: !include examples/discount_codes/apply/POST/DiscountCodeResponse.json.example
2727
400:
2828
description: Error - the request is invalid.
@@ -46,7 +46,7 @@ displayName: Discount Codes
4646
application/vnd.ibexa.api.DiscountCode+json
4747
body:
4848
application/vnd.ibexa.api.DiscountCode+json:
49-
type: DiscountCode
49+
type: DiscountCodeWrapper
5050
example: !include examples/discount_codes/apply/POST/DiscountCode.json.example
5151
responses:
5252
204:

docs/api/rest_api/rest_api_reference/input/ibexa-discounts.raml

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,14 @@ post:
3939
application/vnd.ibexa.api.Discount+json:
4040
type: DiscountWrapper
4141
example: !include examples/discounts/POST/DiscountCreateResponse.json.example
42+
400:
43+
description: Error - the request is invalid.
44+
401:
45+
description: Error - the user is not authorized to execute an AI action.
4246

4347
/{id}:
4448
get:
45-
displayName: Get discount
49+
displayName: Get discount by ID
4650
description: Returns a discount with the specified numerical ID
4751
headers:
4852
Accept:
@@ -55,10 +59,12 @@ post:
5559
application/vnd.ibexa.api.Discount+json:
5660
type: DiscountWrapper
5761
example: !include examples/discounts/Discount.json.example
62+
401:
63+
description: Error - the user is not authorized to create a discount
5864

5965
/{identifier}:
6066
get:
61-
displayName: Get discount
67+
displayName: Get discount by identifier
6268
description: Returns a discount with the specified identifier
6369
headers:
6470
Accept:
@@ -94,13 +100,25 @@ post:
94100
application/vnd.ibexa.api.Discount+json:
95101
type: DiscountWrapper
96102
example: !include examples/discounts/identifier/PATCH/DiscountUpdateResponse.json.example
103+
400:
104+
description: Error - the request is invalid.
105+
401:
106+
description: Error - the user is not authorized to update the discount.
107+
404:
108+
description: Error - the specified discount was not found.
97109

98110
delete:
99111
displayName: Delete discount
100112
description: Deletes a discount
101113
responses:
102114
204:
103115
description: Discount deleted successfully.
116+
400:
117+
description: Error - the request is invalid.
118+
401:
119+
description: Error - the user is not authorized to update the discount.
120+
404:
121+
description: Error - the specified discount was not found.
104122

105123
/enable:
106124
post:
@@ -109,6 +127,12 @@ post:
109127
responses:
110128
204:
111129
description: Discount enabled successfully.
130+
400:
131+
description: Error - the request is invalid.
132+
401:
133+
description: Error - the user is not authorized to update the discount.
134+
404:
135+
description: Error - the specified discount was not found.
112136

113137
/disable:
114138
post:
@@ -117,3 +141,9 @@ post:
117141
responses:
118142
204:
119143
description: Discount disabled successfully.
144+
400:
145+
description: Error - the request is invalid.
146+
401:
147+
description: Error - the user is not authorized to update the discount.
148+
404:
149+
description: Error - the specified discount was not found.

0 commit comments

Comments
 (0)