Skip to content

Commit 04c9ecc

Browse files
authored
Updated API from documentation release
1 parent b160c52 commit 04c9ecc

8 files changed

Lines changed: 89 additions & 45 deletions

File tree

api-specs/api/resources/channels.raml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ description: |
1212
Channels represent a source or destination of different entities. They can be used to model warehouses or stores.
1313
get:
1414
displayName: Query Channels
15-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
15+
securedBy: [oauth_2_0: { scopes: ['view_channels:{projectKey}', 'view_products:{projectKey}'] }]
1616
responses:
1717
200:
1818
body:
1919
application/json:
2020
example: !include ../examples/Channel/ChannelPagedQueryResponse.json
2121
head:
2222
displayName: Check if Channel exists by Query Predicate
23-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
23+
securedBy: [oauth_2_0: { scopes: ['view_channels:{projectKey}', 'view_products:{projectKey}'] }]
2424
description: Checks if one or more Channels exist for the provided query predicate. Returns a `200` status if any Channels match the query predicate, or a `404` status otherwise.
2525
queryParameters:
2626
where?:
@@ -32,7 +32,7 @@ head:
3232
[Time](ctp:api:type:AttributeTimeType), and [DateTime](ctp:api:type:AttributeDateTimeType) attribute types.
3333
post:
3434
displayName: Create Channel
35-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
35+
securedBy: [oauth_2_0: { scopes: ['manage_channels:{projectKey}', 'manage_products:{projectKey}'] }]
3636
body:
3737
application/json:
3838
example: !include ../examples/Channel/ChannelDraft.json
@@ -50,19 +50,19 @@ post:
5050
resourceUpdateType: ChannelUpdate
5151
get:
5252
displayName: Get Channel by ID
53-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
53+
securedBy: [oauth_2_0: { scopes: ['view_channels:{projectKey}', 'view_products:{projectKey}'] }]
5454
responses:
5555
200:
5656
body:
5757
application/json:
5858
example: !include ../examples/Channel/Channel.json
5959
head:
6060
displayName: Check if Channel exists by ID
61-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
61+
securedBy: [oauth_2_0: { scopes: ['view_channels:{projectKey}', 'view_products:{projectKey}'] }]
6262
description: Checks if a Channel exists with the provided `id`. Returns a `200` status if the Channel exists, or a `404` status otherwise.
6363
post:
6464
displayName: Update Channel by ID
65-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
65+
securedBy: [oauth_2_0: { scopes: ['manage_channels:{projectKey}', 'manage_products:{projectKey}'] }]
6666
body:
6767
application/json:
6868
example: !include ../examples/Channel/ChannelUpdate.json
@@ -73,7 +73,7 @@ post:
7373
example: !include ../examples/Channel/updated-Channel.json
7474
delete:
7575
displayName: Delete Channel by ID
76-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
76+
securedBy: [oauth_2_0: { scopes: ['manage_channels:{projectKey}', 'manage_products:{projectKey}'] }]
7777
description: |
7878
Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted.
7979
responses:
@@ -91,19 +91,19 @@ post:
9191
resourceUpdateType: ChannelUpdate
9292
get:
9393
displayName: Get Channel by Key
94-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
94+
securedBy: [oauth_2_0: { scopes: ['view_channels:{projectKey}', 'view_products:{projectKey}'] }]
9595
responses:
9696
200:
9797
body:
9898
application/json:
9999
example: !include ../examples/Channel/Channel.json
100100
head:
101101
displayName: Check if Channel exists by Key
102-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
102+
securedBy: [oauth_2_0: { scopes: ['view_channels:{projectKey}', 'view_products:{projectKey}'] }]
103103
description: Checks if a Channel exists with the provided `key`. Returns a `200` status if the Channel exists, or a `404` status otherwise.
104104
post:
105105
displayName: Update Channel by Key
106-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
106+
securedBy: [oauth_2_0: { scopes: ['manage_channels:{projectKey}', 'manage_products:{projectKey}'] }]
107107
body:
108108
application/json:
109109
example: !include ../examples/Channel/ChannelUpdate.json
@@ -114,7 +114,7 @@ post:
114114
example: !include ../examples/Channel/updated-Channel.json
115115
delete:
116116
displayName: Delete Channel by Key
117-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
117+
securedBy: [oauth_2_0: { scopes: ['manage_channels:{projectKey}', 'manage_products:{projectKey}'] }]
118118
description: |
119119
Returns a [ReferenceExists](ctp:api:type:ReferenceExistsError) error if other resources reference the Channel to be deleted.
120120
responses:

api-specs/api/resources/product-discounts.raml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,22 @@ type:
1111
description: Product discounts are used to change certain product prices.
1212
get:
1313
displayName: Query ProductDiscounts
14-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
14+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
1515
responses:
1616
200:
1717
body:
1818
application/json:
1919
example: !include ../examples/product-discounts.example.json
2020
head:
2121
displayName: Check if ProductDiscount exists by Query Predicate
22-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
22+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
2323
description: Checks if one or more ProductDiscounts exist for the provided query predicate. Returns a `200` status if any ProductDiscounts match the query predicate, or a `404` status otherwise.
2424
queryParameters:
2525
where?:
2626
type: QueryPredicate[]
2727
post:
2828
displayName: Create ProductDiscount
29-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
29+
securedBy: [oauth_2_0: { scopes: ['manage_product_discounts:{projectKey}', 'manage_products:{projectKey}'] }]
3030
body:
3131
application/json:
3232
example: !include ../examples/product-discount-create.example.json
@@ -44,7 +44,7 @@ post:
4444
Given Product and Product Variant IDs and a Price, this endpoint will return the [ProductDiscount](ctp:api:type:ProductDiscount) that would have been applied to that Price.
4545
4646
If a Product Discount could not be found that could be applied to the Price of a Product Variant, a [NoMatchingProductDiscountFound](ctp:api:type:NoMatchingProductDiscountFoundError) error is returned.
47-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
47+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
4848
body:
4949
application/json:
5050
type: ProductDiscountMatchQuery
@@ -69,19 +69,19 @@ post:
6969
resourceUpdateType: ProductDiscountUpdate
7070
get:
7171
displayName: Get ProductDiscount by Key
72-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
72+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
7373
responses:
7474
200:
7575
body:
7676
application/json:
7777
example: !include ../examples/product-discount.example.json
7878
head:
7979
displayName: Check if ProductDiscount exists by Key
80-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
80+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
8181
description: Checks if a ProductDiscount exists with the provided `key`. Returns a `200` status if the ProductDiscount exists, or a `404` status otherwise.
8282
post:
8383
displayName: Update ProductDiscount by Key
84-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
84+
securedBy: [oauth_2_0: { scopes: ['manage_product_discounts:{projectKey}', 'manage_products:{projectKey}'] }]
8585
body:
8686
application/json:
8787
example: !include ../examples/product-discount-update.example.json
@@ -92,7 +92,7 @@ post:
9292
example: !include ../examples/product-discount-updated.example.json
9393
delete:
9494
displayName: Delete ProductDiscount by Key
95-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
95+
securedBy: [oauth_2_0: { scopes: ['manage_product_discounts:{projectKey}', 'manage_products:{projectKey}'] }]
9696
responses:
9797
200:
9898
body:
@@ -107,19 +107,19 @@ post:
107107
resourceUpdateType: ProductDiscountUpdate
108108
get:
109109
displayName: Get ProductDiscount by ID
110-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
110+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
111111
responses:
112112
200:
113113
body:
114114
application/json:
115115
example: !include ../examples/product-discount.example.json
116116
head:
117117
displayName: Check if ProductDiscount exists by ID
118-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
118+
securedBy: [oauth_2_0: { scopes: ['view_product_discounts:{projectKey}', 'view_products:{projectKey}'] }]
119119
description: Checks if a ProductDiscount exists with the provided `id`. Returns a `200` status if the ProductDiscount exists, or a `404` status otherwise.
120120
post:
121121
displayName: Update ProductDiscount by ID
122-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
122+
securedBy: [oauth_2_0: { scopes: ['manage_product_discounts:{projectKey}', 'manage_products:{projectKey}'] }]
123123
body:
124124
application/json:
125125
example: !include ../examples/product-discount-update.example.json
@@ -130,7 +130,7 @@ post:
130130
example: !include ../examples/product-discount-updated.example.json
131131
delete:
132132
displayName: Delete ProductDiscount by ID
133-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
133+
securedBy: [oauth_2_0: { scopes: ['manage_product_discounts:{projectKey}', 'manage_products:{projectKey}'] }]
134134
responses:
135135
200:
136136
body:

api-specs/api/resources/product-types.raml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ description: |
1313
of many concrete products.
1414
get:
1515
displayName: Query ProductTypes
16-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
16+
securedBy: [oauth_2_0: { scopes: ['view_product_types:{projectKey}', 'view_products:{projectKey}'] }]
1717
responses:
1818
200:
1919
body:
2020
application/json:
2121
example: !include ../examples/product-types.example.json
2222
head:
2323
displayName: Check if ProductType exists by Query Predicate
24-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
24+
securedBy: [oauth_2_0: { scopes: ['view_product_types:{projectKey}', 'view_products:{projectKey}'] }]
2525
description: Checks if one or more ProductTypes exist for the provided query predicate. Returns a `200` status if any ProductTypes match the query predicate, or a `404` status otherwise.
2626
queryParameters:
2727
where?:
2828
type: QueryPredicate
2929
description: Query Predicates on Attributes are limited to `text`, `enum`, `boolean`, `number`, `date`, `time`, and `datetime` attribute types.
3030
post:
3131
displayName: Create ProductType
32-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
32+
securedBy: [oauth_2_0: { scopes: ['manage_product_types:{projectKey}', 'manage_products:{projectKey}'] }]
3333
body:
3434
application/json:
3535
example: !include ../examples/product-type-create.example.json
@@ -47,19 +47,19 @@ post:
4747
resourceUpdateType: ProductTypeUpdate
4848
get:
4949
displayName: Get ProductType by Key
50-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
50+
securedBy: [oauth_2_0: { scopes: ['view_product_types:{projectKey}', 'view_products:{projectKey}'] }]
5151
responses:
5252
200:
5353
body:
5454
application/json:
5555
example: !include ../examples/product-type.example.json
5656
head:
5757
displayName: Check if ProductType exists by Key
58-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
58+
securedBy: [oauth_2_0: { scopes: ['view_product_types:{projectKey}', 'view_products:{projectKey}'] }]
5959
description: Checks if a ProductType exists with the provided `key`. Returns a `200` status if the ProductType exists, or a `404` status otherwise.
6060
post:
6161
displayName: Update ProductType by Key
62-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
62+
securedBy: [oauth_2_0: { scopes: ['manage_product_types:{projectKey}', 'manage_products:{projectKey}'] }]
6363
body:
6464
application/json:
6565
example: !include ../examples/product-type-update.example.json
@@ -70,7 +70,7 @@ post:
7070
example: !include ../examples/product-type.example.json
7171
delete:
7272
displayName: Delete ProductType by Key
73-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
73+
securedBy: [oauth_2_0: { scopes: ['manage_product_types:{projectKey}', 'manage_products:{projectKey}'] }]
7474
responses:
7575
200:
7676
body:
@@ -85,19 +85,19 @@ post:
8585
resourceUpdateType: ProductTypeUpdate
8686
get:
8787
displayName: Get ProductType by ID
88-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
88+
securedBy: [oauth_2_0: { scopes: ['view_product_types:{projectKey}', 'view_products:{projectKey}'] }]
8989
responses:
9090
200:
9191
body:
9292
application/json:
9393
example: !include ../examples/product-type.example.json
9494
head:
9595
displayName: Check if ProductType exists by ID
96-
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
96+
securedBy: [oauth_2_0: { scopes: ['view_product_types:{projectKey}', 'view_products:{projectKey}'] }]
9797
description: Checks if a ProductType exists with the provided `id`. Returns a `200` status if the ProductType exists, or a `404` status otherwise.
9898
post:
9999
displayName: Update ProductType by ID
100-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
100+
securedBy: [oauth_2_0: { scopes: ['manage_product_types:{projectKey}', 'manage_products:{projectKey}'] }]
101101
body:
102102
application/json:
103103
example: !include ../examples/product-type-update.example.json
@@ -108,7 +108,7 @@ post:
108108
example: !include ../examples/product-type.example.json
109109
delete:
110110
displayName: Delete ProductType by ID
111-
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
111+
securedBy: [oauth_2_0: { scopes: ['manage_product_types:{projectKey}', 'manage_products:{projectKey}'] }]
112112
responses:
113113
200:
114114
body:

api-specs/api/resources/zones.raml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: Zones allow defining ShippingRates for specific Locations.
1212
get:
1313
displayName: Query Zones
1414
description: Retrieves all Zones in the Project.
15-
securedBy: [oauth_2_0: { scopes: ['view_orders:{projectKey}'] }]
15+
securedBy: [oauth_2_0: { scopes: ['view_zones:{projectKey}', 'view_orders:{projectKey}'] }]
1616
responses:
1717
200:
1818
body:
@@ -21,14 +21,14 @@ get:
2121
head:
2222
displayName: Check if Zone exists by Query Predicate
2323
description: Checks if one or more Zones exist for the provided query predicate. Returns a `200 OK` status if any Zones match the query predicate, or a [Not Found](/../api/errors#404-not-found) error otherwise.
24-
securedBy: [oauth_2_0: { scopes: ['view_orders:{projectKey}'] }]
24+
securedBy: [oauth_2_0: { scopes: ['view_zones:{projectKey}', 'view_orders:{projectKey}'] }]
2525
queryParameters:
2626
where?:
2727
type: QueryPredicate[]
2828
post:
2929
displayName: Create Zone
3030
description: Creates a Zone in the Project.
31-
securedBy: [oauth_2_0: { scopes: ['manage_orders:{projectKey}'] }]
31+
securedBy: [oauth_2_0: { scopes: ['manage_zones:{projectKey}', 'manage_orders:{projectKey}'] }]
3232
body:
3333
application/json:
3434
example: !include ../examples/zone-create.example.json
@@ -47,7 +47,7 @@ post:
4747
get:
4848
displayName: Get Zone by Key
4949
description: Retrieves a Zone with the provided `key`.
50-
securedBy: [oauth_2_0: { scopes: ['view_orders:{projectKey}'] }]
50+
securedBy: [oauth_2_0: { scopes: ['view_zones:{projectKey}', 'view_orders:{projectKey}'] }]
5151
responses:
5252
200:
5353
body:
@@ -56,11 +56,11 @@ post:
5656
head:
5757
displayName: Check if Zone exists by Key
5858
description: Checks if a Zone exists with the provided `key`. Returns a `200 OK` status if the Zone exists or a [Not Found](/../api/errors#404-not-found) error otherwise.
59-
securedBy: [oauth_2_0: { scopes: ['view_orders:{projectKey}'] }]
59+
securedBy: [oauth_2_0: { scopes: ['view_zones:{projectKey}', 'view_orders:{projectKey}'] }]
6060
post:
6161
displayName: Update Zone by Key
6262
description: Updates a Zone in the Project using one or more [update actions](/../api/projects/zones#update-actions).
63-
securedBy: [oauth_2_0: { scopes: ['manage_orders:{projectKey}'] }]
63+
securedBy: [oauth_2_0: { scopes: ['manage_zones:{projectKey}', 'manage_orders:{projectKey}'] }]
6464
body:
6565
application/json:
6666
example: !include ../examples/zone-update.example.json
@@ -72,7 +72,7 @@ post:
7272
delete:
7373
displayName: Delete Zone by Key
7474
description: Deletes a Zone in the Project.
75-
securedBy: [oauth_2_0: { scopes: ['manage_orders:{projectKey}'] }]
75+
securedBy: [oauth_2_0: { scopes: ['manage_zones:{projectKey}', 'manage_orders:{projectKey}'] }]
7676
responses:
7777
200:
7878
body:
@@ -88,7 +88,7 @@ post:
8888
get:
8989
displayName: Get Zone by ID
9090
description: Retrieves a Zone with the provided `id`.
91-
securedBy: [oauth_2_0: { scopes: ['view_orders:{projectKey}'] }]
91+
securedBy: [oauth_2_0: { scopes: ['view_zones:{projectKey}', 'view_orders:{projectKey}'] }]
9292
responses:
9393
200:
9494
body:
@@ -97,10 +97,10 @@ post:
9797
head:
9898
displayName: Check if Zone exists by ID
9999
description: Checks if a Zone exists with the provided `id`. Returns a `200 OK` status if the Zone exists or a [Not Found](/../api/errors#404-not-found) error otherwise.
100-
securedBy: [oauth_2_0: { scopes: ['view_orders:{projectKey}'] }]
100+
securedBy: [oauth_2_0: { scopes: ['view_zones:{projectKey}', 'view_orders:{projectKey}'] }]
101101
post:
102102
displayName: Update Zone by ID
103-
securedBy: [oauth_2_0: { scopes: ['manage_orders:{projectKey}'] }]
103+
securedBy: [oauth_2_0: { scopes: ['manage_zones:{projectKey}', 'manage_orders:{projectKey}'] }]
104104
body:
105105
application/json:
106106
example: !include ../examples/zone-update.example.json
@@ -112,7 +112,7 @@ post:
112112
delete:
113113
displayName: Delete Zone by ID
114114
description: Deletes a Zone in the Project.
115-
securedBy: [oauth_2_0: { scopes: ['manage_orders:{projectKey}'] }]
115+
securedBy: [oauth_2_0: { scopes: ['manage_zones:{projectKey}', 'manage_orders:{projectKey}'] }]
116116
responses:
117117
200:
118118
body:

0 commit comments

Comments
 (0)