From dd89a432525ef32aad4af069a2dea5d461a991d9 Mon Sep 17 00:00:00 2001 From: "ct-sdks[bot]" <153784748+ct-sdks[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 09:19:25 +0000 Subject: [PATCH] Updated API from documentation release --- api-specs/api/resources/in-store.raml | 336 ++++++++++---- api-specs/api/resources/me.raml | 644 ++++++++++++++++++++------ 2 files changed, 766 insertions(+), 214 deletions(-) diff --git a/api-specs/api/resources/in-store.raml b/api-specs/api/resources/in-store.raml index 4cbd7b4be..cb016e294 100644 --- a/api-specs/api/resources/in-store.raml +++ b/api-specs/api/resources/in-store.raml @@ -46,7 +46,7 @@ uriParameters: ], }, ] - 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 given Query Predicate. Returns a `200 OK` status if any Carts match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -104,9 +104,9 @@ uriParameters: }, ] description: | - Retrieves the most recently modified active Cart of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + Retrieves the most recently modified [active Cart](ctp:api:type:CartState) of a Customer with [CartOrigin](ctp:api:type:CartOrigin) `Customer`. If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. - 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. responses: @@ -126,7 +126,7 @@ uriParameters: ], }, ] - description: Checks if a Cart of a Customer exists. Returns a `200 OK` status if the Cart exists or a `404 Not Found` otherwise. + description: Checks if a Cart of a Customer exists. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. /key={key}: (methodName): withKey type: @@ -148,7 +148,7 @@ uriParameters: }, ] 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. responses: @@ -168,7 +168,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. + description: Checks if a Cart exists for a given `key`. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update Cart in Store by Key securedBy: @@ -183,7 +183,7 @@ uriParameters: }, ] 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. body: application/json: example: !include ../examples/cart-update.example.json @@ -195,7 +195,7 @@ uriParameters: delete: 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. is: - dataErasure securedBy: @@ -271,7 +271,7 @@ uriParameters: }, ] 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. To ensure the Cart is up-to-date with current values (such as Prices and Discounts), use the [Recalculate](ctp:api:type:CartRecalculateAction) update action. responses: @@ -291,7 +291,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. + description: Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update Cart in Store by ID securedBy: @@ -307,7 +307,7 @@ uriParameters: ] description: | Updates a [Cart](ctp:api:type:Cart) in the [Store](ctp:api:type:Store) specified by `storeKey`. - 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. body: application/json: example: !include ../examples/cart-update.example.json @@ -319,7 +319,7 @@ uriParameters: delete: 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. + If the Cart exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. is: - dataErasure securedBy: @@ -382,7 +382,7 @@ uriParameters: ], }, ] - description: Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. + description: Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -488,7 +488,7 @@ uriParameters: }, ] 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. + If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. responses: 200: body: @@ -506,7 +506,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. + description: Checks if an Order exists for a given `orderNumber`. Returns a `200 OK` status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update Order in Store by OrderNumber securedBy: @@ -521,7 +521,7 @@ uriParameters: }, ] 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. + If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. body: application/json: example: !include ../examples/order-update.example.json @@ -533,7 +533,7 @@ uriParameters: delete: 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. + If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. is: @@ -575,7 +575,7 @@ uriParameters: }, ] 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. + If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. responses: 200: body: @@ -593,7 +593,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. + description: Checks if an Order exists for a given `id`. Returns a `200 OK` status if the Order exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update Order in Store by ID securedBy: @@ -608,7 +608,7 @@ uriParameters: }, ] 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. + If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. body: application/json: example: !include ../examples/order-update.example.json @@ -620,7 +620,7 @@ uriParameters: delete: 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. + If the Order exists in the Project but does not have a `store` specified, or the `store` field references a different Store, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. Deleting an Order produces the [OrderDeleted](ctp:api:type:OrderDeletedMessage) Message. is: @@ -677,6 +677,7 @@ uriParameters: application/json: example: !include ../examples/carts.example.json head: + displayName: Check if Cart exists in Store by Query Predicate securedBy: [ oauth_2_0: @@ -691,7 +692,7 @@ uriParameters: }, ] 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. + 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 [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -711,7 +712,8 @@ uriParameters: }, ] description: | - Creates a Cart in the specified Store for a given `customerId` or `anonymousId`. + + Creates a Cart in a Store for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Cart is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. The `store` field in the created [Cart](ctp:api:type:Cart) is set to the Store specified by the `storeKey` path parameter. @@ -754,17 +756,21 @@ uriParameters: }, ] 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. + Returns a Cart for a given `id` in a Store. Returns a `200 OK` status if the Cart exists. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: - 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 no Cart exists in the Store for the given `id`. + - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store. + - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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: application/json: example: !include ../examples/cart.example.json head: + displayName: Check if Cart exists in Store by ID securedBy: [ oauth_2_0: @@ -794,11 +800,14 @@ uriParameters: }, ] 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. + Updates the Cart for a given `id` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: - 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 no Cart exists in the Store for the given `id`. + - If the Cart exists but does not belong to a Store, or the Cart's `store` field references a different Store. + - If the Cart exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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 @@ -823,11 +832,14 @@ uriParameters: }, ] 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. + Deletes the Cart for a given `id` in a Store. Returns a `200 OK` status if successful. - 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. + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Cart exists in the Store for the given `id`. + - If the Cart exists in the Project but does not belong to a Store, or the Cart's `store` field references a different Store. + - If the Cart exists in the Project but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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: @@ -854,15 +866,20 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] + description: | + Returns all Orders in a Store that match a given Query Predicate and contain either a `customerId` that matches the [customer_id:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. responses: 200: body: application/json: example: !include ../examples/orders.example.json head: + displayName: Check if Order exists in Store by Query Predicate securedBy: [ oauth_2_0: @@ -871,20 +888,35 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer:{customerId}', + 'anonymous_id:{anonymousId}', ], }, ] - description: Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. + description: | + Checks if an Order exists for a given Query Predicate in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Orders exist in the Store that match the Query Predicate. + - If an Order matches the Query Predicate, but no `store` is specified, or the `store` field references a different Store. + - If an Order matches the Query Predicate, but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + queryParameters: where?: type: QueryPredicate[] post: is: - conflicting - displayName: Create My Order in Store + displayName: Create My Order in Store from Cart description: | + + Creates an Order in a Store from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. + 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). + If the Cart's `customerId` does not match the [customer:{id}](/scopes#customer_idid) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#anonymous_idid) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. Specific Error Codes: @@ -906,6 +938,8 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -926,7 +960,14 @@ uriParameters: get: 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. + Returns an Order for a given `id` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Order exists in the Store for the given `id`. + - If the Order exists but does not have a `store` specified, or the `store` field references a different Store. + - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + securedBy: [ oauth_2_0: @@ -935,6 +976,8 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -944,6 +987,7 @@ uriParameters: application/json: example: !include ../examples/order.example.json head: + displayName: Check if Order exists in Store by ID securedBy: [ oauth_2_0: @@ -952,20 +996,35 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] - description: Checks if an Order exists for a given `id`. Returns a `200 OK` status if the My Order exists or a `404 Not Found` otherwise. + description: | + Checks if an Order exists for a given `id` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Order exists in the Store for the given `id`. + - If the Order exists but does not have a `store` specified, or the `store` field references a different Store. + - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + /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. + Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState) in a Store. Returns a `200 OK` status if successful. Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. - If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no active Cart exists. + - If an active Cart exists but does not have a `store` specified, or the `store` field references a different Store. + - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + is: - expandable securedBy: @@ -976,6 +1035,8 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -994,10 +1055,20 @@ uriParameters: [ 'manage_my_orders:{projectKey}', 'manage_my_orders:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] - description: Checks if an active Cart exists. Returns a `200 OK` status if an active Cart exists or a `404 Not Found` otherwise. + description: | + Checks if an active Cart exists in a Store. Returns `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no active Cart exists in a Store. + - If an active Cart exists but does not have a `store` specified, or the `store` field references a different Store. + - If an active Cart exists but does not contain a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + /shopping-lists: type: baseDomain: @@ -1009,7 +1080,16 @@ uriParameters: description: | shopping-lists e.g. for wishlist support get: - displayName: Get my shopping lists in store + displayName: Query My ShoppingLists in Store + description: | + Returns ShoppingLists that match the given Query Predicate in a Store. Returns `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingLists exist in a Store. + - If a ShoppingList exists but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList exists in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + securedBy: [ oauth_2_0: @@ -1018,6 +1098,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1033,6 +1115,7 @@ uriParameters: application/json: example: !include ../examples/shopping-lists.example.json head: + displayName: Check if ShoppingList exists by Query Predicate securedBy: [ oauth_2_0: @@ -1041,15 +1124,25 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] - description: Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. + description: | + Checks if a ShoppingList exists for the given Query Predicate in a Store. Returns `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingLists exist for a given Query Predicate in a Store. + - If a ShoppingList matches the Query Predicate but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList exists in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + queryParameters: where?: type: QueryPredicate[] post: - displayName: Create my shopping lists in store + displayName: Create My ShoppingList in Store securedBy: [ oauth_2_0: @@ -1058,6 +1151,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1071,6 +1166,9 @@ uriParameters: application/json: example: !include ../examples/shopping-list-create.example.json description: | + + Creates a ShoppingList in a Store for a Customer or anonymous user. The `customer` or `anonymousId` field on the ShoppingList is automatically set based on the given [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. + When using this endpoint, the `store` field of a ShoppingList is always set to the [Store](ctp:api:type:Store) specified in the path parameter. responses: 201: @@ -1085,7 +1183,7 @@ uriParameters: resourceType: ShoppingList resourceUpdateType: MyShoppingListUpdate get: - displayName: Get my shopping list by key in store + displayName: Get My ShoppingList in Store by Key securedBy: [ oauth_2_0: @@ -1094,6 +1192,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1104,13 +1204,22 @@ uriParameters: type: Expansion[] required: false description: | - If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), the [ResourceNotFound](/errors#404-not-found-1) error is returned. + Returns a ShoppingList for a given `key` in a Store. Returns `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `key` in a Store. + - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, + or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/shopping-list.example.json head: + displayName: Check if ShoppingList exists by Key securedBy: [ oauth_2_0: @@ -1119,12 +1228,22 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] - description: Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. + description: | + Checks if a ShoppingList exists for a given `key` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists that matches the given `key` in a Store. + - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + post: - displayName: Update my shopping list by key in store + displayName: Update My ShoppingList in Store by Key securedBy: [ oauth_2_0: @@ -1133,6 +1252,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1146,15 +1267,21 @@ uriParameters: application/json: example: !include ../examples/shopping-list-update.example.json description: | - If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), - the [ResourceNotFound](/errors#404-not-found-1) error is returned. + Updates a ShoppingList for a given `key` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `key` in a Store. + - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/shopping-list.example.json delete: - displayName: Delete my shopping list by key in store + displayName: Delete My ShoppingList in Store by Key is: - dataErasure securedBy: @@ -1165,6 +1292,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1175,8 +1304,14 @@ uriParameters: type: Expansion[] required: false description: | - If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), - the [ResourceNotFound](/errors#404-not-found-1) error is returned. + Deletes the ShoppingList for a given `key` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `key` in a Store. + - If a ShoppingList matches the given `key` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `key` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: @@ -1190,7 +1325,7 @@ uriParameters: resourceType: ShoppingList resourceUpdateType: MyShoppingListUpdate get: - displayName: Get my shopping list by id in store + displayName: Get My ShoppingList in Store by ID securedBy: [ oauth_2_0: @@ -1199,6 +1334,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}:{storeKey}', 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1209,14 +1346,21 @@ uriParameters: type: Expansion[] required: false description: | - If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), - the [ResourceNotFound](/errors#404-not-found-1) error is returned. + Returns a ShoppingList for a given `id` in a Store. Returns `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `id` in a Store. + - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/shopping-list.example.json head: + displayName: Check if ShoppingList exists by ID securedBy: [ oauth_2_0: @@ -1225,12 +1369,22 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}:{storeKey}', 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] - description: Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. + description: | + Checks if a ShoppingList exists for a given `id` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `id` in a Store. + - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + post: - displayName: Update my shopping list by id in store + displayName: Update My ShoppingList in Store by ID securedBy: [ oauth_2_0: @@ -1239,6 +1393,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1252,15 +1408,21 @@ uriParameters: application/json: example: !include ../examples/shopping-list-update.example.json description: | - If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), - the [ResourceNotFound](/errors#404-not-found-1) error is returned. + Updates a ShoppingList for a given `id` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `id` in a Store. + - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/shopping-list.example.json delete: - displayName: Delete my shopping list by id in store + displayName: Delete My ShoppingList in Store by ID is: - dataErasure securedBy: @@ -1271,6 +1433,8 @@ uriParameters: [ 'manage_my_shopping_lists:{projectKey}', 'manage_my_shopping_lists:{projectKey}:{storeKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', ], }, ] @@ -1281,8 +1445,14 @@ uriParameters: type: Expansion[] required: false description: | - If a ShoppingList exists in a Project but does _not_ have the `store` field, or the `store` field references a different [Store](ctp:api:type:Store), - the [ResourceNotFound](/errors#404-not-found-1) error is returned. + Deletes the ShoppingList for a given `id` in a Store. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList matches the given `id` in a Store. + - If a ShoppingList matches the given `id` but does not have a `store` specified, or the `store` field references a different Store. + - If a ShoppingList matches the given `id` in a Store but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: @@ -1543,7 +1713,7 @@ uriParameters: scopes: - 'view_customers:{projectKey}' - 'view_customers:{projectKey}:{storeKey}' - description: Checks if a Customer exists for a given Query Predicate. Returns a `200 OK` status if any Customers match the Query Predicate or a `404 Not Found` otherwise. + description: Checks if a Customer exists for a given Query Predicate. Returns a `200 OK` status if any Customers match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -1942,7 +2112,7 @@ uriParameters: description: | shopping-lists e.g. for wishlist support get: - displayName: Get shopping lists in store + displayName: Get ShoppingLists in Store securedBy: [ oauth_2_0: @@ -1977,12 +2147,12 @@ uriParameters: ], }, ] - description: Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. + description: Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] post: - displayName: Create shopping lists in store + displayName: Create ShoppingLists in Store securedBy: [ oauth_2_0: @@ -2018,7 +2188,7 @@ uriParameters: resourceType: ShoppingList resourceUpdateType: ShoppingListUpdate get: - displayName: Get shopping list by key in store + displayName: Get ShoppingList in Store by Key securedBy: [ oauth_2_0: @@ -2056,9 +2226,9 @@ uriParameters: ], }, ] - description: Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. + description: Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: - displayName: Update shopping list by key in store + displayName: Update ShoppingList in Store by Key securedBy: [ oauth_2_0: @@ -2088,7 +2258,7 @@ uriParameters: application/json: example: !include ../examples/shopping-list.example.json delete: - displayName: Delete shopping list by key in store + displayName: Delete ShoppingList in Store by Key is: - dataErasure securedBy: @@ -2124,7 +2294,7 @@ uriParameters: resourceType: ShoppingList resourceUpdateType: ShoppingListUpdate get: - displayName: Get shopping list by id in store + displayName: Get ShoppingList in Store by ID securedBy: [ oauth_2_0: @@ -2162,9 +2332,9 @@ uriParameters: ], }, ] - description: Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. + description: Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: - displayName: Update shopping list by id in store + displayName: Update ShoppingList in Store by ID securedBy: [ oauth_2_0: @@ -2194,7 +2364,7 @@ uriParameters: application/json: example: !include ../examples/shopping-list.example.json delete: - displayName: Delete shopping list by id in store + displayName: Delete ShoppingList in Store by ID is: - dataErasure securedBy: @@ -2944,7 +3114,7 @@ uriParameters: ], }, ] - description: Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a `404 Not Found` otherwise. + description: Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -3004,7 +3174,7 @@ uriParameters: ], }, ] - description: Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. + description: Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: securedBy: [ @@ -3080,7 +3250,7 @@ uriParameters: ], }, ] - description: Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. + description: Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: securedBy: [ @@ -3161,7 +3331,7 @@ uriParameters: ], }, ] - description: Checks if a StagedQuote exists for a given Query Predicate. Returns a `200 OK` status if any StagedQuotes match the Query Predicate or a `404 Not Found` otherwise. + description: Checks if a StagedQuote exists for a given Query Predicate. Returns a `200 OK` status if any StagedQuotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -3221,7 +3391,7 @@ uriParameters: ], }, ] - description: Checks if a StagedQuote exists for a given `key`. Returns a `200 OK` status if the StagedQuote exists or a `404 Not Found` otherwise. + description: Checks if a StagedQuote exists for a given `key`. Returns a `200 OK` status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: securedBy: [ @@ -3297,7 +3467,7 @@ uriParameters: ], }, ] - description: Checks if a StagedQuote exists for a given `id`. Returns a `200 OK` status if the StagedQuote exists or a `404 Not Found` otherwise. + description: Checks if a StagedQuote exists for a given `id`. Returns a `200 OK` status if the StagedQuote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: securedBy: [ @@ -3378,7 +3548,7 @@ uriParameters: ], }, ] - description: Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a `404 Not Found` otherwise. + description: Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -3438,7 +3608,7 @@ uriParameters: ], }, ] - description: Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. + description: Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: securedBy: [ @@ -3514,7 +3684,7 @@ uriParameters: ], }, ] - description: Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. + description: Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: securedBy: [ diff --git a/api-specs/api/resources/me.raml b/api-specs/api/resources/me.raml index e2bf4880c..33e88aed6 100644 --- a/api-specs/api/resources/me.raml +++ b/api-specs/api/resources/me.raml @@ -146,23 +146,58 @@ delete: /active-cart: type: base get: - displayName: Get my active cart + displayName: Get My active Cart description: | - Retrieves the Customer's most recently modified active Cart. + Retrieves the Customer's most recently modified [active Cart](ctp:api:type:CartState). Returns a `200 OK` status if successful. + Carts with `Merchant` or `Quote` [CartOrigin](ctp:api:type:CartOrigin) are ignored. - If no active Cart exists, this method returns a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error. + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no active Cart exists. + - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + is: - expandable - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] responses: 200: body: application/json: type: Cart head: - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - description: Checks if an active Cart exists. Returns a `200 OK` status if an active Cart exists or a `404 Not Found` otherwise. + displayName: Check if active Cart exists + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Checks if an active Cart exists. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no active Cart exists. + - If an active Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + /business-units: type: baseDomain: @@ -321,6 +356,7 @@ delete: application/json: example: !include ../examples/carts.example.json head: + displayName: Check if Cart exists by Query Predicate securedBy: [ oauth_2_0: @@ -334,7 +370,7 @@ delete: }, ] description: | - Checks if a Cart exists that matches a given Query Predicate and contains either a matching `customerId` or `anonymousId`. Returns a `200 OK` status if the Cart exists, or a `404 Not Found` otherwise. + Checks if a Cart exists that matches a given Query Predicate and contains either a matching `customerId` or `anonymousId`. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -353,7 +389,8 @@ delete: }, ] description: | - Creates a Cart for a given `customerId` or `anonymousId`. + + Creates a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Cart is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. Specific Error Codes: @@ -370,43 +407,6 @@ delete: body: application/json: example: !include ../examples/cart.example.json - /key={key}: - (methodName): withKey - type: - baseResource: - uriParameterName: key - resourceType: Cart - resourceUpdateType: MyCartUpdate - get: - displayName: Get My Cart by Key - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - responses: - 200: - body: - application/json: - example: !include ../examples/cart.example.json - head: - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - 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 my cart by key - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - body: - application/json: - example: !include ../examples/cart-update.example.json - responses: - 200: - body: - application/json: - example: !include ../examples/cart.example.json - delete: - displayName: Delete my cart by key - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - responses: - 200: - body: - application/json: - example: !include ../examples/cart.example.json /{ID}: (methodName): withId type: @@ -429,15 +429,20 @@ delete: }, ] description: | - Returns a Cart for a given `id`. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + Returns a Cart for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Cart exists for a given `id`. + - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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: application/json: example: !include ../examples/cart.example.json head: + displayName: Check if Cart exists by ID securedBy: [ oauth_2_0: @@ -451,9 +456,13 @@ delete: }, ] 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. + Checks if a Cart exists for a given `id`. Returns a `200 OK` status if the Cart exists. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Cart exists for a given `id`. + - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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. post: displayName: Update My Cart by ID securedBy: @@ -469,9 +478,13 @@ delete: }, ] description: | - Updates the Cart for a given `id`. Returns a `200 OK` status if the Cart exists, or a `404 Not Found` otherwise. + Updates the Cart for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Cart exists for a given `id`. + - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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 @@ -495,9 +508,13 @@ delete: }, ] description: | - Deletes the Cart for a given `id`. Returns a `200 OK` status if the Cart exists, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + Deletes the Cart for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Cart exists for a given `id`. + - If the Cart exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. - 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: @@ -559,15 +576,53 @@ delete: been completed. get: displayName: Query My Orders - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Returns all Orders that match a given Query Predicate. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Orders exist for a given Query Predicate. + - If the Order exists but does not have a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + responses: 200: body: application/json: example: !include ../examples/orders.example.json head: - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - description: Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if any Orders match the Query Predicate or a `404 Not Found` otherwise. + displayName: Check if Order exists by Query Predicate + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer:{customerId}', + 'anonymous_id:{anonymousId}', + ], + }, + ] + description: | + Checks if an Order exists for a given Query Predicate. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Order exists that matches the Query Predicate. + - If one or more Orders exist but don't have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + queryParameters: where?: type: QueryPredicate[] @@ -576,10 +631,14 @@ delete: - conflicting displayName: Create My Order 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). + Creates an Order from a Cart for the Customer or anonymous user. The `customerId` or `anonymousId` field on the Order is automatically set based on the [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. + + 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). Creating an Order produces the [OrderCreated](ctp:api:type:OrderCreatedMessage) Message. + If the Cart's `customerId` does not match the [customer:{id}](/scopes#customer_idid) scope, or the `anonymousId` does not match the [anonymous_id:{id}](/scopes#anonymous_idid) scope, a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned. + If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number. @@ -593,7 +652,18 @@ delete: - [ShippingMethodDoesNotMatchCart](ctp:api:type:ShippingMethodDoesNotMatchCartError) - [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) - [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError) - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] body: application/json: example: !include ../examples/my-order-create.example.json @@ -611,15 +681,53 @@ delete: resourceUpdateType: MyOrderUpdate get: displayName: Get My Order by ID - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] + description: | + Returns an Order for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Order exists for the given `id`. + - If the Order exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] responses: 200: body: application/json: example: !include ../examples/order.example.json head: - securedBy: [oauth_2_0: { scopes: ['manage_my_orders:{projectKey}'] }] - 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. + displayName: Check if Order exists by ID + securedBy: + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_orders:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Checks if an Order exists for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Order exists for the given `id`. + - If the Order exists but does not have either a `customerId` that matches the [customer:{id}](/scopes#customer_idid) scope, or an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope. + /quotes: (methodName): orderQuote type: base @@ -638,7 +746,11 @@ delete: - [InvalidItemShippingDetails](ctp:api:type:InvalidItemShippingDetailsError) - [CountryNotConfiguredInStore](ctp:api:type:CountryNotConfiguredInStoreError) - [AssociateMissingPermission](ctp:api:type:AssociateMissingPermissionError) - securedBy: [oauth_2_0: { scopes: ['manage_quotes:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_quotes:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: example: !include ../examples/my-order-from-quote.example.json @@ -746,25 +858,47 @@ delete: The My Quote Requests endpoint creates and provides access to Quote Requests scoped to a specific user. get: - displayName: Query My Quote Requests + displayName: Query My QuoteRequests + description: | + Returns all Quote Requests that match a given Query Predicate. Returns a `200 OK` status if successful. securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] responses: 200: body: application/json: example: !include ../examples/quote-requests.example.json head: + displayName: Check if QuoteRequest exists by Query Predicate securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] - description: Checks if my QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] + description: | + Checks if a QuoteRequest exists for a given Query Predicate. Returns a `200 OK` status if any QuoteRequests match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] post: - displayName: Create My Quote Requests + displayName: Create My QuoteRequest securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] body: application/json: example: !include ../examples/my-quote-request-create.example.json @@ -781,22 +915,41 @@ delete: resourceType: QuoteRequest resourceUpdateType: MyQuoteRequestUpdate get: - displayName: Get My Quote Requests by ID + displayName: Get My QuoteRequest by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] responses: 200: body: application/json: example: !include ../examples/quote-request.example.json head: + displayName: Check if QuoteRequest exists by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] - description: Checks if my QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] + description: Checks if a QuoteRequest exists for a given `id`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: - displayName: Update My Quote Requests by ID + displayName: Update My QuoteRequest by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] body: application/json: example: !include ../examples/my-quote-request-update.example.json @@ -805,15 +958,6 @@ delete: body: application/json: example: !include ../examples/quote-request-update-response.example.json - delete: - displayName: Delete My Quote Requests by ID - securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] - responses: - 200: - body: - application/json: - example: !include ../examples/quote-request.example.json /key={key}: (methodName): withKey type: @@ -822,22 +966,41 @@ delete: resourceType: QuoteRequest resourceUpdateType: MyQuoteRequestUpdate get: - displayName: Get My Quote Requests by Key + displayName: Get My QuoteRequest by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] responses: 200: body: application/json: example: !include ../examples/quote-request.example.json head: + displayName: Check if QuoteRequest exists by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] - description: Checks if my QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] + description: Checks if a QuoteRequest exists for a given `key`. Returns a `200 OK` status if the QuoteRequest exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: - displayName: Update my Quote Requests by Key + displayName: Update My QuoteRequest by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_quote_requests:{projectKey}', 'customer_id:{id}'], + }, + ] body: application/json: example: !include ../examples/my-quote-request-update.example.json @@ -846,15 +1009,6 @@ delete: body: application/json: example: !include ../examples/quote-request-update-response.example.json - delete: - displayName: Delete my Quote Requests by Key - securedBy: - [oauth_2_0: { scopes: ['manage_my_quote_requests:{projectKey}'] }] - responses: - 200: - body: - application/json: - example: !include ../examples/quote-request.example.json /quotes: type: baseDomain: @@ -865,15 +1019,24 @@ delete: description: The My Quote endpoint provides access to Quotes scoped to a specific user. get: displayName: Query My Quotes - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] responses: 200: body: application/json: example: !include ../examples/quotes.example.json head: - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] - description: Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a `404 Not Found` otherwise. + displayName: Check if Quote exists by Query Predicate + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] + description: Checks if a Quote exists for a given Query Predicate. Returns a `200 OK` status if any Quotes match the Query Predicate or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] @@ -886,18 +1049,31 @@ delete: resourceUpdateType: MyQuoteUpdate get: displayName: Get My Quote by ID - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] responses: 200: body: application/json: example: !include ../examples/quote.example.json head: - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] - description: Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. + displayName: Check if Quote exists by ID + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] + description: Checks if a Quote exists for a given `id`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update My Quote by ID - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: example: !include ../examples/my-quote-update.example.json @@ -915,18 +1091,31 @@ delete: resourceUpdateType: MyQuoteUpdate get: displayName: Get My Quote by Key - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] responses: 200: body: application/json: example: !include ../examples/quote.example.json head: - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] - description: Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a `404 Not Found` otherwise. + displayName: Check if Quote exists by Key + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] + description: Checks if a Quote exists for a given `key`. Returns a `200 OK` status if the Quote exists or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update My Quote by Key - securedBy: [oauth_2_0: { scopes: ['manage_my_quotes:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_quotes:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: example: !include ../examples/my-quote-update.example.json @@ -948,9 +1137,27 @@ delete: (createable): MyShoppingListDraft description: The My Shopping Lists endpoint creates and provides access to Shopping Lists scoped to a specific user. get: - displayName: Query my shopping lists + displayName: Query My ShoppingLists securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Returns all ShoppingLists that match the given Query Predicate. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given Query Predicate. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + queryParameters: expand: description: | @@ -963,16 +1170,47 @@ delete: application/json: example: !include ../examples/my-shopping-lists.example.json head: + displayName: Check if ShoppingList exists by Query Predicate securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] - description: Checks if a ShoppingList exists for a given Query Predicate. Returns a `200 OK` status if any ShoppingLists match the Query Predicate or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Checks if a ShoppingList matches the given Query Predicate. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given Query Predicate. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + queryParameters: where?: type: QueryPredicate[] post: - displayName: Create my shopping list + displayName: Create My ShoppingList securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Creates a ShoppingList for the Customer or anonymous user. The `customerId` or `anonymousId` on the ShoppingList is automatically set based on the given [customer:{id}](/scopes#customer_idid) or [anonymous_id:{id}](/scopes#anonymous_idid) scope. + queryParameters: expand: description: | @@ -995,9 +1233,27 @@ delete: resourceType: ShoppingList resourceUpdateType: MyShoppingListUpdate get: - displayName: Get my shopping list by id + displayName: Get My ShoppingList by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Returns a ShoppingList for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `id`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + queryParameters: expand: description: | @@ -1010,13 +1266,41 @@ delete: application/json: example: !include ../examples/my-shopping-list.example.json head: + displayName: Check if ShoppingList exists by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] - description: Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Checks if a ShoppingList exists for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `id`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + post: - displayName: Update my shopping list by id + displayName: Update My ShoppingList by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] queryParameters: expand: description: | @@ -1026,21 +1310,47 @@ delete: body: application/json: example: !include ../examples/my-shopping-list-update.example.json + description: | + Updates a ShoppingList for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `id`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/my-shopping-list.example.json delete: - displayName: Delete my shopping list by id + displayName: Delete My ShoppingList by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] queryParameters: expand: description: | When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), [expand the entire array](/general-concepts#reference-expansion). You cannot expand a single element (for example, `expand=lineItems[0].variant` is not supported). type: Expansion[] required: false + description: | + Deletes the ShoppingList for a given `id`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `id`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: @@ -1054,28 +1364,74 @@ delete: resourceType: ShoppingList resourceUpdateType: MyShoppingListUpdate get: - displayName: Get my shopping list by key + displayName: Get My ShoppingList by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] queryParameters: expand: description: | When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), [expand the entire array](/general-concepts#reference-expansion). You cannot expand a single element (for example, `expand=lineItems[0].variant` is not supported). type: Expansion[] required: false + description: | + Returns a ShoppingList for a given `key`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `key`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/my-shopping-list.example.json head: + displayName: Check if ShoppingList exists by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] - description: Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if the ShoppingList exists or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] + description: | + Checks if a ShoppingList exists for a given `key`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `key`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + post: - displayName: Update my shopping list by key + displayName: Update My ShoppingList by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] queryParameters: expand: description: | @@ -1085,21 +1441,47 @@ delete: body: application/json: example: !include ../examples/my-shopping-list-update.example.json + description: | + Updates a ShoppingList for a given `key`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `key`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: application/json: example: !include ../examples/my-shopping-list.example.json delete: - displayName: Delete my shopping list by key + displayName: Delete My ShoppingList by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_shopping_lists:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + [ + 'manage_my_shopping_lists:{projectKey}', + 'customer_id:{id}', + 'anonymous_id:{id}', + ], + }, + ] queryParameters: expand: description: | When expanding `variant` and `productSlug` on [ShoppingListLineItem](ctp:api:type:ShoppingListLineItem), [expand the entire array](/general-concepts#reference-expansion). You cannot expand a single element (for example, `expand=lineItems[0].variant` is not supported). type: Expansion[] required: false + description: | + Deletes the ShoppingList for a given `key`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no ShoppingList exists for the given `key`. + - If a ShoppingList exists but does not contain either an `anonymousId` that matches the [anonymous_id:{id}](/scopes#anonymous_idid) scope, or a `customer` with `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: