Skip to content

Commit 020bd27

Browse files
committed
Updated API from documentation release
1 parent 6732602 commit 020bd27

File tree

8 files changed

+274
-8
lines changed

8 files changed

+274
-8
lines changed

api-specs/api/examples/shopping-list-create.example.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,9 @@
3131
},
3232
"quantity": 5
3333
}
34-
]
34+
],
35+
"businessUnit": {
36+
"key": "bu-345-france",
37+
"typeId": "business-unit"
38+
}
3539
}

api-specs/api/examples/shopping-list.example.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
"addedAt": "2022-08-22T14:11:03.572Z"
4242
}
4343
],
44+
"businessUnit": {
45+
"key": "bu-345-france",
46+
"typeId": "business-unit"
47+
},
4448
"deleteDaysAfterLastModification": 100,
4549
"createdAt": "2022-08-22T14:11:03.587Z",
4650
"lastModifiedAt": "2022-08-22T14:11:03.587Z"

api-specs/api/examples/shopping-lists.example.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
"key": "test",
1414
"lineItems": [],
1515
"textLineItems": [],
16+
"businessUnit": {
17+
"key": "bu-345-france",
18+
"typeId": "business-unit"
19+
},
1620
"createdAt": "2017-03-30T11:49:40.904Z",
1721
"lastModifiedAt": "2017-03-30T11:49:40.904Z"
1822
}

api-specs/api/resources/as-associate.raml

Lines changed: 190 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,196 @@ type: base
390390
example: !include ../examples/b2b-cart.example.json
391391
type: Cart
392392
securedBy: [oauth_2_0: { scopes: ['manage_orders:{projectKey}'] }]
393+
/shopping-lists:
394+
type:
395+
baseDomain:
396+
resourceType: ShoppingList
397+
resourceQueryType: ShoppingListPagedQueryResponse
398+
resourceDraft: ShoppingListDraft
399+
whereExample: 'key = "my-shopping-list"'
400+
sortExample: createdAt asc
401+
description: |
402+
shopping-lists e.g. for wishlist support
403+
get:
404+
displayName: Query ShoppingLists in BusinessUnit
405+
securedBy: [oauth_2_0: { scopes: ['view_shopping_lists:{projectKey}'] }]
406+
queryParameters:
407+
expand:
408+
description: |
409+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
410+
type: Expansion[]
411+
required: false
412+
responses:
413+
200:
414+
body:
415+
application/json:
416+
example: !include ../examples/shopping-lists.example.json
417+
head:
418+
displayName: Check if ShoppingList exists in BusinessUnit by Query Predicate
419+
securedBy: [oauth_2_0: { scopes: ['view_shopping_lists:{projectKey}'] }]
420+
description: |
421+
Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` if any ShoppingLists match the Query Predicate; otherwise, returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
422+
queryParameters:
423+
where?:
424+
type: QueryPredicate[]
425+
post:
426+
displayName: Create ShoppingList in BusinessUnit
427+
securedBy:
428+
[oauth_2_0: { scopes: ['manage_shopping_lists:{projectKey}'] }]
429+
queryParameters:
430+
expand:
431+
description: |
432+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
433+
type: Expansion[]
434+
required: false
435+
body:
436+
application/json:
437+
example: !include ../examples/shopping-list-create.example.json
438+
description: |
439+
Creates a ShoppingList in the [BusinessUnit](ctp:api:type:BusinessUnit) referenced by `businessUnitKey`. As such, the `businessUnit` field on [ShoppingListDraft](ctp:api:type:ShoppingListDraft) is ignored for this request.
440+
responses:
441+
201:
442+
body:
443+
application/json:
444+
example: !include ../examples/shopping-list.example.json
445+
/key={key}:
446+
(methodName): withKey
447+
type:
448+
baseResource:
449+
uriParameterName: key
450+
resourceType: ShoppingList
451+
resourceUpdateType: ShoppingListUpdate
452+
get:
453+
displayName: Get ShoppingList in BusinessUnit by Key
454+
securedBy:
455+
[oauth_2_0: { scopes: ['view_shopping_lists:{projectKey}'] }]
456+
queryParameters:
457+
expand:
458+
description: |
459+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
460+
type: Expansion[]
461+
required: false
462+
description: |
463+
If the ShoppingList exists in the Project but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
464+
responses:
465+
200:
466+
body:
467+
application/json:
468+
example: !include ../examples/shopping-list.example.json
469+
head:
470+
displayName: Check if ShoppingList exists in BusinessUnit by Key
471+
securedBy:
472+
[oauth_2_0: { scopes: ['view_shopping_lists:{projectKey}'] }]
473+
description: |
474+
Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` if the ShoppingList exists; otherwise, returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
475+
post:
476+
displayName: Update ShoppingList in BusinessUnit by Key
477+
securedBy:
478+
[oauth_2_0: { scopes: ['manage_shopping_lists:{projectKey}'] }]
479+
queryParameters:
480+
expand:
481+
description: |
482+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
483+
type: Expansion[]
484+
required: false
485+
description: |
486+
If the Shopping List exists in the [Project](ctp:api:type:Project) but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
487+
body:
488+
application/json:
489+
example: !include ../examples/shopping-list-update.example.json
490+
responses:
491+
200:
492+
body:
493+
application/json:
494+
example: !include ../examples/shopping-list.example.json
495+
delete:
496+
displayName: Delete ShoppingList in BusinessUnit by Key
497+
is:
498+
- dataErasure
499+
securedBy:
500+
[oauth_2_0: { scopes: ['manage_shopping_lists:{projectKey}'] }]
501+
queryParameters:
502+
expand:
503+
description: |
504+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
505+
type: Expansion[]
506+
required: false
507+
description: |
508+
If the ShoppingList exists in the Project but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
509+
responses:
510+
200:
511+
body:
512+
application/json:
513+
example: !include ../examples/shopping-list.example.json
514+
/{ID}:
515+
(methodName): withId
516+
type:
517+
baseResource:
518+
uriParameterName: ID
519+
resourceType: ShoppingList
520+
resourceUpdateType: ShoppingListUpdate
521+
get:
522+
displayName: Get ShoppingList in BusinessUnit by ID
523+
securedBy:
524+
[oauth_2_0: { scopes: ['view_shopping_lists:{projectKey}'] }]
525+
queryParameters:
526+
expand:
527+
description: |
528+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
529+
type: Expansion[]
530+
required: false
531+
description: |
532+
If the ShoppingList exists in the Project but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
533+
responses:
534+
200:
535+
body:
536+
application/json:
537+
example: !include ../examples/shopping-list.example.json
538+
head:
539+
displayName: Check if ShoppingList exists in BusinessUnit by ID
540+
securedBy:
541+
[oauth_2_0: { scopes: ['view_shopping_lists:{projectKey}'] }]
542+
description: |
543+
Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` if the ShoppingList exists; otherwise, returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
544+
post:
545+
displayName: Update ShoppingList in BusinessUnit by ID
546+
securedBy:
547+
[oauth_2_0: { scopes: ['manage_shopping_lists:{projectKey}'] }]
548+
queryParameters:
549+
expand:
550+
description: |
551+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
552+
type: Expansion[]
553+
required: false
554+
body:
555+
application/json:
556+
example: !include ../examples/shopping-list-update.example.json
557+
description: |
558+
If the ShoppingList exists in the Project but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
559+
responses:
560+
200:
561+
body:
562+
application/json:
563+
example: !include ../examples/shopping-list.example.json
564+
delete:
565+
displayName: Delete ShoppingList in BusinessUnit by ID
566+
is:
567+
- dataErasure
568+
securedBy:
569+
[oauth_2_0: { scopes: ['manage_shopping_lists:{projectKey}'] }]
570+
queryParameters:
571+
expand:
572+
description: |
573+
When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), expand the entire array; you cannot expand only a single element of the array—for example, `expand=lineItems[0].variant` is not supported.
574+
type: Expansion[]
575+
required: false
576+
description: |
577+
If the ShoppingList exists in the Project but does not reference the requested [BusinessUnit](ctp:api:type:BusinessUnit), this method returns an [InvalidOperation](ctp:api:type:InvalidOperationError) error.
578+
responses:
579+
200:
580+
body:
581+
application/json:
582+
example: !include ../examples/shopping-list.example.json
393583
/orders:
394584
type:
395585
baseDomain:

api-specs/api/types/associate-role/Permission.raml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
displayName: Permission
44
type: string
55
description: |
6-
Permissions grant granular access to [Approval Rules](ctp:api:type:ApprovalRule), [Approval Flows](ctp:api:type:ApprovalFlow), [Business Units](ctp:api:type:BusinessUnit), [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), and [Quote Requests](ctp:api:type:QuoteRequest).
6+
Permissions grant granular access to [Approval Rules](ctp:api:type:ApprovalRule), [Approval Flows](ctp:api:type:ApprovalFlow), [Business Units](ctp:api:type:BusinessUnit), [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), [Quote Requests](ctp:api:type:QuoteRequest), and [Shopping Lists](ctp:api:type:ShoppingList).
77
enum:
88
- AddChildUnits
99
- UpdateAssociates
@@ -44,6 +44,14 @@ enum:
4444
- CreateApprovalRules
4545
- UpdateApprovalRules
4646
- UpdateApprovalFlows
47+
- ViewMyShoppingLists
48+
- ViewOthersShoppingLists
49+
- UpdateMyShoppingLists
50+
- UpdateOthersShoppingLists
51+
- CreateMyShoppingLists
52+
- CreateOthersShoppingLists
53+
- DeleteMyShoppingLists
54+
- DeleteOthersShoppingLists
4755
(enumDescriptions):
4856
AddChildUnits: |
4957
An Associate can create a child Business Unit.
@@ -123,6 +131,22 @@ enum:
123131
An Associate can update Approval Rules.
124132
UpdateApprovalFlows: |
125133
An Associate can update Approval Flows.
134+
CreateMyShoppingLists: |
135+
An Associate can create their own B2B Shopping Lists.
136+
CreateOthersShoppingLists: |
137+
An Associate can create B2B Shopping Lists that belong to other Associates.
138+
DeleteMyShoppingLists: |
139+
An Associate can delete their own B2B Shopping Lists.
140+
DeleteOthersShoppingLists: |
141+
An Associate can delete B2B Shopping Lists that belong to other Associates.
142+
UpdateMyShoppingLists: |
143+
An Associate can update their own B2B Shopping Lists.
144+
UpdateOthersShoppingLists: |
145+
An Associate can update B2B Shopping Lists that belong to other Associates.
146+
ViewMyShoppingLists: |
147+
An Associate can view their own B2B Shopping Lists.
148+
ViewOthersShoppingLists: |
149+
An Associate can view B2B Shopping Lists that belong to other Associates.
126150
(enumGroups):
127151
AddChildUnits: Business Unit Permissions
128152
UpdateAssociates: Business Unit Permissions
@@ -163,3 +187,11 @@ enum:
163187
CreateApprovalRules: Approval Rule Permissions
164188
UpdateApprovalRules: Approval Rule Permissions
165189
UpdateApprovalFlows: Approval Flow Permissions
190+
ViewMyShoppingLists: Shopping List Permissions
191+
ViewOthersShoppingLists: Shopping List Permissions
192+
UpdateMyShoppingLists: Shopping List Permissions
193+
UpdateOthersShoppingLists: Shopping List Permissions
194+
CreateMyShoppingLists: Shopping List Permissions
195+
CreateOthersShoppingLists: Shopping List Permissions
196+
DeleteMyShoppingLists: Shopping List Permissions
197+
DeleteOthersShoppingLists: Shopping List Permissions

api-specs/api/types/business-unit/BusinessUnit.raml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ properties:
5151
description: |
5252
References to [Stores](ctp:api:type:Store) the Business Unit is associated with. Only present when `storeMode` is `Explicit`.
5353
54-
If the Business Unit has Stores defined, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), or [Quote Requests](ctp:api:type:QuoteRequest) must belong to one of the Business Unit's Stores.
54+
If the Business Unit has Stores defined, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), [Quote Requests](ctp:api:type:QuoteRequest), or [Shopping Lists](ctp:api:type:ShoppingList) must belong to one of the Business Unit's Stores.
5555
56-
If the Business Unit has no Stores, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), or [Quote Requests](ctp:api:type:QuoteRequest) must not belong to any Store.
56+
If the Business Unit has no Stores, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), [Quote Requests](ctp:api:type:QuoteRequest), or [Shopping Lists](ctp:api:type:ShoppingList) must not belong to any Store.
5757
inheritedStores?:
5858
type: StoreKeyReference[]
5959
description: |

api-specs/api/types/business-unit/BusinessUnitDraft.raml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ properties:
2323
Sets the [Stores](ctp:api:type:Store) the Business Unit is associated with. Can only be set when `storeMode` is `Explicit`.
2424
Defaults to empty for [Companies](ctp:api:type:BusinessUnitType) and not set for [Divisions](ctp:api:type:BusinessUnitType).
2525
26-
If the Business Unit has Stores defined, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), or [Quote Requests](ctp:api:type:QuoteRequest) must belong to one of the Business Unit's Stores.
26+
If the Business Unit has Stores defined, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), [Quote Requests](ctp:api:type:QuoteRequest), or [Shopping Lists](ctp:api:type:ShoppingList) must belong to one of the Business Unit's Stores.
2727
28-
If the Business Unit has no Stores, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), or [Quote Requests](ctp:api:type:QuoteRequest) must not belong to any Store.
28+
If the Business Unit has no Stores, then all of its [Carts](ctp:api:type:Cart), [Orders](ctp:api:type:Order), [Quotes](ctp:api:type:Quote), [Quote Requests](ctp:api:type:QuoteRequest), or [Shopping Lists](ctp:api:type:ShoppingList) must not belong to any Store.
2929
storeMode?:
3030
type: BusinessUnitStoreMode
3131
description: |

0 commit comments

Comments
 (0)