Skip to content

Commit ce170ce

Browse files
committed
Updated API from documentation release
1 parent 54b213f commit ce170ce

File tree

8 files changed

+66
-0
lines changed

8 files changed

+66
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"action": "lockCart"
3+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"action": "unlockCart"
3+
}

api-specs/api/types/cart/Cart.raml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ properties:
196196
type: DiscountTypeCombination
197197
description: |
198198
Indicates if a combination of discount types can apply on a Cart.
199+
lock?:
200+
type: CartLock
201+
description: |
202+
Indicates whether the Cart has been [locked](/../api/carts-orders-overview#lock-a-cart), preventing edits.
199203
deleteDaysAfterLastModification?:
200204
type: integer
201205
description: |
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#%RAML 1.0 DataType
2+
(package): Cart
3+
displayName: CartLock
4+
type: object
5+
description: |
6+
Indicates that the Cart is [locked](/../api/carts-orders-overview#lock-a-cart) to prevent changes.
7+
Provides metadata about when the lock was created and which
8+
[API Client](ctp:api:type:ApiClient) initiated it.
9+
properties:
10+
createdAt:
11+
type: datetime
12+
description: |
13+
Date and time (UTC) the Cart was locked.
14+
clientId:
15+
type: string
16+
description: |
17+
`id` of the [API Client](ctp:api:type:ApiClient) that locked the Cart.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#%RAML 1.0 DataType
2+
(package): Cart
3+
type: CartUpdateAction
4+
displayName: CartLockCartAction
5+
discriminatorValue: lockCart
6+
example: !include ../../../examples/Cart/CartLockCartAction.json
7+
description: |
8+
[Locks](/../api/carts-orders-overview#lock-a-cart) a Cart, preventing all updates from API Clients without an elevated [OAuth 2.0 Scope](/../api/scopes).
9+
This action sets the Cart's `lock` [field](/projects/carts#cart) which identifies the API Client that locked the Cart and when the lock was applied.
10+
This action requires an additional OAuth 2.0 Scope `manage_locked_carts`.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#%RAML 1.0 DataType
2+
(package): Cart
3+
type: CartUpdateAction
4+
displayName: CartUnlockCartAction
5+
discriminatorValue: unlockCart
6+
example: !include ../../../examples/Cart/CartUnlockCartAction.json
7+
description: |
8+
Unlocks a Cart, removing all update restrictions that are in place while a Cart is [locked](/../api/carts-orders-overview#lock-a-cart).
9+
This action requires an additional OAuth 2.0 Scope `manage_locked_carts`.

api-specs/api/types/types.raml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ CartDiscountSetValidUntilAction: !include cart-discount/updates/CartDiscountSetV
192192
BestDeal: !include cart/BestDeal.raml
193193
Cart: !include cart/Cart.raml
194194
CartDraft: !include cart/CartDraft.raml
195+
CartLock: !include cart/CartLock.raml
195196
CartMergeMode: !include cart/CartMergeMode.raml
196197
CartOrigin: !include cart/CartOrigin.raml
197198
CartPagedQueryResponse: !include cart/CartPagedQueryResponse.raml
@@ -274,6 +275,7 @@ CartChangeTaxCalculationModeAction: !include cart/updates/CartChangeTaxCalculati
274275
CartChangeTaxModeAction: !include cart/updates/CartChangeTaxModeAction.raml
275276
CartChangeTaxRoundingModeAction: !include cart/updates/CartChangeTaxRoundingModeAction.raml
276277
CartFreezeCartAction: !include cart/updates/CartFreezeCartAction.raml
278+
CartLockCartAction: !include cart/updates/CartLockCartAction.raml
277279
CartRecalculateAction: !include cart/updates/CartRecalculateAction.raml
278280
CartRemoveCustomLineItemAction: !include cart/updates/CartRemoveCustomLineItemAction.raml
279281
CartRemoveDiscountCodeAction: !include cart/updates/CartRemoveDiscountCodeAction.raml
@@ -328,6 +330,7 @@ CartSetShippingMethodTaxAmountAction: !include cart/updates/CartSetShippingMetho
328330
CartSetShippingMethodTaxRateAction: !include cart/updates/CartSetShippingMethodTaxRateAction.raml
329331
CartSetShippingRateInputAction: !include cart/updates/CartSetShippingRateInputAction.raml
330332
CartUnfreezeCartAction: !include cart/updates/CartUnfreezeCartAction.raml
333+
CartUnlockCartAction: !include cart/updates/CartUnlockCartAction.raml
331334
CartUpdateItemShippingAddressAction: !include cart/updates/CartUpdateItemShippingAddressAction.raml
332335
Category: !include category/Category.raml
333336
CategoryDraft: !include category/CategoryDraft.raml

api-specs/graphql/schema.sdl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1836,6 +1836,7 @@ type Cart implements Versioned & ReferenceExpandable {
18361836
discountTypeCombination: DiscountTypeCombination
18371837
cartState: CartState!
18381838
key: String
1839+
lock: CartLock
18391840
custom: CustomFieldsType
18401841
deleteDaysAfterLastModification: Int
18411842
totalLineItemQuantity: Long
@@ -2114,6 +2115,12 @@ type CartLimitsProjection {
21142115
total: CartLimitWithCurrent!
21152116
}
21162117

2118+
"Prevents edits on a Cart unless the caller has the `manage_locked_carts` OAuth scope."
2119+
type CartLock {
2120+
createdAt: DateTime!
2121+
clientId: String!
2122+
}
2123+
21172124
enum CartMergeMode {
21182125
"""
21192126
`LineItem`s of the anonymous cart will be copied to the customer’s active cart that has been modified most recently.
@@ -2253,6 +2260,8 @@ input CartUpdateAction {
22532260
updateItemShippingAddress: UpdateCartItemShippingAddress
22542261
freezeCart: FreezeCart
22552262
unfreezeCart: UnfreezeCart
2263+
lockCart: LockCart
2264+
unlockCart: UnlockCart
22562265
applyDeltaToLineItemShippingDetailsTargets: ApplyCartDeltaToLineItemShippingDetailsTargets
22572266
applyDeltaToCustomLineItemShippingDetailsTargets: ApplyCartDeltaToCustomLineItemShippingDetailsTargets
22582267
addLineItem: AddCartLineItem
@@ -5849,6 +5858,10 @@ type Location {
58495858
state: String
58505859
}
58515860

5861+
input LockCart {
5862+
dummy: String
5863+
}
5864+
58525865
"The `Long` scalar type represents non-fractional signed whole numeric values. Long can represent values between -(2^63) and 2^63 - 1."
58535866
scalar Long
58545867

@@ -16796,6 +16809,10 @@ input UnfreezeCart {
1679616809
dummy: String
1679716810
}
1679816811

16812+
input UnlockCart {
16813+
dummy: String
16814+
}
16815+
1679916816
input UnpublishProduct {
1680016817
dummy: String
1680116818
}

0 commit comments

Comments
 (0)