Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
Auto Mation committed Jan 12, 2024
1 parent 0a9dd5d commit 24801f9
Show file tree
Hide file tree
Showing 328 changed files with 3,342 additions and 966 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"action": "setValidUntil",
"validUntil": "2018-10-12T14:00:00.000Z"
"validFrom": "2018-10-12T14:00:00.000Z"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"query": {
"and": [
{
"fullText": {
"field": "customLineItems.name",
"language": "en",
"value": "banana"
}
},
{
"filter": [
{
"exact": {
"field": "store.name",
"language": "en",
"value": "fruit_store"
}
}
]
}
]
},
"sort": [
{
"field": "customLineItems.name",
"language": "en",
"order": "desc"
}
],
"limit": 50,
"offset": 0
}
38 changes: 38 additions & 0 deletions api-specs/api/examples/ProductSearch/product-search.example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"total": 148,
"offset": 0,
"limit": 10,
"facets": {
"results": [
{
"name": "countProducts",
"buckets": [
{
"key": "white",
"count": 37
}
]
},
{
"name": "countVariants",
"buckets": [
{
"key": "white",
"count": 301
}
]
}
]
},
"hits": [
{
"id": "8fde2af0-6a2f-4603-9aa4-83566f769a7f",
"matchingVariants": [
{
"id": 1,
"sku": null
}
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"action": "changeProductSearchStatus",
"status": "Activated"
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{
"id": "ff806a85-1457-4cef-929a-79aefe85f02d",
"version": 1,
"lastMessageSequenceNumber": 1,
"createdAt": "2023-06-12T14:43:45.732Z",
"lastModifiedAt": "2023-06-12T14:43:45.732Z",
"lastModifiedBy": {
Expand Down Expand Up @@ -95,4 +96,4 @@
"eligibleApprovers": [],
"pendingApprovers": [],
"currentTierPendingApprovers": []
}
}
3 changes: 2 additions & 1 deletion api-specs/api/examples/approval-flow.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
{
"id": "ff806a85-1457-4cef-929a-79aefe85f02d",
"version": 1,
"lastMessageSequenceNumber": 1,
"createdAt": "2023-06-12T14:43:45.732Z",
"lastModifiedAt": "2023-06-12T14:43:45.732Z",
"lastModifiedBy": {
Expand Down Expand Up @@ -157,4 +158,4 @@
}
}
]
}
}
3 changes: 2 additions & 1 deletion api-specs/api/examples/approval-flows.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
{
"id": "ff806a85-1457-4cef-929a-79aefe85f02d",
"version": 1,
"lastMessageSequenceNumber": 1,
"createdAt": "2023-06-12T14:43:45.732Z",
"lastModifiedAt": "2023-06-12T14:43:45.732Z",
"lastModifiedBy": {
Expand Down Expand Up @@ -165,4 +166,4 @@
]
}
]
}
}
9 changes: 2 additions & 7 deletions api-specs/api/examples/custom-objects.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,9 @@
{
"id": "f584ebbb-3805-43f3-80c8-76f98b2c18b5",
"version": 5,
"container": "test-container",
"container": "channel",
"key": "ac390383-370f-43f8-a534-db1604cb96a8",
"value": {
"name": "commercetools Composable Commerce",
"slug": "commercetools-composable-commerce",
"lat": 52.523753,
"lng": 13.380434
},
"value": "{\"name\":\"commercetools Composable Commerce\",\"slug\":\"commercetools-composable-commerce\",\"lat\":52.523753,\"lng\":13.380434}",
"createdAt": "2015-05-28T09:48:35.098Z",
"lastModifiedAt": "2015-07-01T15:58:36.930Z"
},
Expand Down
3 changes: 0 additions & 3 deletions api-specs/api/resources/cart-discounts.raml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ post:
],
},
]
description: Creating a Cart Discount produces the [CartDiscountCreated](ctp:api:type:CartDiscountCreatedMessage) Message.
body:
application/json:
example: !include ../examples/cart-discount-create.example.json
Expand Down Expand Up @@ -122,7 +121,6 @@ post:
],
},
]
description: Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
responses:
200:
body:
Expand Down Expand Up @@ -191,7 +189,6 @@ post:
],
},
]
description: Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
responses:
200:
body:
Expand Down
14 changes: 2 additions & 12 deletions api-specs/api/resources/in-store.raml
Original file line number Diff line number Diff line change
Expand Up @@ -2131,12 +2131,10 @@ uriParameters:
]
description: |
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its key from the specified [Store](ctp:api:type:Store).
If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection,
If the Store has defined some languages, countries, distribution or supply Channels,
they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices)
and [inventory](ctp:api:type:ProductProjectionInventoryEntries).
If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store.
When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections.
is:
- projectionSelecting
Expand Down Expand Up @@ -2176,12 +2174,10 @@ uriParameters:
]
description: |
Gets the current or staged representation of a [Product](ctp:api:type:Product) by its ID from the specified [Store](ctp:api:type:Store).
If the Store has defined some languages, countries, distribution, supply Channels, and/or Product Selection,
If the Store has defined some languages, countries, distribution or supply Channels,
they are used for projections based on [locale](ctp:api:type:ProductProjectionLocales), [price](ctp:api:type:ProductProjectionPrices)
and [inventory](ctp:api:type:ProductProjectionInventoryEntries).
If [ProductSelection](ctp:api:type:ProductSelection) is used, it affects the [availability of the Product](/projects/stores#products-available-in-store) in the specified Store.
When used with an API Client that has the `view_published_products:{projectKey}` scope, this endpoint only returns published (current) Product Projections.
is:
- projectionSelecting
Expand Down Expand Up @@ -2291,8 +2287,6 @@ uriParameters:
post:
description: |
When using the endpoint, the Store specified in the path and the Stores specified in the payload's `stores` field are added to the CartDiscount.
Creating a Cart Discount produces the [CartDiscountCreated](ctp:api:type:CartDiscountCreatedMessage) Message.
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -2384,8 +2378,6 @@ uriParameters:
delete:
description: |
To delete a CartDiscount, specify the `manage_cart_discounts:{projectKey}:{storeKey}` scope for all Stores associated with the CartDiscount.
Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -2476,8 +2468,6 @@ uriParameters:
delete:
description: |
To delete a CartDiscount, specify the `manage_cart_discounts:{projectKey}:{storeKey}` scope for all Stores associated with the CartDiscount.
Deleting a Cart Discount produces the [CartDiscountDeleted](ctp:api:type:CartDiscountDeletedMessage) Message.
securedBy:
[
oauth_2_0:
Expand Down
2 changes: 1 addition & 1 deletion api-specs/api/resources/login.raml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ post:
description: |
Authenticates a global Customer not associated with a Store.
For more information, see [Global versus Store-specific Customers](/../api/customers-overview#global-versus-store-specific-customers).
If the Customer is registered in a Store, use the [Authenticate (sign in) Customer in Store](ctp:api:endpoint:/{projectKey}/in-store/key={storeKey}/login:POST) method.
If the Customer is registered in a Store, use the [Authenticate (sign in) Customer in Store](/../api/projects/customers#authenticate-sign-in-customer-in-store) method.
If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned.
securedBy: [oauth_2_0: { scopes: ['manage_customers:{projectKey}'] }]
Expand Down
4 changes: 2 additions & 2 deletions api-specs/api/resources/product-selections.raml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ post:
delete:
securedBy:
[oauth_2_0: { scopes: ['manage_product_selections:{projectKey}'] }]
description: Deletion will only succeed if the Product Selection is not assigned to any [Store](ctp:api:type:Store).
description: Deletion will only succeed if the Product Selection is not assigned to any [Store](/../api/projects/stores#store).
responses:
200:
body:
Expand Down Expand Up @@ -123,7 +123,7 @@ post:
delete:
securedBy:
[oauth_2_0: { scopes: ['manage_product_selections:{projectKey}'] }]
description: Deletion will only succeed if the Product Selection is not assigned to any [Store](ctp:api:type:Store).
description: Deletion will only succeed if the Product Selection is not assigned to any [Store](/../api/projects/stores#store).
responses:
200:
body:
Expand Down
37 changes: 36 additions & 1 deletion api-specs/api/resources/products.raml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,17 @@ type:
description: |
Products themselves are not sellable. Instead, they act as a parent structure for sellable Product Variants.
get:
securedBy: [oauth_2_0: { scopes: ['view_products:{projectKey}'] }]
securedBy:
[
oauth_2_0:
{
scopes:
[
'view_products:{projectKey}',
'view_published_products:{projectKey}',
],
},
]
is:
- priceSelecting
description: |-
Expand Down Expand Up @@ -212,3 +222,28 @@ post:
body:
application/json:
example: !include ../examples/product-assigned-selections.example.json
/search:
type: base
displayName: Product Search
description: |
This endpoint provides high-performance search queries over Products. Product Search allows searching through all products with a current projection in your Project.
post:
displayName: Search Products
securedBy: [oauth_2_0: { scopes: ['view_published_products:{projectKey}'] }]
body:
application/json:
type: ProductSearchRequest
responses:
200:
body:
application/json:
example: !include ../examples/ProductSearch/product-search.example.json
type: ProductPagedSearchResponse
head:
securedBy: [oauth_2_0: { scopes: ['project_settings:{projectKey}'] }]
description: Checks whether a search index for the Project's Products exists.
responses:
200:
description: The index exists and the Search Products endpoint can be used.
404:
description: The index does not exist and the Search Products endpoint returns Error 404 only.
4 changes: 2 additions & 2 deletions api-specs/api/resources/shipping-methods.raml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ post:
get:
displayName: Get ShippingMethods for a cart and location
description: |
Retrieves all the ShippingMethods that can ship to the given [Location](ctp:api:type:Location)
Retrieves all the ShippingMethods that can ship to the given [Location](/projects/zones#location)
with a `predicate` that matches the given Cart.
Each ShippingMethod contains exactly one ShippingRate with the flag `isMatching` set to `true`.
This ShippingRate is used when the ShippingMethod is [added to the Cart](ctp:api:type:CartSetShippingMethodAction).
Expand Down Expand Up @@ -269,7 +269,7 @@ post:
get:
displayName: Get ShippingMethods for an order edit
description: |
Retrieves all the ShippingMethods that can ship to the given [Location](ctp:api:type:Location) for an [OrderEdit](ctp:api:type:OrderEdit).
Retrieves all the ShippingMethods that can ship to the given [Location](/../api/projects/zones#location) for an [OrderEdit](/../api/projects/order-edits).
If the OrderEdit preview cannot be generated, an [EditPreviewFailed](ctp:api:type:EditPreviewFailedError) error is returned.
securedBy:
Expand Down
1 change: 1 addition & 0 deletions api-specs/api/ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<option type="exclude">lineItemOrder</option>
<option type="exclude">textLineItemOrder</option>
<option type="exclude">syncInfo</option>
<option type="exclude">localeProjection</option>
<option type="exclude">returnInfo</option>
<option type="exclude">value</option>
<option type="exclude">newState</option>
Expand Down
5 changes: 1 addition & 4 deletions api-specs/api/types/approval-flow/ApprovalFlow.raml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#%RAML 1.0 DataType
(package): ApprovalFlow
(docs-uri): https://docs.commercetools.com/api/projects/approvalflows#approvalflow
(beta): true
type: BaseResource
displayName: ApprovalFlow
properties:
Expand Down Expand Up @@ -70,7 +71,3 @@ properties:
type: RuleApprover[]
description: |
Associate Roles required for approval based on the approver hierarchy tiers defined in `rules` only for the currently active tier(s).
custom?:
type: CustomFields
description: |
Custom Fields on the Approval Flow.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#%RAML 1.0 DataType
(package): ApprovalFlow
(docs-uri): https://docs.commercetools.com/api/projects/approvalflows#approvalflowapproval
(beta): true
displayName: ApprovalFlowApproval
type: object
properties:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#%RAML 1.0 DataType
(package): ApprovalFlow
(docs-uri): https://docs.commercetools.com/api/projects/approvalflows#approvalflowrejection
(beta): true
displayName: ApprovalFlowRejection
type: object
properties:
Expand Down

This file was deleted.

Loading

0 comments on commit 24801f9

Please sign in to comment.