Skip to content

Commit ebe8dbf

Browse files
committed
Updated API from documentation release
1 parent bc6c0e3 commit ebe8dbf

12 files changed

+80
-2
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"action": "setInventoryLimits",
3+
"minCartQuantity": 2,
4+
"maxCartQuantity": 50
5+
}

api-specs/api/examples/inventories.example.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
"quantityOnStock": 4,
1212
"availableQuantity": 4,
1313
"createdAt": "2015-03-11T13:36:20.720Z",
14-
"lastModifiedAt": "2015-03-11T13:36:20.720Z"
14+
"lastModifiedAt": "2015-03-11T13:36:20.720Z",
15+
"minCartQuantity": 2,
16+
"maxCartQuantity": 50
1517
}
1618
]
1719
}

api-specs/api/resources/inventory.raml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ head:
3131
[Time](ctp:api:type:AttributeTimeType), and [DateTime](ctp:api:type:AttributeDateTimeType) attribute types.
3232
post:
3333
displayName: Create InventoryEntry
34-
description: Produces the [InventoryEntryCreated](ctp:api:type:InventoryEntryCreatedMessage) Message.
34+
description: |
35+
Creates an InventoryEntry in the Project.
36+
37+
If quantity limits are provided, existing Line Items that reference a Product Variant with an SKU that matches the Inventory Entry can be affected. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
38+
39+
Produces the [InventoryEntryCreated](ctp:api:type:InventoryEntryCreatedMessage) Message.
3540
securedBy: [oauth_2_0: { scopes: ['manage_products:{projectKey}'] }]
3641
body:
3742
application/json:

api-specs/api/types/cart/updates/CartChangeLineItemQuantityAction.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ description: |
1616
in a single Cart update command.
1717
1818
The [LineItem](ctp:api:type:LineItem) price is set as described in [Line Item price selection](/../api/pricing-and-discounts-overview#line-item-price-selection).
19+
20+
This action is subject to [InventoryEntry](ctp:api:type:InventoryEntry) min/max restrictions when applicable. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
1921
properties:
2022
lineItemId?:
2123
type: string

api-specs/api/types/cart/updates/CartSetLineItemSupplyChannelAction.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ discriminatorValue: setLineItemSupplyChannel
66
example: !include ../../../examples/Cart/CartSetLineItemSupplyChannelAction.json
77
description: |
88
Performing this action does not reserve stock. Stock is only reserved at Order creation if the [InventoryMode](ctp:api:type:InventoryMode) of the Cart is `TrackOnly` or `ReserveOnOrder`.
9+
10+
This action is subject to [InventoryEntry](ctp:api:type:InventoryEntry) min/max restrictions when applicable. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
911
properties:
1012
lineItemId?:
1113
type: string

api-specs/api/types/inventory/InventoryEntry.raml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,16 @@ properties:
5757
format: int64
5858
description: |
5959
Available amount of stock (`quantityOnStock` - reserved).
60+
minCartQuantity?:
61+
type: integer
62+
minimum: 1
63+
description: |
64+
Minimum quantity that can be added to a Cart. See [Quantity limits](/../api/carts-orders-overview#quantity-limits).
65+
maxCartQuantity?:
66+
type: integer
67+
minimum: 1
68+
description: |
69+
Maximum quantity that can be added to a Cart. See [Quantity limits](/../api/carts-orders-overview#quantity-limits).
6070
restockableInDays?:
6171
type: number
6272
format: int64

api-specs/api/types/inventory/InventoryEntryDraft.raml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ properties:
2525
format: int64
2626
description: |
2727
Overall amount of stock.
28+
minCartQuantity?:
29+
type: integer
30+
minimum: 1
31+
description: |
32+
Minimum quantity that can be added to a Cart. See [Quantity limits](/../api/carts-orders-overview#quantity-limits).
33+
maxCartQuantity?:
34+
type: integer
35+
minimum: 1
36+
description: |
37+
Maximum quantity that can be added to a Cart. See [Quantity limits](/../api/carts-orders-overview#quantity-limits).
2838
restockableInDays?:
2939
type: number
3040
format: int64
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#%RAML 1.0 DataType
2+
(package): Inventory
3+
type: InventoryEntryUpdateAction
4+
displayName: InventoryEntrySetInventoryLimitsAction
5+
discriminatorValue: setInventoryLimits
6+
example: !include ../../../examples/Inventory/InventoryEntrySetInventoryLimitsAction.json
7+
description: |
8+
Sets the inventory limits for a specific InventoryEntry. This action allows you to define minimum and maximum
9+
quantities that can be added to a Cart. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
10+
properties:
11+
minCartQuantity?:
12+
type: number
13+
format: int64
14+
description: |
15+
Sets the minimum quantity that can be added to a Cart. If the value is absent or `null`
16+
the inventory limit is removed.
17+
maxCartQuantity?:
18+
type: number
19+
format: int64
20+
description: |
21+
Sets the maximum quantity that can be added to a Cart. If the value is absent or `null`
22+
the inventory limit is removed.

api-specs/api/types/me/updates/MyCartChangeLineItemQuantityAction.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ description: |
1818
When the action applies to [LineItems](ctp:api:type:LineItem) with `ExternalTotal` [LineItemPriceMode](ctp:api:type:LineItemPriceMode),
1919
it will be changed to `ExternalPrice` and the existing `externalPrice` value, i.e. `LineItem.price`, will be retained.
2020
The LineItem total will be calculated by the system instead, so that the `externalTotalPrice` will be dropped.
21+
22+
This action is subject to [InventoryEntry](ctp:api:type:InventoryEntry) min/max restrictions when applicable. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
2123
properties:
2224
lineItemId?:
2325
type: string

api-specs/api/types/me/updates/MyCartSetLineItemSupplyChannelAction.raml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ discriminatorValue: setLineItemSupplyChannel
66
example: !include ../../../examples/Cart/CartSetLineItemSupplyChannelAction.json
77
description: |
88
Performing this action does not reserve stock. Stock is only reserved at Order creation if the [InventoryMode](ctp:api:type:InventoryMode) of the Cart is `TrackOnly` or `ReserveOnOrder`.
9+
10+
This action is subject to [InventoryEntry](ctp:api:type:InventoryEntry) min/max restrictions when applicable. For more information, see [Quantity limits](/../api/carts-orders-overview#quantity-limits).
911
properties:
1012
lineItemId?:
1113
type: string

0 commit comments

Comments
 (0)