Skip to content

Commit 3505c94

Browse files
committed
Updated API from documentation release
1 parent 1862a2d commit 3505c94

File tree

8 files changed

+66
-19
lines changed

8 files changed

+66
-19
lines changed

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

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,22 @@
1818
},
1919
]
2020
description: |
21-
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its key in the specified [Store](ctp:api:type:Store).
21+
Retrieves the [projected](/../api/projects/productProjections#projection-dimensions) representation of a [Product](ctp:api:type:Product) by its Key in the specified [Store](ctp:api:type:Store).
22+
2223
If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection,
2324
they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices),
2425
and [inventory](ctp:api:type:ProductProjectionInventoryEntries).
2526
If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/api/project-configuration-overview#products-available-in-store) in the specified Store.
2627
If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given `key` and the given Store, this endpoint returns the ProductProjection with tailored data.
27-
When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections.
2828
29+
By default, this endpoint returns the `current` representation of Products where the `published` flag is `true`.
30+
If a Product is unpublished (`published=false`), the endpoint returns a [Not Found](/../api/errors#404-not-found) error.
31+
32+
Required access scopes:
33+
34+
- To retrieve the current representation of published Products (published data), the `view_published_products:{projectKey}` scope is required.
35+
36+
- To retrieve the staged representation of Products (draft data) or access unpublished Products, the API Client must have the `view_products:{projectKey}` scope.
2937
is:
3038
- projectionSelectingTailoring
3139
- priceSelecting
@@ -65,14 +73,22 @@
6573
},
6674
]
6775
description: |
68-
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID in the specified [Store](ctp:api:type:Store).
76+
Retrieves the [projected](/../api/projects/productProjections#projection-dimensions) representation of a [Product](ctp:api:type:Product) by its ID in the specified [Store](ctp:api:type:Store).
77+
6978
If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection,
7079
they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices),
7180
and [inventory](ctp:api:type:ProductProjectionInventoryEntries).
7281
If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/api/project-configuration-overview#products-available-in-store) in the specified Store.
73-
If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given `id` and the given Store, this endpoint returns the ProductProjection with tailored data.
74-
When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections.
82+
If a [ProductTailoring](ctp:api:type:ProductTailoring) exists for the Product with the given `key` and the given Store, this endpoint returns the ProductProjection with tailored data.
83+
84+
By default, this endpoint returns the `current` representation of Products where the `published` flag is `true`.
85+
If a Product is unpublished (`published=false`), the endpoint returns a [Not Found](/../api/errors#404-not-found) error.
86+
87+
Required access scopes:
88+
89+
- To retrieve the current representation of published Products (published data), the `view_published_products:{projectKey}` scope is required.
7590
91+
- To retrieve the staged representation of Products (draft data) or access unpublished Products, the API Client must have the `view_products:{projectKey}` scope.
7692
is:
7793
- projectionSelectingTailoring
7894
- priceSelecting

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

Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,16 @@ get:
2222
},
2323
]
2424
description: |
25-
Use the Product Projections query endpoint to get the current or staged representations of Products.
26-
When used with an API Client that has the `view_published_products:{projectKey}` scope,
27-
this endpoint only returns published (current) Product Projections.
25+
Retrieves the [projected](/../api/projects/productProjections#projection-dimensions) representation of [Products](ctp:api:type:Product) by [query predicates](/../api/predicates/query).
26+
27+
By default, this endpoint returns the `current` representation of Products where the `published` flag is `true`.
28+
If a Product is unpublished (`published=false`), the endpoint returns a [Not Found](/../api/errors#404-not-found) error.
29+
30+
Required access scopes:
31+
32+
- To retrieve the current representation of published Products (published data), the `view_published_products:{projectKey}` scope is required.
33+
34+
- To retrieve the staged representation of Products (draft data) or access unpublished Products, the API Client must have the `view_products:{projectKey}` scope.
2835
is:
2936
- projectionSelecting
3037
- priceSelecting
@@ -75,9 +82,16 @@ head:
7582
},
7683
]
7784
description: |
78-
Gets the current or staged representation of a [Product](ctp:api:type:Product) found by Key.
79-
When used with an API Client that has the `view_published_products:{projectKey}` scope,
80-
this endpoint only returns published (current) Product Projections.
85+
Retrieves the [projected](/../api/projects/productProjections#projection-dimensions) representation of a [Product](ctp:api:type:Product) by its Key.
86+
87+
By default, this endpoint returns the `current` representation of Products where the `published` flag is `true`.
88+
If a Product is unpublished (`published=false`), the endpoint returns a [Not Found](/../api/errors#404-not-found) error.
89+
90+
Required access scopes:
91+
92+
- To retrieve the current representation of published Products (published data), the `view_published_products:{projectKey}` scope is required.
93+
94+
- To retrieve the staged representation of Products (draft data) or access unpublished Products, the API Client must have the `view_products:{projectKey}` scope.
8195
is:
8296
- projectionSelecting
8397
- priceSelecting
@@ -123,7 +137,16 @@ head:
123137
},
124138
]
125139
description: |
126-
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID. When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections.
140+
Retrieves the [projected](/../api/projects/productProjections#projection-dimensions) representation of a [Product](ctp:api:type:Product) by its ID.
141+
142+
By default, this endpoint returns the `current` representation of Products where the `published` flag is `true`.
143+
If a Product is unpublished (`published=false`), the endpoint returns a [Not Found](/../api/errors#404-not-found) error.
144+
145+
Required access scopes:
146+
147+
- To retrieve the current representation of published Products (published data), the `view_published_products:{projectKey}` scope is required.
148+
149+
- To retrieve the staged representation of Products (draft data) or access unpublished Products, the API Client must have the `view_products:{projectKey}` scope.
127150
is:
128151
- projectionSelecting
129152
- priceSelecting

api-specs/api/types/product-tailoring/ProductTailoring.raml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ properties:
5555
current:
5656
type: ProductTailoringData
5757
description: |
58-
Current (published) data of the ProductTailoring.
58+
Current data of the ProductTailoring returned in the [Product Projection](/projects/productProjections) response when the ProductTailoring is published.
5959
staged:
6060
type: ProductTailoringData
6161
description: |
62-
Staged (unpublished) data of the ProductTailoring.
62+
Staged data of the ProductTailoring. This data is not returned in the Product Projection response by default.
6363
hasStagedChanges:
6464
type: boolean
6565
description: |

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ properties:
88
published:
99
type: boolean
1010
description: |
11-
`true` if the Product is published.
11+
If `true`, the `current` representation of the Product is retrievable in the [Product Projection](/projects/productProjections) endpoints and indexed for [Product Search](/../api/projects/product-search).
1212
current:
1313
type: ProductData
1414
description: |

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,9 @@ properties:
7474
publish?:
7575
type: boolean
7676
description: |
77-
If `true`, the Product is published immediately to the current projection.
77+
If `true`, the platform sets the `published` flag on the resulting [ProductCatalogData](ctp:api:type:ProductCatalogData) to `true`.
78+
This makes the current representation retrievable in [Product Projection](/projects/productProjections) endpoints and indexes it for [Product Search](/../api/projects/product-search).
79+
You can also set this flag later using the [Publish](/projects/products#publish) update action.
7880
default: false
7981
priceMode?:
8082
type: ProductPriceModeEnum

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ enum:
88
- All
99
- Prices
1010
(enumDescriptions):
11-
All: Publishes a Product that causes the _staged_ projection of the Product to override the _current_ projection. If the Product is published for the first time, the _current_ projection is created. This is the default scope.
11+
All: Publishes a Product that causes the _staged_ projection of the Product to override the _current_ projection. This is the default scope.
1212
Prices: Publishes the Prices of the Product (only if the Product is already published). All Product Variants' Prices in the _staged_ projection are published into the _current_ projection with the same `id`. Prices in a _staged_ Product Variant that has no _current_ projection are not published. Prices in a _current_ Product Variant that has no _staged_ projection are unchanged. The `hasStagedChanges` [flag](ctp:api:type:ProductCatalogData) is updated according to whether the _staged_ and _current_ projections still differ after the prices are published.

api-specs/api/types/product/updates/ProductPublishAction.raml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ type: ProductUpdateAction
44
displayName: ProductPublishAction
55
discriminatorValue: publish
66
description: |-
7-
Publishes product data from the Product's staged projection to its current projection.
7+
Copies the product data from the Product's staged representation to its current representation and sets the `published` flag on the resulting [ProductCatalogData](ctp:api:type:ProductCatalogData) to `true`.
8+
This makes the current representation retrievable in [Product Projection](/projects/productProjections) endpoints and indexes it for [Product Search](/../api/projects/product-search).
9+
810
Produces the [ProductPublished](ctp:api:type:ProductPublishedMessage) Message.
911
example: !include ../../../examples/Product/ProductPublishAction.json
1012
properties:

api-specs/api/types/product/updates/ProductUnpublishAction.raml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ displayName: ProductUnpublishAction
55
discriminatorValue: unpublish
66
example: !include ../../../examples/Product/ProductUnpublishAction.json
77
description: |
8-
Removes the current [projection](/../api/projects/productProjections#current--staged) of the Product. The staged projection is unaffected. To retrieve unpublished Products, the `staged` parameter must be set to `false` when [querying](ctp:api:endpoint:/{projectKey}/product-projections:GET)/[searching](/projects/product-projection-search#product-projection-search) Product Projections. Produces the [ProductUnpublished](ctp:api:type:ProductUnpublishedMessage) Message.
8+
Sets the `published` flag on the [ProductCatalogData](ctp:api:type:ProductCatalogData) to `false`.
9+
This makes the [current](/../api/projects/productProjections#current--staged) representation of a Product unavailable in [Product Projection](/projects/productProjections) endpoints by default, and excludes it from [Product Search](/../api/projects/product-search).
10+
To retrieve unpublished Products on Product Projection endpoints, set parameter `staged=true`.
11+
12+
Produces the [ProductUnpublished](ctp:api:type:ProductUnpublishedMessage) Message.
913
1014
When a Product is unpublished, any associated Line Items already present in a Cart remain unaffected and can still be ordered. To prevent this, do the following:
1115

0 commit comments

Comments
 (0)