Skip to content

Commit e3d5bc9

Browse files
committed
Updated API from documentation release
1 parent 7d500b7 commit e3d5bc9

File tree

3 files changed

+234
-1
lines changed

3 files changed

+234
-1
lines changed

api-specs/api/resources/in-store.raml

Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3890,3 +3890,216 @@ uriParameters:
38903890
body:
38913891
application/json:
38923892
example: !include ../examples/quote.example.json
3893+
/business-units:
3894+
type:
3895+
baseDomain:
3896+
resourceType: BusinessUnit
3897+
resourceQueryType: BusinessUnitPagedQueryResponse
3898+
resourceDraft: BusinessUnitDraft
3899+
whereExample: 'name = "Some company"'
3900+
sortExample: createdAt asc
3901+
(updateable): BusinessUnit
3902+
(deleteable): BusinessUnit
3903+
(createable): BusinessUnitDraft
3904+
description: A Business Unit can represent a Company or a Division.
3905+
get:
3906+
securedBy:
3907+
[
3908+
oauth_2_0:
3909+
{
3910+
scopes:
3911+
[
3912+
'view_business_units:{projectKey}',
3913+
'view_business_units:{projectKey}:{storeKey}',
3914+
],
3915+
},
3916+
]
3917+
responses:
3918+
200:
3919+
body:
3920+
application/json:
3921+
example: !include ../examples/business-units.example.json
3922+
head:
3923+
securedBy:
3924+
[
3925+
oauth_2_0:
3926+
{
3927+
scopes:
3928+
[
3929+
'view_business_units:{projectKey}',
3930+
'view_business_units:{projectKey}:{storeKey}',
3931+
],
3932+
},
3933+
]
3934+
description: Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate or a `404 Not Found` otherwise.
3935+
queryParameters:
3936+
where?:
3937+
type: QueryPredicate[]
3938+
post:
3939+
securedBy:
3940+
[
3941+
oauth_2_0:
3942+
{
3943+
scopes:
3944+
[
3945+
'manage_business_units:{projectKey}',
3946+
'manage_business_units:{projectKey}:{storeKey}',
3947+
],
3948+
},
3949+
]
3950+
body:
3951+
application/json:
3952+
example: !include ../examples/business-unit-create.example.json
3953+
responses:
3954+
201:
3955+
body:
3956+
application/json:
3957+
example: !include ../examples/business-unit.example.json
3958+
/key={key}:
3959+
(methodName): withKey
3960+
type:
3961+
baseResource:
3962+
uriParameterName: key
3963+
resourceType: BusinessUnit
3964+
resourceUpdateType: BusinessUnitUpdate
3965+
get:
3966+
securedBy:
3967+
[
3968+
oauth_2_0:
3969+
{
3970+
scopes:
3971+
[
3972+
'view_business_units:{projectKey}',
3973+
'view_business_units:{projectKey}:{storeKey}',
3974+
],
3975+
},
3976+
]
3977+
responses:
3978+
200:
3979+
body:
3980+
application/json:
3981+
example: !include ../examples/business-unit.example.json
3982+
head:
3983+
securedBy:
3984+
[
3985+
oauth_2_0:
3986+
{
3987+
scopes:
3988+
[
3989+
'view_business_units:{projectKey}',
3990+
'view_business_units:{projectKey}:{storeKey}',
3991+
],
3992+
},
3993+
]
3994+
description: Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise.
3995+
post:
3996+
securedBy:
3997+
[
3998+
oauth_2_0:
3999+
{
4000+
scopes:
4001+
[
4002+
'manage_business_units:{projectKey}',
4003+
'manage_business_units:{projectKey}:{storeKey}',
4004+
],
4005+
},
4006+
]
4007+
body:
4008+
application/json:
4009+
example: !include ../examples/business-unit-update.example.json
4010+
responses:
4011+
200:
4012+
body:
4013+
application/json:
4014+
example: !include ../examples/business-unit.example.json
4015+
delete:
4016+
securedBy:
4017+
[
4018+
oauth_2_0:
4019+
{
4020+
scopes:
4021+
[
4022+
'manage_business_units:{projectKey}',
4023+
'manage_business_units:{projectKey}:{storeKey}',
4024+
],
4025+
},
4026+
]
4027+
responses:
4028+
200:
4029+
body:
4030+
application/json:
4031+
example: !include ../examples/business-unit.example.json
4032+
/{ID}:
4033+
(methodName): withId
4034+
type:
4035+
baseResource:
4036+
uriParameterName: ID
4037+
resourceType: BusinessUnit
4038+
resourceUpdateType: BusinessUnitUpdate
4039+
get:
4040+
securedBy:
4041+
[
4042+
oauth_2_0:
4043+
{
4044+
scopes:
4045+
[
4046+
'view_business_units:{projectKey}',
4047+
'view_business_units:{projectKey}:{storeKey}',
4048+
],
4049+
},
4050+
]
4051+
responses:
4052+
200:
4053+
body:
4054+
application/json:
4055+
example: !include ../examples/business-unit.example.json
4056+
head:
4057+
securedBy:
4058+
[
4059+
oauth_2_0:
4060+
{
4061+
scopes:
4062+
[
4063+
'view_business_units:{projectKey}',
4064+
'view_business_units:{projectKey}:{storeKey}',
4065+
],
4066+
},
4067+
]
4068+
description: Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise.
4069+
post:
4070+
securedBy:
4071+
[
4072+
oauth_2_0:
4073+
{
4074+
scopes:
4075+
[
4076+
'manage_business_units:{projectKey}',
4077+
'manage_business_units:{projectKey}:{storeKey}',
4078+
],
4079+
},
4080+
]
4081+
body:
4082+
application/json:
4083+
example: !include ../examples/business-unit-update.example.json
4084+
responses:
4085+
200:
4086+
body:
4087+
application/json:
4088+
example: !include ../examples/business-unit.example.json
4089+
delete:
4090+
securedBy:
4091+
[
4092+
oauth_2_0:
4093+
{
4094+
scopes:
4095+
[
4096+
'manage_business_units:{projectKey}',
4097+
'manage_business_units:{projectKey}:{storeKey}',
4098+
],
4099+
},
4100+
]
4101+
responses:
4102+
200:
4103+
body:
4104+
application/json:
4105+
example: !include ../examples/business-unit.example.json

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ properties:
5454
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.
5555
5656
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.
57+
inheritedStores?:
58+
type: StoreKeyReference[]
59+
description: |
60+
Stores that are inherited from a parent Business Unit. The value of this field is [eventually consistent](/../api/general-concepts#eventual-consistency) and is only present when the `storeMode` is set to `FromParent`.
5761
storeMode:
5862
type: BusinessUnitStoreMode
5963
description: |

api-specs/graphql/schema.sdl

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4845,6 +4845,13 @@ type InStore implements CartDiscountQueryInterface & CartQueryInterface & Custom
48454845
"Queries with specified key"
48464846
key: String): Quote
48474847
quotes(where: String, sort: [String!], limit: Int, offset: Int): QuoteQueryResult!
4848+
businessUnit(
4849+
"Queries with specified ID"
4850+
id: String,
4851+
4852+
"Queries with specified key"
4853+
key: String): BusinessUnit
4854+
businessUnits(where: String, sort: [String!], limit: Int, offset: Int): BusinessUnitQueryResult!
48484855
}
48494856

48504857
type InStoreMe implements MeQueryInterface & CartQueryInterface & ActiveCartInterface & OrderQueryInterface & ShoppingListQueryInterface {
@@ -6449,19 +6456,28 @@ type Mutation {
64496456
createBusinessUnit(draft: BusinessUnitDraft!,
64506457

64516458
"Create/modify entity as an associate in business-unit."
6452-
asAssociate: AsAssociateArgument): BusinessUnit
6459+
asAssociate: AsAssociateArgument,
6460+
6461+
"The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions."
6462+
storeKey: KeyReferenceInput): BusinessUnit
64536463
updateBusinessUnit(version: Long!, actions: [BusinessUnitUpdateAction!]!,
64546464

64556465
"Create/modify entity as an associate in business-unit."
64566466
asAssociate: AsAssociateArgument,
64576467

6468+
"The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions."
6469+
storeKey: KeyReferenceInput,
6470+
64586471
"Queries with specified ID"
64596472
id: String,
64606473

64616474
"Queries with specified key"
64626475
key: String): BusinessUnit
64636476
deleteBusinessUnit(version: Long!, personalDataErasure: Boolean = false,
64646477

6478+
"The mutation is only performed if the resource is part of the store. Can be used with store-specific OAuth permissions."
6479+
storeKey: KeyReferenceInput,
6480+
64656481
"Queries with specified ID"
64666482
id: String,
64676483

0 commit comments

Comments
 (0)