Skip to content

Commit

Permalink
Updated API from documentation release
Browse files Browse the repository at this point in the history
  • Loading branch information
ct-sdks[bot] committed Jun 12, 2024
1 parent 80bfddd commit e823fd2
Show file tree
Hide file tree
Showing 2 changed files with 196 additions and 54 deletions.
98 changes: 66 additions & 32 deletions api-specs/api/resources/in-store.raml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ uriParameters:
],
},
]
displayName: Query carts in store
description: Queries carts in a specific [Store](ctp:api:type:Store).
displayName: Query Carts in Store
description: Queries Carts in a specific [Store](ctp:api:type:Store).
responses:
200:
body:
Expand All @@ -51,7 +51,7 @@ uriParameters:
where?:
type: QueryPredicate[]
post:
displayName: Create cart in store
displayName: Create Cart in Store
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -82,7 +82,7 @@ uriParameters:
uriParameterName: customerId
resourceType: Cart
get:
displayName: Get cart by customer id in store
displayName: Get Cart in Store by Customer ID
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -126,7 +126,7 @@ uriParameters:
resourceType: Cart
resourceUpdateType: CartUpdate
get:
displayName: Get cart by key in store
displayName: Get Cart in Store by Key
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -161,7 +161,7 @@ uriParameters:
]
description: Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise.
post:
displayName: Update cart by key in store
displayName: Update Cart in Store by Key
securedBy:
[
oauth_2_0:
Expand All @@ -184,7 +184,7 @@ uriParameters:
application/json:
example: !include ../examples/cart.example.json
delete:
displayName: Delete cart by key in store
displayName: Delete Cart in Store by Key
description: |
If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
is:
Expand All @@ -208,7 +208,7 @@ uriParameters:
/replicate:
type: base
post:
displayName: Replicate cart for store
displayName: Replicate Cart in Store
description: |
Creates a new Cart by replicating an existing Cart or Order. Can be useful in cases where a customer wants to cancel a recent order to make some changes or reorder a previous order.
Expand Down Expand Up @@ -244,7 +244,7 @@ uriParameters:
resourceType: Cart
resourceUpdateType: CartUpdate
get:
displayName: Get cart by id in store
displayName: Get Cart in Store by ID
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -279,7 +279,7 @@ uriParameters:
]
description: Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise.
post:
displayName: Update cart by id in store
displayName: Update Cart in Store by ID
securedBy:
[
oauth_2_0:
Expand All @@ -303,7 +303,7 @@ uriParameters:
application/json:
example: !include ../examples/cart.example.json
delete:
displayName: Delete cart by id in store
displayName: Delete Cart in Store by ID
description: |
If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
is:
Expand Down Expand Up @@ -339,7 +339,7 @@ uriParameters:
An order can be created from a cart, usually after a checkout process has
been completed.
get:
displayName: Query orders in store
displayName: Query Orders in Store
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -373,7 +373,7 @@ uriParameters:
where?:
type: QueryPredicate[]
post:
displayName: Create order in store
displayName: Create Order in Store
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -424,7 +424,7 @@ uriParameters:
resourceType: Order
resourceUpdateType: OrderUpdate
get:
displayName: Get order by order number in store
displayName: Get Order in Store by OrderNumber
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -457,7 +457,7 @@ uriParameters:
]
description: Checks if an Order exists for a given `orderNumber`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise.
post:
displayName: Update order by order number in store
displayName: Update Order in Store by OrderNumber
securedBy:
[
oauth_2_0:
Expand All @@ -480,7 +480,7 @@ uriParameters:
application/json:
example: !include ../examples/order.example.json
delete:
displayName: Delete order by order number in store
displayName: Delete Order in Store by OrderNumber
description: |
If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Expand Down Expand Up @@ -511,7 +511,7 @@ uriParameters:
resourceType: Order
resourceUpdateType: OrderUpdate
get:
displayName: Get order by id in store
displayName: Get Order in Store by ID
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -544,7 +544,7 @@ uriParameters:
]
description: Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a `404 Not Found` otherwise.
post:
displayName: Update order by id in store
displayName: Update Order in Store by ID
securedBy:
[
oauth_2_0:
Expand All @@ -567,7 +567,7 @@ uriParameters:
application/json:
example: !include ../examples/order.example.json
delete:
displayName: Delete order by id in store
displayName: Delete Order in Store by ID
description: |
If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
Expand Down Expand Up @@ -604,7 +604,7 @@ uriParameters:
(createable): MyCartDraft
description: A shopping cart holds product variants and can be ordered.
get:
displayName: Query my carts in store
displayName: Query My Carts in Store
securedBy:
[
oauth_2_0:
Expand All @@ -613,9 +613,13 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: |
Returns all Carts that match a given Query Predicate and contain either a matching `customerId` or `anonymousId` in a Store.
responses:
200:
body:
Expand All @@ -630,15 +634,18 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: Checks if a Cart exists for a given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a `404 Not Found` otherwise.
description: |
Checks if a Cart exists for a Store that matches the given Query Predicate, and contains a matching `customerId` or `anonymousId`. Returns a `200 OK` status if any Carts match these conditions, or a `404 Not Found` otherwise.
queryParameters:
where?:
type: QueryPredicate[]
post:
displayName: Create my cart in store
displayName: Create My Cart in Store
securedBy:
[
oauth_2_0:
Expand All @@ -647,10 +654,14 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: |
Creates a Cart in the specified Store for a given `customerId` or `anonymousId`.
The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter.
Specific Error Codes: [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError)
Expand All @@ -670,7 +681,7 @@ uriParameters:
resourceType: Cart
resourceUpdateType: MyCartUpdate
get:
displayName: Get my cart by id in store
displayName: Get My Cart in Store by ID
securedBy:
[
oauth_2_0:
Expand All @@ -679,9 +690,17 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: |
Returns a Cart for a given `id` in a Store. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
If the Cart exists in the Project but does not have a matching `customerId` or `anonymousId`, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
responses:
200:
body:
Expand All @@ -696,14 +715,13 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: Checks ifa My Cart exists for a given `id`. Returns a `200 OK` status if the My Cart exists or a `404 Not Found` otherwise.
post:
displayName: Update my cart by id in store
description: |
If the Cart exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
displayName: Update My Cart in Store by ID
securedBy:
[
oauth_2_0:
Expand All @@ -712,9 +730,17 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: |
Updates the Cart for a given `id` in a Store. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
If the Cart exists in the Project but does not have a matching `customerId` or `anonymousId`, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
body:
application/json:
example: !include ../examples/cart-update.example.json
Expand All @@ -724,7 +750,7 @@ uriParameters:
application/json:
example: !include ../examples/cart.example.json
delete:
displayName: Delete my cart by id in store
displayName: Delete My Cart in Store by ID
securedBy:
[
oauth_2_0:
Expand All @@ -733,9 +759,17 @@ uriParameters:
[
'manage_my_orders:{projectKey}',
'manage_my_orders:{projectKey}:{storeKey}',
'customer_id:{id}',
'anonymous_id:{id}',
],
},
]
description: |
Deletes the Cart for a given `id` in a Store. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise.
If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
If the Cart exists in the Project but does not have a matching `customerId` or `anonymousId`, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
responses:
200:
body:
Expand All @@ -753,7 +787,7 @@ uriParameters:
An order can be created from a order, usually after a checkout process has
been completed.
get:
displayName: Query my orders in store
displayName: Query My Orders in Store
securedBy:
[
oauth_2_0:
Expand Down Expand Up @@ -789,7 +823,7 @@ uriParameters:
post:
is:
- conflicting
displayName: Create my order in store
displayName: Create My Order in Store
description: |
The Cart must have a [shipping address set](ctp:api:type:CartSetShippingAddressAction) for taxes to be calculated. When creating [B2B Orders](/associates-overview#b2b-resources), the Customer must have the `CreateMyOrdersFromMyCarts` [Permission](ctp:api:type:Permission).
Expand Down Expand Up @@ -828,7 +862,7 @@ uriParameters:
uriParameterName: ID
resourceType: Order
get:
displayName: Get my order by id in store
displayName: Get My Order in Store by ID
description: |
If the Order exists in the Project but does not have the `store` field, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error.
securedBy:
Expand Down Expand Up @@ -863,7 +897,7 @@ uriParameters:
/active-cart:
type: base
get:
displayName: Get my active cart in store
displayName: Get My Active Cart in Store
description: |
Retrieves the Customer's most recently modified active Cart in the Store specified by the `storeKey` path parameter.
Expand Down
Loading

0 comments on commit e823fd2

Please sign in to comment.