diff --git a/api-specs/api/examples/extension-update-response.example.json b/api-specs/api/examples/extension-update-response.example.json new file mode 100644 index 0000000000..882edb5392 --- /dev/null +++ b/api-specs/api/examples/extension-update-response.example.json @@ -0,0 +1,21 @@ +{ + "id": "8062243c-46fc-40b5-88a4-75e2216aef75", + "version": 2, + "createdAt": "2017-01-25T14:14:22.417Z", + "lastModifiedAt": "2024-08-06T13:49:48.511Z", + "destination": { + "type": "HTTP", + "url": "https://example.azurewebsites.net/api/extension", + "authentication": { + "type": "AzureFunctions", + "key": "****code" + } + }, + "triggers": [ + { + "resourceTypeId": "cart", + "actions": ["Create", "Update"] + } + ], + "key": "my-new-extension-key" +} diff --git a/api-specs/api/examples/extension-update.example.json b/api-specs/api/examples/extension-update.example.json index b0ca53aaf3..392da2518a 100644 --- a/api-specs/api/examples/extension-update.example.json +++ b/api-specs/api/examples/extension-update.example.json @@ -1,7 +1,9 @@ { "version": 1, - "actions": [{ - "action": "setKey", - "key": "my-new-extension-key" - }] + "actions": [ + { + "action": "setKey", + "key": "my-new-extension-key" + } + ] } diff --git a/api-specs/api/examples/extension.example.json b/api-specs/api/examples/extension.example.json index 54cccc5e06..2094a8b2a8 100644 --- a/api-specs/api/examples/extension.example.json +++ b/api-specs/api/examples/extension.example.json @@ -8,12 +8,14 @@ "url": "https://example.azurewebsites.net/api/extension", "authentication": { "type": "AzureFunctions", - "key": "some-azure-function-code" + "key": "****code" } }, - "triggers": [{ - "resourceTypeId": "cart", - "actions": ["Create", "Update"] - }], + "triggers": [ + { + "resourceTypeId": "cart", + "actions": ["Create", "Update"] + } + ], "key": "my-extension" } diff --git a/api-specs/api/examples/state-create.example.json b/api-specs/api/examples/state-create.example.json index 210d50e195..7273d9e1f0 100644 --- a/api-specs/api/examples/state-create.example.json +++ b/api-specs/api/examples/state-create.example.json @@ -1,6 +1,12 @@ { - "key": "test-state", - "type": "ProductState", + "key": "Initial", + "type": "LineItemState", "roles": [], + "name": { + "en": "Initial" + }, + "description": { + "en": "Initial is the first State that a (custom) Line Item gets after its creation." + }, "initial": true } diff --git a/api-specs/api/examples/state-update-response.example.json b/api-specs/api/examples/state-update-response.example.json new file mode 100644 index 0000000000..91dcdfb0f2 --- /dev/null +++ b/api-specs/api/examples/state-update-response.example.json @@ -0,0 +1,17 @@ +{ + "id": "7c2e2694-aefe-43d7-888e-6a99514caaca", + "version": 2, + "key": "Initial", + "type": "LineItemState", + "roles": [], + "name": { + "en": "New Name" + }, + "description": { + "en": "Initial is the first State that a (custom) Line Item gets after its creation." + }, + "builtIn": true, + "initial": true, + "createdAt": "2015-01-21T09:22:03.906Z", + "lastModifiedAt": "2024-08-06T13:49:48.511Z" +} diff --git a/api-specs/api/examples/state-update.example.json b/api-specs/api/examples/state-update.example.json index f04710fc9b..e94e276728 100644 --- a/api-specs/api/examples/state-update.example.json +++ b/api-specs/api/examples/state-update.example.json @@ -1,9 +1,11 @@ { "version": 1, - "actions": [{ - "action": "setName", - "name": { - "en": "New Name" + "actions": [ + { + "action": "setName", + "name": { + "en": "New Name" + } } - }] + ] } diff --git a/api-specs/api/examples/state.example.json b/api-specs/api/examples/state.example.json index d78765f906..dd808e6173 100644 --- a/api-specs/api/examples/state.example.json +++ b/api-specs/api/examples/state.example.json @@ -8,7 +8,7 @@ "en": "Initial" }, "description": { - "en": "Initial is the first that (custom) line item gets after its creation" + "en": "Initial is the first State that a (custom) Line Item gets after its creation." }, "builtIn": true, "initial": true, diff --git a/api-specs/api/examples/states.example.json b/api-specs/api/examples/states.example.json index 9f78f89d81..6853e629c8 100644 --- a/api-specs/api/examples/states.example.json +++ b/api-specs/api/examples/states.example.json @@ -14,7 +14,7 @@ "en": "Initial" }, "description": { - "en": "Initial is the first that (custom) line item gets after it's creation" + "en": "Initial is the first State that a (custom) Line Item gets after its creation." }, "builtIn": true, "initial": true, diff --git a/api-specs/api/examples/subscription-create.example.json b/api-specs/api/examples/subscription-create.example.json index a335406032..9b580a9915 100644 --- a/api-specs/api/examples/subscription-create.example.json +++ b/api-specs/api/examples/subscription-create.example.json @@ -1,9 +1,9 @@ { "destination": { "type": "SQS", - "queueUrl": "", + "queueUrl": "https://sqs.my-region.amazonaws.com/my-aws-account-number/my-queue", "authenticationMode": "IAM", - "region": "" + "region": "my-region" }, "messages": [ { diff --git a/api-specs/api/examples/subscription-update-response.example.json b/api-specs/api/examples/subscription-update-response.example.json new file mode 100644 index 0000000000..8753bed656 --- /dev/null +++ b/api-specs/api/examples/subscription-update-response.example.json @@ -0,0 +1,24 @@ +{ + "id": "bf79c5d2-2813-4229-9a88-e7c76be50986", + "version": 2, + "destination": { + "type": "SQS", + "queueUrl": "https://sqs.my-region.amazonaws.com/my-aws-account-number/my-queue", + "authenticationMode": "IAM", + "region": "my-region" + }, + "messages": [ + { + "resourceTypeId": "product", + "types": [] + } + ], + "changes": [], + "createdAt": "2017-01-25T14:14:22.417Z", + "key": "new-key", + "format": { + "type": "Platform" + }, + "lastModifiedAt": "2024-08-06T13:49:48.511Z", + "status": "Healthy" +} diff --git a/api-specs/api/examples/subscription-update.example.json b/api-specs/api/examples/subscription-update.example.json index e737552346..c6bc40482c 100644 --- a/api-specs/api/examples/subscription-update.example.json +++ b/api-specs/api/examples/subscription-update.example.json @@ -1,7 +1,9 @@ { "version": 1, - "actions": [{ - "action": "setKey", - "key": "queue-key" - }] + "actions": [ + { + "action": "setKey", + "key": "new-key" + } + ] } diff --git a/api-specs/api/examples/subscription.example.json b/api-specs/api/examples/subscription.example.json index 19b703c589..1e01d75ee3 100644 --- a/api-specs/api/examples/subscription.example.json +++ b/api-specs/api/examples/subscription.example.json @@ -1,11 +1,11 @@ { - "id": "8062243c-46fc-40b5-88a4-75e2216aef75", + "id": "bf79c5d2-2813-4229-9a88-e7c76be50986", "version": 1, "destination": { "type": "SQS", - "queueUrl": "", + "queueUrl": "https://sqs.my-region.amazonaws.com/my-aws-account-number/my-queue", "authenticationMode": "IAM", - "region": "" + "region": "my-region" }, "messages": [ { diff --git a/api-specs/api/examples/subscriptions.example.json b/api-specs/api/examples/subscriptions.example.json index 44364b179f..e16bc159f3 100644 --- a/api-specs/api/examples/subscriptions.example.json +++ b/api-specs/api/examples/subscriptions.example.json @@ -5,7 +5,7 @@ "total": 1, "results": [ { - "id": "8062243c-46fc-40b5-88a4-75e2216aef75", + "id": "bf79c5d2-2813-4229-9a88-e7c76be50986", "version": 1, "destination": { "type": "SQS", diff --git a/api-specs/api/examples/type-update-response.example.json b/api-specs/api/examples/type-update-response.example.json new file mode 100644 index 0000000000..0eeedc5dab --- /dev/null +++ b/api-specs/api/examples/type-update-response.example.json @@ -0,0 +1,27 @@ +{ + "id": "3ae9bcca-df23-443e-bd22-0c592f9694fa", + "version": 2, + "key": "lineitemtype", + "name": { + "en": "New Name" + }, + "description": { + "en": "description" + }, + "resourceTypeIds": ["line-item"], + "fieldDefinitions": [ + { + "name": "offer_name", + "label": { + "en": "offer_name" + }, + "required": false, + "type": { + "name": "String" + }, + "inputHint": "SingleLine" + } + ], + "createdAt": "2015-10-07T06:56:19.217Z", + "lastModifiedAt": "2024-08-06T13:49:48.511Z" +} diff --git a/api-specs/api/examples/type-update.example.json b/api-specs/api/examples/type-update.example.json index 7cb405d234..d882d11493 100644 --- a/api-specs/api/examples/type-update.example.json +++ b/api-specs/api/examples/type-update.example.json @@ -1,9 +1,11 @@ { "version": 1, - "actions": [{ - "action": "changeName", - "name": { - "en": "New Name" + "actions": [ + { + "action": "changeName", + "name": { + "en": "New Name" + } } - }] + ] } diff --git a/api-specs/api/resources/extensions.raml b/api-specs/api/resources/extensions.raml index e89073b27d..d72765d839 100644 --- a/api-specs/api/resources/extensions.raml +++ b/api-specs/api/resources/extensions.raml @@ -75,7 +75,7 @@ post: body: application/json: type: Extension - example: !include ../examples/extension.example.json + example: !include ../examples/extension-update-response.example.json delete: displayName: Delete Extension by key securedBy: [oauth_2_0: { scopes: ['manage_extensions:{projectKey}'] }] @@ -122,7 +122,7 @@ post: body: application/json: type: Extension - example: !include ../examples/extension.example.json + example: !include ../examples/extension-update-response.example.json delete: displayName: Delete Extension by ID securedBy: [oauth_2_0: { scopes: ['manage_extensions:{projectKey}'] }] diff --git a/api-specs/api/resources/in-store.raml b/api-specs/api/resources/in-store.raml index 4cbd7b4be0..a71626a740 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. - 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 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. + + 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 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,15 +1445,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. + 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: application/json: example: !include ../examples/shopping-list.example.json get: - displayName: Get my customer details in a store + displayName: Get My Customer in Store is: - sortable: sortExample: createdAt asc @@ -1305,9 +1475,19 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'customer_id:{id}', ], }, ] + description: | + Returns a Customer for a given Query Predicate in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Customer exists in the Store for the given Query Predicate. + - If a Customer exists in the Store for the given Query Predicate, but does not have an `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + - If a Customer exists for the given Query Predicate but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. + responses: 200: body: @@ -1315,7 +1495,7 @@ uriParameters: example: !include ../examples/customer.example.json type: Customer post: - displayName: Update my customer in a store + displayName: Update My Customer in Store securedBy: [ oauth_2_0: @@ -1324,9 +1504,18 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'customer_id:{id}', ], }, ] + description: | + Updates the Customer in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. + - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. + body: application/json: example: !include ../examples/customer-update.example.json @@ -1338,7 +1527,7 @@ uriParameters: example: !include ../examples/customer-update-response.example.json type: Customer delete: - displayName: Delete my Customer in a store + displayName: Delete My Customer in Store is: - versioned - conflicting @@ -1350,9 +1539,18 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'customer_id:{id}', ], }, ] + description: | + Deletes the Customer in a [Store](ctp:api:type:Store). Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. + - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. + responses: 200: body: @@ -1362,9 +1560,15 @@ uriParameters: /email/confirm: type: base post: - displayName: Verify my Customer's Email in a store + displayName: Verify email of My Customer in Store description: | - This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). + This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer-in-store). Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. + - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. + securedBy: [ oauth_2_0: @@ -1373,6 +1577,7 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'customer_id:{id}', ], }, ] @@ -1390,9 +1595,15 @@ uriParameters: /password: type: base post: - displayName: Change my customers password in a store + displayName: Change password of My Customer in Store description: | - Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. + Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. Returns a `200 OK` status if successful. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. + - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. + is: - conflicting securedBy: @@ -1403,6 +1614,7 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'customer_id:{id}', ], }, ] @@ -1419,11 +1631,17 @@ uriParameters: /reset: type: base post: - displayName: Reset my Customer's Password in a store + displayName: Reset password of My Customer in Store description: | This is the last step in the [password reset process of the authenticated Customer](/../api/projects/customers#password-reset-of-customer-in-store). - Resetting a password produces the of the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. + Resetting a password produces the Customer [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. + + A [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error is returned in the following scenarios: + + - If no Customer exists with the `id` specified in the [customer:{id}](/scopes#customer_idid) scope. + - If the Customer exists but is associated with a different Store than what is specified in the `manage_my_profile:{projectKey}:{storeKey}` scope. + securedBy: [ oauth_2_0: @@ -1432,6 +1650,7 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'customer_id:{id}', ], }, ] @@ -1448,8 +1667,11 @@ uriParameters: /signup: type: base post: - displayName: Signup my customer in a store + displayName: Create (sign up) My Customer in Store description: | + + If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. + If omitted in the request body, the [Customer](ctp:api:type:Customer) `stores` field is set to the [Store](ctp:api:type:Store) specified in the path parameter. A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). @@ -1463,6 +1685,7 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'anonymous_id:{id}', ], }, ] @@ -1479,10 +1702,13 @@ uriParameters: /login: type: base post: - displayName: Authenticate my Customer (Sign In) in a store + displayName: Authenticate (sign in) My Customer in Store description: | + Retrieves the authenticated Customer (that matches the given email/password pair) if they are part of a specific [Store](ctp:api:type:Store). + If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. + - If the Customer does not have a Cart, the most recently modified anonymous cart becomes the Customer's Cart. - If the Customer already has a Cart, the most recently modified anonymous cart is handled according to [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). @@ -1498,6 +1724,7 @@ uriParameters: [ 'manage_my_profile:{projectKey}', 'manage_my_profile:{projectKey}:{storeKey}', + 'anonymous_id:{id}', ], }, ] @@ -1543,12 +1770,12 @@ 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[] post: - displayName: Create customer in store + displayName: Create Customer in Store securedBy: - oauth_2_0: scopes: @@ -1942,7 +2169,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 +2204,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 +2245,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 +2283,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 +2315,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 +2351,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 +2389,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 +2421,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: @@ -2916,6 +3143,7 @@ uriParameters: (createable): QuoteRequestDraft description: A request for a Quote holds product variants and can be ordered. get: + displayName: Get QuoteRequest in Store by ID securedBy: [ oauth_2_0: @@ -2933,6 +3161,7 @@ uriParameters: application/json: example: !include ../examples/quote-requests.example.json head: + displayName: Check if QuoteRequest exists in Store securedBy: [ oauth_2_0: @@ -2944,11 +3173,13 @@ 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[] post: + displayName: Create QuoteRequest in Store + description: | securedBy: [ oauth_2_0: @@ -2976,6 +3207,7 @@ uriParameters: resourceType: QuoteRequest resourceUpdateType: QuoteRequestUpdate get: + displayName: Get QuoteRequest in Store by Key securedBy: [ oauth_2_0: @@ -2993,6 +3225,7 @@ uriParameters: application/json: example: !include ../examples/quote-request.example.json head: + displayName: Check if QuoteRequest exists in Store by Key securedBy: [ oauth_2_0: @@ -3004,8 +3237,9 @@ 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: + displayName: Update QuoteRequest in Store by Key securedBy: [ oauth_2_0: @@ -3026,6 +3260,7 @@ uriParameters: application/json: example: !include ../examples/quote-request-update-response.example.json delete: + displayName: Delete QuoteRequest in Store by Key is: - dataErasure securedBy: @@ -3052,6 +3287,7 @@ uriParameters: resourceType: QuoteRequest resourceUpdateType: QuoteRequestUpdate get: + displayName: Get QuoteRequest in Store by ID securedBy: [ oauth_2_0: @@ -3069,6 +3305,7 @@ uriParameters: application/json: example: !include ../examples/quote-request.example.json head: + displayName: Check if QuoteRequest exists in Store by ID securedBy: [ oauth_2_0: @@ -3080,8 +3317,9 @@ 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: + displayName: Update QuoteRequest in Store by ID securedBy: [ oauth_2_0: @@ -3102,6 +3340,7 @@ uriParameters: application/json: example: !include ../examples/quote-request-update-response.example.json delete: + displayName: Delete QuoteRequest in Store by ID is: - dataErasure securedBy: @@ -3161,7 +3400,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 +3460,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 +3536,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 +3617,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 +3677,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 +3753,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 e2bf4880c6..663a3afff8 100644 --- a/api-specs/api/resources/me.raml +++ b/api-specs/api/resources/me.raml @@ -1,13 +1,25 @@ type: base get: - displayName: Get my customer details + displayName: Get My Customer is: - sortable: - paging - expandable - query: whereExample: 'customerEmail = "email@example.com"' - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'customer_id:{id}'] }, + ] + description: | + Returns a Customer 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 Customer exists for the given Query Predicate. + - If a Customer exists for the given Query Predicate, but does not have an `id` value that matches the [customer:{id}](/scopes#customer_idid) scope. + responses: 200: body: @@ -15,12 +27,18 @@ get: example: !include ../examples/customer.example.json type: Customer post: - displayName: Update my customer - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + displayName: Update My Customer + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: example: !include ../examples/customer-update.example.json type: MyCustomerUpdate + description: | + Updates the Customer specified in the [customer:{id}](/scopes#customer_idid) scope. Returns a `200 OK` status if successful. responses: 200: body: @@ -28,11 +46,16 @@ post: example: !include ../examples/customer-update-response.example.json type: Customer delete: - displayName: Delete my Customer + displayName: Delete My Customer is: - versioned - conflicting - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'customer_id:{id}'] }, + ] + description: Deletes the Customer specified in the [customer:{id}](/scopes#customer_idid) scope. Returns a `200 OK` status if successful. responses: 200: body: @@ -42,10 +65,14 @@ delete: /email/confirm: type: base post: - displayName: Verify my Customer's Email + displayName: Verify email of My Customer description: | This is the last step in the [email verification process of a Customer](/../api/projects/customers#email-verification-of-customer). - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: example: !include ../examples/Customer/CustomerEmailVerify.json @@ -60,14 +87,18 @@ delete: /password: type: base post: - displayName: Change my customers password + displayName: Change password of My Customer description: | Changing the password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=false`. If the current password does not match, an [InvalidCurrentPassword](ctp:api:type:InvalidCurrentPasswordError) error is returned. is: - conflicting - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: type: MyCustomerChangePassword @@ -81,12 +112,16 @@ delete: /reset: type: base post: - displayName: Reset my Customer's Password + displayName: Reset password of My Customer description: | This is the last step in the [password reset process of a Customer](/../api/projects/customers#password-reset-of-customer). Resetting a password of the Customer produces the [CustomerPasswordUpdated](ctp:api:type:CustomerPasswordUpdatedMessage) Message with `reset=true`. - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'customer_id:{id}'] }, + ] body: application/json: example: !include ../examples/Customer/CustomerResetPassword.json @@ -100,12 +135,16 @@ delete: /signup: type: base post: - displayName: Signup my customer + displayName: Create (sign up) My Customer description: | - If used with an [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. + If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly created Customer. Creating a Customer produces the [CustomerCreated](ctp:api:type:CustomerCreatedMessage) Message. - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'anonymous_id:{id}'] }, + ] body: application/json: example: !include ../examples/customer-create.example.json @@ -119,11 +158,11 @@ delete: /login: type: base post: - displayName: Authenticate my Customer (Sign In) + displayName: Authenticate (sign in) My Customer description: | Retrieves the authenticated customer (that matches the given email/password pair). - If used with [an access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. + If used with an optional [access token for an anonymous session](ctp:api:type:AnonymousSession), all Orders and Carts that belong to the `anonymousId` are assigned to the newly logged-in Customer. - If the Customer does not have a Cart yet, the most recently modified anonymous cart becomes the Customer's Cart. - If the Customer already has a Cart, the most recently modified anonymous cart is handled in accordance with [AnonymousCartSignInMode](ctp:api:type:AnonymousCartSignInMode). @@ -131,8 +170,11 @@ delete: A Cart returned in the [CustomerSignInResult](ctp:api:type:CustomerSignInResult) has any invalid Line Items removed and is [updated](/api/carts-orders-overview#cart-updates) with the latest prices, taxes, and discounts. During these updates, the following errors can be returned: [MatchingPriceNotFound](ctp:api:type:MatchingPriceNotFoundError) and [MissingTaxRateForCountry](ctp:api:type:MissingTaxRateForCountryError). If an account with the given credentials is not found, an [InvalidCredentials](ctp:api:type:InvalidCredentialsError) error is returned. - - securedBy: [oauth_2_0: { scopes: ['manage_my_profile:{projectKey}'] }] + securedBy: + [ + oauth_2_0: + { scopes: ['manage_my_profile:{projectKey}', 'anonymous_id:{id}'] }, + ] body: application/json: type: MyCustomerSignin @@ -146,23 +188,57 @@ 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 by Query Predicate + 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: @@ -177,24 +253,47 @@ delete: description: MyBusinessUnit creates and provides access to Business Units scoped to a specific user. get: displayName: Query My Business Units + description: | + Returns all of the authenticated Customer’s Business Units in a Project. Returns a `200 OK` status if successful, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] responses: 200: body: application/json: example: !include ../examples/my-business-units.example.json head: + displayName: Check if Business Unit exists by Query Predicate securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] - description: Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] + description: | + Checks if a BusinessUnit exists for a given Query Predicate. Returns a `200 OK` status if any BusinessUnits match the Query Predicate and the Customer has access to them, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. queryParameters: where?: type: QueryPredicate[] post: displayName: Create My Business Units securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] description: | Automatically assigns the Associate to the Business Unit in the default [Associate Role](ctp:api:type:AssociateRole) defined in [BusinessUnitConfiguration](ctp:api:type:BusinessUnitConfiguration). If there is no default Associate Role configured, this request fails with an [InvalidOperation](ctp:api:type:InvalidOperationError) error. When creating a Division, the Associate must have the `AddChildUnits` [Permission](ctp:api:type:Permission) in the parent unit. If the required [Permission](/projects/associate-roles#permission) is missing, an [AssociateMissingPermission](/errors#associatemissingpermission) error is returned. body: @@ -213,22 +312,46 @@ delete: resourceType: BusinessUnit resourceUpdateType: MyBusinessUnitUpdate get: - displayName: Get My Business Units by ID + displayName: Get My Business Unit by ID + description: | + Returns a Business Unit for a given `id`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] responses: 200: body: application/json: example: !include ../examples/my-business-unit.example.json head: + displayName: Check if Business Unit exists by ID securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] - description: Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] + description: Checks if a BusinessUnit exists for a given `id`. Returns a `200 OK` status if the BusinessUnit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: displayName: Update My Business Units by ID + description: | + Updates a Business Unit for a given `id`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] body: application/json: example: !include ../examples/my-business-unit-update.example.json @@ -237,15 +360,6 @@ delete: body: application/json: example: !include ../examples/my-business-unit.example.json - delete: - displayName: Delete My Business Units by ID - securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] - responses: - 200: - body: - application/json: - example: !include ../examples/my-business-unit.example.json /key={key}: (methodName): withKey type: @@ -254,22 +368,45 @@ delete: resourceType: BusinessUnit resourceUpdateType: MyBusinessUnitUpdate get: - displayName: Get My Business Units by Key + displayName: Get My Business Unit by Key + description: Returns a Business Unit for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] responses: 200: body: application/json: example: !include ../examples/my-business-unit.example.json head: + displayName: Check if Business Unit exists by Key securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] - description: Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the BusinessUnit exists or a `404 Not Found` otherwise. + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] + description: Checks if a BusinessUnit exists for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. post: - displayName: Update My Business Units by Key + displayName: Update My Business Unit by Key + description: Updates a Business Unit for a given `key`. Returns a `200 OK` status if the Business Unit exists and the Customer has access to it, or a [ResourceNotFound](ctp:api:type:ResourceNotFoundError) error otherwise. + securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] + [ + oauth_2_0: + { + scopes: + ['manage_my_business_units:{projectKey}', 'customer_id:{id}'], + }, + ] body: application/json: example: !include ../examples/my-business-unit-update.example.json @@ -278,15 +415,6 @@ delete: body: application/json: example: !include ../examples/my-business-unit.example.json - delete: - displayName: Delete My Business Units by Key - securedBy: - [oauth_2_0: { scopes: ['manage_my_business_units:{projectKey}'] }] - responses: - 200: - body: - application/json: - example: !include ../examples/my-business-unit.example.json /carts: type: baseDomain: @@ -321,6 +449,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 +463,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 +482,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 +500,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 +522,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 +549,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 +571,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 +601,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 +669,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 +724,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 +745,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 +774,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 +839,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 +951,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 +1008,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 +1051,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 +1059,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 +1102,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 +1112,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 +1142,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 +1184,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 +1230,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 +1263,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 +1326,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 +1359,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 +1403,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 +1457,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 +1534,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: diff --git a/api-specs/api/resources/product-projections-search.raml b/api-specs/api/resources/product-projections-search.raml index 7bb56543f3..ac7c4a1047 100644 --- a/api-specs/api/resources/product-projections-search.raml +++ b/api-specs/api/resources/product-projections-search.raml @@ -44,9 +44,10 @@ get: The fuzzy level desired, if fuzzy is enabled. This value cannot exceed the default value that is calculated based on the length of the searched text. markMatchingVariants?: type: boolean + default: false description: | - if `markMatchingVariants` parameter is `true` those ProductVariants that match the search query have the additional - field `isMatchingVariant` set to `true`. For the other variants in the same product projection this field is set to `false`. + If `markMatchingVariants` parameter is `true`, those ProductVariants that match the search query have the additional + field `isMatchingVariant` set to `true`. For the other variants in the same product projection, this field is set to `false`. filter?: type: string[] filter.facets?: diff --git a/api-specs/api/resources/product-projections-suggest.raml b/api-specs/api/resources/product-projections-suggest.raml index 7543ac6da5..9732f3424a 100644 --- a/api-specs/api/resources/product-projections-suggest.raml +++ b/api-specs/api/resources/product-projections-suggest.raml @@ -23,15 +23,13 @@ get: The default limit is `10` Suggestions per language and the maximum is `100`. fuzzy?: type: boolean + default: false description: | - Defaults to `false`. - If set to `true`, [fuzzy search](/../api/projects/products-search#fuzzy-search) is applied on the text to analyze. staged?: type: boolean + default: false description: | - Defaults to `false`. - If set to `true` (possible only while using the `view_products` scope), staged projections is queried. is: - projectionSelecting diff --git a/api-specs/api/resources/products.raml b/api-specs/api/resources/products.raml index 3d2e528cf4..70d6b99160 100644 --- a/api-specs/api/resources/products.raml +++ b/api-specs/api/resources/products.raml @@ -78,7 +78,7 @@ post: is: - priceSelecting description: |- - If [Product price selection query parameters]](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. + If [Product price selection query parameters](/../api/pricing-and-discounts-overview#product-price-selection) are provided, the selected Prices are added to the response. responses: 200: body: diff --git a/api-specs/api/resources/quote-requests.raml b/api-specs/api/resources/quote-requests.raml index ae4b7173c4..9f18ebf24a 100644 --- a/api-specs/api/resources/quote-requests.raml +++ b/api-specs/api/resources/quote-requests.raml @@ -17,12 +17,14 @@ get: application/json: example: !include ../examples/quote-requests.example.json head: + displayName: Check if QuoteRequest exists by Query Predicate securedBy: [oauth_2_0: { scopes: ['view_quote_requests:{projectKey}'] }] 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. queryParameters: where?: type: QueryPredicate[] post: + displayName: Create QuoteRequest securedBy: [oauth_2_0: { scopes: ['manage_quote_requests:{projectKey}'] }] body: application/json: @@ -40,6 +42,7 @@ post: resourceType: QuoteRequest resourceUpdateType: QuoteRequestUpdate get: + displayName: Get QuoteRequest by Key securedBy: [oauth_2_0: { scopes: ['view_quote_requests:{projectKey}'] }] responses: 200: @@ -47,9 +50,11 @@ post: application/json: example: !include ../examples/quote-request.example.json head: + displayName: Check if QuoteRequest exists by Key securedBy: [oauth_2_0: { scopes: ['view_quote_requests:{projectKey}'] }] 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. post: + displayName: Update QuoteRequest by Key securedBy: [oauth_2_0: { scopes: ['manage_quote_requests:{projectKey}'] }] body: application/json: @@ -60,6 +65,7 @@ post: application/json: example: !include ../examples/quote-request-update-response.example.json delete: + displayName: Delete QuoteRequest by Key is: - dataErasure securedBy: [oauth_2_0: { scopes: ['manage_quote_requests:{projectKey}'] }] @@ -76,6 +82,7 @@ post: resourceType: QuoteRequest resourceUpdateType: QuoteRequestUpdate get: + displayName: Get QuoteRequest by ID securedBy: [oauth_2_0: { scopes: ['view_quote_requests:{projectKey}'] }] responses: 200: @@ -83,9 +90,11 @@ post: application/json: example: !include ../examples/quote-request.example.json head: + displayName: Check if QuoteRequest exists by ID securedBy: [oauth_2_0: { scopes: ['view_quote_requests:{projectKey}'] }] 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. post: + displayName: Update QuoteRequest by ID securedBy: [oauth_2_0: { scopes: ['manage_quote_requests:{projectKey}'] }] body: application/json: @@ -96,6 +105,7 @@ post: application/json: example: !include ../examples/quote-request-update-response.example.json delete: + displayName: Delete QuoteRequest by ID is: - dataErasure securedBy: [oauth_2_0: { scopes: ['manage_quote_requests:{projectKey}'] }] diff --git a/api-specs/api/resources/states.raml b/api-specs/api/resources/states.raml index 1e1814bb08..bd71a69f2c 100644 --- a/api-specs/api/resources/states.raml +++ b/api-specs/api/resources/states.raml @@ -66,7 +66,7 @@ post: 200: body: application/json: - example: !include ../examples/state.example.json + example: !include ../examples/state-update-response.example.json delete: securedBy: [oauth_2_0: { scopes: ['manage_states:{projectKey}'] }] responses: @@ -100,7 +100,7 @@ post: 200: body: application/json: - example: !include ../examples/state.example.json + example: !include ../examples/state-update-response.example.json delete: securedBy: [oauth_2_0: { scopes: ['manage_states:{projectKey}'] }] responses: diff --git a/api-specs/api/resources/subscriptions.raml b/api-specs/api/resources/subscriptions.raml index e760e63784..d476581446 100644 --- a/api-specs/api/resources/subscriptions.raml +++ b/api-specs/api/resources/subscriptions.raml @@ -34,7 +34,7 @@ post: is: - deprecatable201 description: | - A test message is sent to ensure the correct configuration of the Destination. If the message cannot be delivered, the Subscription will not be created. The payload of the test message is a notification of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. + A test notification is sent to ensure the correct configuration of the Destination. If the notification cannot be delivered, the Subscription will not be created. The payload of the test notification is of type [ResourceCreated](/../api/projects/subscriptions#resourcecreateddeliverypayload) for the `resourceTypeId` `subscription`. body: application/json: type: SubscriptionDraft @@ -79,7 +79,7 @@ post: body: application/json: type: Subscription - example: !include ../examples/subscription.example.json + example: !include ../examples/subscription-update-response.example.json delete: displayName: Delete Subscription by key securedBy: [oauth_2_0: { scopes: ['manage_subscriptions:{projectKey}'] }] @@ -126,7 +126,7 @@ post: body: application/json: type: Subscription - example: !include ../examples/subscription.example.json + example: !include ../examples/subscription-update-response.example.json delete: displayName: Update Subscription by ID securedBy: [oauth_2_0: { scopes: ['manage_subscriptions:{projectKey}'] }] diff --git a/api-specs/api/resources/types.raml b/api-specs/api/resources/types.raml index 66869e6b7f..becd085ebc 100644 --- a/api-specs/api/resources/types.raml +++ b/api-specs/api/resources/types.raml @@ -63,7 +63,7 @@ post: 200: body: application/json: - example: !include ../examples/type.example.json + example: !include ../examples/type-update-response.example.json delete: securedBy: [oauth_2_0: { scopes: ['manage_types:{projectKey}'] }] responses: @@ -97,7 +97,7 @@ post: 200: body: application/json: - example: !include ../examples/type.example.json + example: !include ../examples/type-update-response.example.json delete: securedBy: [oauth_2_0: { scopes: ['manage_types:{projectKey}'] }] responses: diff --git a/api-specs/api/traits/data-erasure.raml b/api-specs/api/traits/data-erasure.raml index d4d4058d5a..06165326de 100644 --- a/api-specs/api/traits/data-erasure.raml +++ b/api-specs/api/traits/data-erasure.raml @@ -4,6 +4,6 @@ queryParameters: dataErasure: type: boolean required: false + default: false description: | - Defaults to `false`. - Set to `true` if you want to [erase all related personal data](/../api/gdpr#data-erasure-of-personal-data) in compliance with GDPR. + To [erase all related personal data](/../api/gdpr#data-erasure-of-personal-data) in compliance with GDPR, set to `true`. diff --git a/api-specs/api/traits/projection-selecting.raml b/api-specs/api/traits/projection-selecting.raml index 4c8e27daef..700918a40c 100644 --- a/api-specs/api/traits/projection-selecting.raml +++ b/api-specs/api/traits/projection-selecting.raml @@ -5,6 +5,4 @@ queryParameters: type: boolean default: false description: | - Defaults to `false`. - Set to `true` to retrieve the [staged](ctp:api:type:CurrentStaged) Product Projection - (only for API Clients that have the `view_products:{projectKey}` scope). + To retrieve the [staged](ctp:api:type:CurrentStaged) Product Projection (only for API Clients that have the `view_products:{projectKey}` scope), set to `true`. diff --git a/api-specs/api/types/cart/LineItemPriceMode.raml b/api-specs/api/types/cart/LineItemPriceMode.raml index 3b2e1ad5c6..819e5d99f1 100644 --- a/api-specs/api/types/cart/LineItemPriceMode.raml +++ b/api-specs/api/types/cart/LineItemPriceMode.raml @@ -20,5 +20,5 @@ enum: The Line Item price with the total is set externally. Cart Discounts are deactivated for Line Items with this price mode, despite a matching [CartDiscountLineItemsTarget](ctp:api:type:CartDiscountLineItemsTarget) or [MultiBuyLineItemsTarget](ctp:api:type:MultiBuyLineItemsTarget). Although a Line Item with this price mode has both `price` and `totalPrice` set externally, only `totalPrice` is used to calculate the total price of a Cart. - All update actions that change the quantity of a Line Item with this price mode can set the new price with the `externalTotal` field. - If the `externalTotal` field is not given in the update actions, the external price is unset and the price mode is set to `Platform`. + All update actions that change the quantity of a Line Item with this price mode can set the new price with the `externalTotalPrice` field. + If the `externalTotalPrice` field is not given in the update actions, the external price is unset and the price mode is set to `Platform`. diff --git a/api-specs/api/types/extension/ExtensionResourceTypeId.raml b/api-specs/api/types/extension/ExtensionResourceTypeId.raml index 359f8f5c29..4f019eca2b 100644 --- a/api-specs/api/types/extension/ExtensionResourceTypeId.raml +++ b/api-specs/api/types/extension/ExtensionResourceTypeId.raml @@ -13,6 +13,7 @@ enum: - staged-quote - quote - business-unit + - shopping-list (enumDescriptions): cart: Extension triggered for operations on [Carts](/../api/projects/carts). order: Extension triggered for operations on [Orders](/../api/projects/orders). @@ -22,3 +23,4 @@ enum: staged-quote: Extension triggered for operations on [StagedQuotes](/../api/projects/staged-quotes). quote: Extension triggered for operations on [Quotes](/../api/projects/quotes). business-unit: Extension triggered for operations on [BusinessUnits](/../api/projects/business-units). + shopping-list: Extension triggered for operations on [ShoppingLists](/../api/projects/shoppingLists). diff --git a/api-specs/api/types/me/MyQuoteRequestDraft.raml b/api-specs/api/types/me/MyQuoteRequestDraft.raml index 2fefa1db0f..13d54dcb08 100644 --- a/api-specs/api/types/me/MyQuoteRequestDraft.raml +++ b/api-specs/api/types/me/MyQuoteRequestDraft.raml @@ -6,7 +6,9 @@ properties: cartId: type: string description: | - `id` of the Cart from which the Quote Request is created. + `id` of the Cart from which the Quote Request is created. Carts with [Discount Codes](ctp:api:type:DiscountCode) and Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode) are not supported. + The Cart must have a `shippingAddress` defined, otherwise an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned when [creating a Quote Request](ctp:api:endpoint:/{projectKey}/me/quote-requests:POST). + cartVersion: type: number format: int64 diff --git a/api-specs/api/types/message/DeliveryAddressSetMessage.raml b/api-specs/api/types/message/DeliveryAddressSetMessage.raml index f6dcafb920..f4bb22d019 100644 --- a/api-specs/api/types/message/DeliveryAddressSetMessage.raml +++ b/api-specs/api/types/message/DeliveryAddressSetMessage.raml @@ -9,7 +9,7 @@ properties: deliveryId: type: string description: | - Unique identifier of the [Parcel](ctp:api:type:Delivery). + Unique identifier of the [Delivery](ctp:api:type:Delivery). address?: type: Address description: | diff --git a/api-specs/api/types/message/DeliveryCustomFieldAddedMessage.raml b/api-specs/api/types/message/DeliveryCustomFieldAddedMessage.raml new file mode 100644 index 0000000000..7ff6d7d2cb --- /dev/null +++ b/api-specs/api/types/message/DeliveryCustomFieldAddedMessage.raml @@ -0,0 +1,19 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessage +displayName: DeliveryCustomFieldAddedMessage +discriminatorValue: DeliveryCustomFieldAdded +description: | + Generated after adding a Custom Field to a Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +properties: + name: + type: string + description: | + Name of the Custom Field that was added. + value: + type: CustomFieldValue + description: The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/DeliveryCustomFieldChangedMessage.raml b/api-specs/api/types/message/DeliveryCustomFieldChangedMessage.raml new file mode 100644 index 0000000000..9c2c40b5ef --- /dev/null +++ b/api-specs/api/types/message/DeliveryCustomFieldChangedMessage.raml @@ -0,0 +1,25 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessage +displayName: DeliveryCustomFieldChangedMessage +discriminatorValue: DeliveryCustomFieldChanged +description: | + Generated when an existing Custom Field on a Delivery has been changed using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +properties: + name: + type: string + description: | + Name of the Custom Field that changed. + value: + type: CustomFieldValue + description: | + [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + previousValue?: + type: CustomFieldValue + description: | + [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + When there has not been a Custom Field with the `name` on the Delivery before, a [Delivery Custom Field Added](ctp:api:type:DeliveryCustomFieldAddedMessage) Message is generated instead. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/DeliveryCustomFieldRemovedMessage.raml b/api-specs/api/types/message/DeliveryCustomFieldRemovedMessage.raml new file mode 100644 index 0000000000..2bb883fe9e --- /dev/null +++ b/api-specs/api/types/message/DeliveryCustomFieldRemovedMessage.raml @@ -0,0 +1,16 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessage +displayName: DeliveryCustomFieldRemovedMessage +discriminatorValue: DeliveryCustomFieldRemoved +description: | + Generated when a Custom Field has been removed from the Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +properties: + name: + type: string + description: | + Name of the Custom Field that was removed. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/DeliveryCustomTypeRemovedMessage.raml b/api-specs/api/types/message/DeliveryCustomTypeRemovedMessage.raml new file mode 100644 index 0000000000..aadbb629cd --- /dev/null +++ b/api-specs/api/types/message/DeliveryCustomTypeRemovedMessage.raml @@ -0,0 +1,16 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessage +displayName: DeliveryCustomTypeRemovedMessage +discriminatorValue: DeliveryCustomTypeRemoved +description: | + Generated after removing a Custom Type from a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action with empty parameters. +properties: + previousTypeId?: + type: string + description: | + `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/DeliveryCustomTypeSetMessage.raml b/api-specs/api/types/message/DeliveryCustomTypeSetMessage.raml new file mode 100644 index 0000000000..634590bde3 --- /dev/null +++ b/api-specs/api/types/message/DeliveryCustomTypeSetMessage.raml @@ -0,0 +1,19 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessage +displayName: DeliveryCustomTypeSetMessage +discriminatorValue: DeliveryCustomTypeSet +description: | + Generated after adding a Custom Type to a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action. +properties: + customFields: + type: CustomFields + description: The Custom Fields that have been set. + previousTypeId?: + type: string + description: | + `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/payload/DeliveryAddressSetMessagePayload.raml b/api-specs/api/types/message/payload/DeliveryAddressSetMessagePayload.raml index 6dac6a8714..912ed3620b 100644 --- a/api-specs/api/types/message/payload/DeliveryAddressSetMessagePayload.raml +++ b/api-specs/api/types/message/payload/DeliveryAddressSetMessagePayload.raml @@ -9,7 +9,7 @@ properties: deliveryId: type: string description: | - Unique identifier of the [Parcel](ctp:api:type:Delivery). + Unique identifier of the [Delivery](ctp:api:type:Delivery). address?: type: Address description: | diff --git a/api-specs/api/types/message/payload/DeliveryCustomFieldAddedMessagePayload.raml b/api-specs/api/types/message/payload/DeliveryCustomFieldAddedMessagePayload.raml new file mode 100644 index 0000000000..c57fb3093a --- /dev/null +++ b/api-specs/api/types/message/payload/DeliveryCustomFieldAddedMessagePayload.raml @@ -0,0 +1,19 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessagePayload +displayName: DeliveryCustomFieldAddedMessagePayload +discriminatorValue: DeliveryCustomFieldAdded +description: | + Generated after adding a Custom Field to a Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +properties: + name: + type: string + description: | + Name of the Custom Field that was added. + value: + type: CustomFieldValue + description: The added [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType). + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/payload/DeliveryCustomFieldChangedMessagePayload.raml b/api-specs/api/types/message/payload/DeliveryCustomFieldChangedMessagePayload.raml new file mode 100644 index 0000000000..f57c09ccd8 --- /dev/null +++ b/api-specs/api/types/message/payload/DeliveryCustomFieldChangedMessagePayload.raml @@ -0,0 +1,25 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessagePayload +displayName: DeliveryCustomFieldChangedMessagePayload +discriminatorValue: DeliveryCustomFieldChanged +description: | + Generated when an existing Custom Field on a Delivery has been changed using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +properties: + name: + type: string + description: | + Name of the Custom Field that changed. + value: + type: CustomFieldValue + description: | + [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) after the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + previousValue?: + type: CustomFieldValue + description: | + [CustomFieldValue](ctp:api:type:CustomFieldValue) based on the [FieldType](ctp:api:type:FieldType) before the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. + When there has not been a Custom Field with the `name` on the Delivery before, a [Delivery Custom Field Added](ctp:api:type:DeliveryCustomFieldAddedMessage) Message is generated instead. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/payload/DeliveryCustomFieldRemovedMessagePayload.raml b/api-specs/api/types/message/payload/DeliveryCustomFieldRemovedMessagePayload.raml new file mode 100644 index 0000000000..9e32192274 --- /dev/null +++ b/api-specs/api/types/message/payload/DeliveryCustomFieldRemovedMessagePayload.raml @@ -0,0 +1,16 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessagePayload +displayName: DeliveryCustomFieldRemovedMessagePayload +discriminatorValue: DeliveryCustomFieldRemoved +description: | + Generated when a Custom Field has been removed from the Delivery using the [Set CustomField](ctp:api:type:OrderSetDeliveryCustomFieldAction) update action. +properties: + name: + type: string + description: | + Name of the Custom Field that was removed. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/payload/DeliveryCustomTypeRemovedMessagePayload.raml b/api-specs/api/types/message/payload/DeliveryCustomTypeRemovedMessagePayload.raml new file mode 100644 index 0000000000..3892bce270 --- /dev/null +++ b/api-specs/api/types/message/payload/DeliveryCustomTypeRemovedMessagePayload.raml @@ -0,0 +1,16 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessagePayload +displayName: DeliveryCustomTypeRemovedMessagePayload +discriminatorValue: DeliveryCustomTypeRemoved +description: | + Generated after removing a Custom Type from a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action with empty parameters. +properties: + previousTypeId?: + type: string + description: | + `id` of the [Custom Type](ctp:api:type:Type) that was removed. Absent if there was no previous Custom Type present. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/message/payload/DeliveryCustomTypeSetMessagePayload.raml b/api-specs/api/types/message/payload/DeliveryCustomTypeSetMessagePayload.raml new file mode 100644 index 0000000000..169c955002 --- /dev/null +++ b/api-specs/api/types/message/payload/DeliveryCustomTypeSetMessagePayload.raml @@ -0,0 +1,19 @@ +#%RAML 1.0 DataType +(package): Message +type: OrderMessagePayload +displayName: DeliveryCustomTypeSetMessagePayload +discriminatorValue: DeliveryCustomTypeSet +description: | + Generated after adding a Custom Type to a Delivery using the [Set Custom Type](ctp:api:type:OrderSetDeliveryCustomTypeAction) update action. +properties: + customFields: + type: CustomFields + description: The Custom Fields that have been set. + previousTypeId?: + type: string + description: | + `id` of the previous [Custom Type](ctp:api:type:Type). Absent if there was no previous Custom Type present. + deliveryId: + type: string + description: | + Unique identifier of the [Delivery](ctp:api:type:Delivery). diff --git a/api-specs/api/types/product-type/AttributeReferenceTypeId.raml b/api-specs/api/types/product-type/AttributeReferenceTypeId.raml index bbd5fa6df2..d7c15549a5 100644 --- a/api-specs/api/types/product-type/AttributeReferenceTypeId.raml +++ b/api-specs/api/types/product-type/AttributeReferenceTypeId.raml @@ -12,6 +12,7 @@ enum: - category - channel - customer + - customer-group - key-value-document - order - product @@ -35,6 +36,8 @@ enum: References a [Channel](ctp:api:type:Channel). customer: | References a [Customer](ctp:api:type:Customer). + customer-group: | + References a [CustomerGroup](ctp:api:type:CustomerGroup). key-value-document: | References a [CustomObject](ctp:api:type:CustomObject). order: | diff --git a/api-specs/api/types/quote-request/QuoteRequestDraft.raml b/api-specs/api/types/quote-request/QuoteRequestDraft.raml index edffc7b097..7435a9e509 100644 --- a/api-specs/api/types/quote-request/QuoteRequestDraft.raml +++ b/api-specs/api/types/quote-request/QuoteRequestDraft.raml @@ -7,7 +7,8 @@ properties: type: CartResourceIdentifier description: | Cart for which a Quote is requested. - Anonymous Carts, Carts with [Discount Codes](ctp:api:type:DiscountCode), or Carts with a `Multiple` [ShippingMode](ctp:api:type:ShippingMode) are not supported. + Anonymous Carts, Carts with [Discount Codes](ctp:api:type:DiscountCode), and Carts with `Multiple` [ShippingMode](ctp:api:type:ShippingMode) are not supported. + The Cart must have a `shippingAddress` defined, otherwise an [InvalidOperation](ctp:api:type:InvalidOperationError) error is returned when [creating a Quote Request](ctp:api:endpoint:/{projectKey}/quote-requests:POST). cartVersion: type: number format: int64 diff --git a/api-specs/api/types/subscription/AwsAuthenticationMode.raml b/api-specs/api/types/subscription/AwsAuthenticationMode.raml index c306384a33..b2c0a78117 100644 --- a/api-specs/api/types/subscription/AwsAuthenticationMode.raml +++ b/api-specs/api/types/subscription/AwsAuthenticationMode.raml @@ -10,5 +10,5 @@ enum: Credentials: | Subscriptions with `Credentials` authentication mode are authenticated using an `accessKey` and `accessSecret` pair. This is the default authentication mode for backwards compatibility. IAM: | - Subscriptions with `IAM` authentication mode are authenticated using Identity and Access Management (IAM). For this authentication mode, the following user requires permissions to send messages to the queue or publish to the topic: `arn:aws-cn:iam::417094354346:user/subscriptions` if the Project is hosted in the China (AWS, Ningxia) Region; `arn:aws:iam::362576667341:user/subscriptions` for all other [Regions](/../api/general-concepts#regions). This is the recommended authentication mode, as it doesn't require additional key management. + Subscriptions with `IAM` authentication mode are authenticated using Identity and Access Management (IAM). For this authentication mode, the following user requires permissions to send notifications to the queue or publish to the topic: `arn:aws-cn:iam::417094354346:user/subscriptions` if the Project is hosted in the China (AWS, Ningxia) Region; `arn:aws:iam::362576667341:user/subscriptions` for all other [Regions](/../api/general-concepts#regions). This is the recommended authentication mode, as it doesn't require additional key management. default: Credentials diff --git a/api-specs/api/types/subscription/AzureEventGridDestination.raml b/api-specs/api/types/subscription/AzureEventGridDestination.raml index e00663a105..ef7e5abe73 100644 --- a/api-specs/api/types/subscription/AzureEventGridDestination.raml +++ b/api-specs/api/types/subscription/AzureEventGridDestination.raml @@ -5,8 +5,8 @@ displayName: AzureEventGridDestination discriminatorValue: EventGrid example: !include ../../examples/Subscription/SubscriptionAzureEventGridDestination.json description: | - [Azure Event Grid](https://azure.microsoft.com/en-us/products/event-grid/) can be used to push messages to Azure Functions, HTTP endpoints (webhooks), and several other Azure tools. Event Grid can only be used with the [CloudEventsFormat](ctp:api:type:CloudEventsFormat). - To set up a Subscription with Azure Event Grid, first create a topic in the [Azure Portal](https://azure.microsoft.com/en-us/get-started/azure-portal/). To allow Composable Commerce to push messages to your topic, provide an [access key](https://docs.microsoft.com/en-us/azure/event-grid/get-access-keys). + [Azure Event Grid](https://azure.microsoft.com/en-us/products/event-grid/) can be used to push notifications to Azure Functions, HTTP endpoints (webhooks), and several other Azure tools. Event Grid can only be used with the [CloudEventsFormat](ctp:api:type:CloudEventsFormat). + To set up a Subscription with Azure Event Grid, first create a topic in the [Azure Portal](https://azure.microsoft.com/en-us/get-started/azure-portal/). To allow Composable Commerce to push notifications to your topic, provide an [access key](https://docs.microsoft.com/en-us/azure/event-grid/get-access-keys). properties: uri: type: string diff --git a/api-specs/api/types/subscription/AzureServiceBusDestination.raml b/api-specs/api/types/subscription/AzureServiceBusDestination.raml index 6f7e400aa8..29e47761f0 100644 --- a/api-specs/api/types/subscription/AzureServiceBusDestination.raml +++ b/api-specs/api/types/subscription/AzureServiceBusDestination.raml @@ -5,7 +5,7 @@ displayName: AzureServiceBusDestination discriminatorValue: AzureServiceBus example: !include ../../examples/Subscription/SubscriptionAzureServiceBusDestination.json description: | - [Azure Service Bus](https://azure.microsoft.com/en-us/products/service-bus/) can be used as a pull-queue with [Queues](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#queues), or to fan-out messages with [Topics and Subscriptions](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions). + [Azure Service Bus](https://azure.microsoft.com/en-us/products/service-bus/) can be used as a pull-queue with [Queues](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions#queues), or to fan-out notifications with [Topics and Subscriptions](https://learn.microsoft.com/en-us/azure/service-bus-messaging/service-bus-queues-topics-subscriptions). To set up a Subscription with Azure Service Bus, first create a queue/topic in the [Azure Portal](https://azure.microsoft.com/en-us/get-started/azure-portal/) with a Shared Access Policy including the `Send` permission. properties: connectionString: diff --git a/api-specs/api/types/subscription/ChangeSubscriptionResourceTypeId.raml b/api-specs/api/types/subscription/ChangeSubscriptionResourceTypeId.raml index 5ff7c18809..a7edbc01e3 100644 --- a/api-specs/api/types/subscription/ChangeSubscriptionResourceTypeId.raml +++ b/api-specs/api/types/subscription/ChangeSubscriptionResourceTypeId.raml @@ -79,7 +79,7 @@ enum: key-value-document: | Changes to [CustomObjects](ctp:api:type:CustomObject). order: | - Changes to [Orders](ctp:api:type:Order). Changes to Orders via [Order Edits](/../api/projects/order-edits) do not trigger a Message. To achieve this, a [MessageSubscription](ctp:api:type:MessageSubscription) to [OrderEditApplied](ctp:api:type:OrderEditAppliedMessage) Message is necessary. + Changes to [Orders](ctp:api:type:Order). Modifying Orders via [Order Edits](/../api/projects/order-edits) does not trigger a notification. To achieve this, a [MessageSubscription](ctp:api:type:MessageSubscription) to the [OrderEditApplied](ctp:api:type:OrderEditAppliedMessage) Message is necessary. order-edit: | Changes to [OrderEdits](ctp:api:type:OrderEdit). payment: | diff --git a/api-specs/api/types/subscription/CloudEventsPayload.raml b/api-specs/api/types/subscription/CloudEventsPayload.raml index b0b6a601bb..b71e655504 100644 --- a/api-specs/api/types/subscription/CloudEventsPayload.raml +++ b/api-specs/api/types/subscription/CloudEventsPayload.raml @@ -5,7 +5,7 @@ displayName: CloudEventsPayload discriminatorValue: CloudEvents example: !include ../../examples/Subscription/cloudevents-payload.example.json description: | - The [CloudEventsFormat](ctp:api:type:CloudEventsFormat) represents event data in a way that conforms to a common specification. The message payload can be found inside the `data` field. + The [CloudEventsFormat](ctp:api:type:CloudEventsFormat) represents event data in a way that conforms to a common specification. The payload can be found inside the `data` field. properties: specversion: type: string diff --git a/api-specs/api/types/subscription/ConfluentCloudDestination.raml b/api-specs/api/types/subscription/ConfluentCloudDestination.raml index 4173f99b04..1b9b0c098e 100644 --- a/api-specs/api/types/subscription/ConfluentCloudDestination.raml +++ b/api-specs/api/types/subscription/ConfluentCloudDestination.raml @@ -5,9 +5,9 @@ displayName: ConfluentCloudDestination discriminatorValue: ConfluentCloud example: !include ../../examples/Subscription/SubscriptionConfluentCloudDestination.json description: | - This destination can be used to push events and messages to [Confluent Cloud](https://www.confluent.io/confluent-cloud/). + This destination can be used to push notifications to [Confluent Cloud](https://www.confluent.io/confluent-cloud/). To set up a Subscription of this type, first, create a topic in Confluent Cloud. - Then, to allow Composable Commerce to push events and messages to your topic, generate [API keys](https://docs.confluent.io/cloud/current/access-management/authenticate/api-keys/api-keys.html) for your topic, and create the Subscription destination using the generated credentials. + Then, to allow Composable Commerce to push notifications to your topic, generate [API keys](https://docs.confluent.io/cloud/current/access-management/authenticate/api-keys/api-keys.html) for your topic, and create the Subscription destination using the generated credentials. The Composable Commerce producer uses the following values: `SASL_SSL` for`security.protocol`, `PLAIN` for`sasl.mechanism`, and the default value (1048576) for `max.request.size`. properties: diff --git a/api-specs/api/types/subscription/DeliveryPayload.raml b/api-specs/api/types/subscription/DeliveryPayload.raml index 28eeca823f..fd04639927 100644 --- a/api-specs/api/types/subscription/DeliveryPayload.raml +++ b/api-specs/api/types/subscription/DeliveryPayload.raml @@ -10,7 +10,7 @@ properties: type: string description: | `key` of the [Project](ctp:api:type:Project). - Useful in message processing if the Destination receives events from multiple Projects. + Useful for processing notifications if the Destination receives them from multiple Projects. notificationType: type: string description: | @@ -18,7 +18,7 @@ properties: resource: type: Reference description: | - Reference to the resource that triggered the message. + Reference to the resource that triggered the notification. resourceUserProvidedIdentifiers?: type: UserProvidedIdentifiers description: | diff --git a/api-specs/api/types/subscription/GoogleCloudPubSubDestination.raml b/api-specs/api/types/subscription/GoogleCloudPubSubDestination.raml index 07cbecaa70..679f01d18e 100644 --- a/api-specs/api/types/subscription/GoogleCloudPubSubDestination.raml +++ b/api-specs/api/types/subscription/GoogleCloudPubSubDestination.raml @@ -8,7 +8,7 @@ description: | Destination for [Google Cloud Pub/Sub](https://cloud.google.com/pubsub/) that can be used for [Pull subscriptions](https://cloud.google.com/pubsub/docs/pull) as well as for [Push subscriptions](https://cloud.google.com/pubsub/docs/push). The `topic` must give the `pubsub.topics.publish` permission to the service account `subscriptions@commercetools-platform.iam.gserviceaccount.com`. - If used with the [CloudEventsFormat](#cloudeventsformat), the message conforms to the [PubSub Protocol Binding](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md) of the [Structured Content Mode](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md#32-structured-content-mode). + If used with the [CloudEventsFormat](#cloudeventsformat), the notification conforms to the [PubSub Protocol Binding](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md) of the [Structured Content Mode](https://github.com/google/knative-gcp/blob/master/docs/spec/pubsub-protocol-binding.md#32-structured-content-mode). properties: projectId: type: string diff --git a/api-specs/api/types/subscription/MessageDeliveryPayload.raml b/api-specs/api/types/subscription/MessageDeliveryPayload.raml index 48c27b12d7..547b095512 100644 --- a/api-specs/api/types/subscription/MessageDeliveryPayload.raml +++ b/api-specs/api/types/subscription/MessageDeliveryPayload.raml @@ -34,7 +34,7 @@ properties: type: number format: int64 description: | - Version of the resource on which the change was performed. + Version of the resource on which the update was performed. payloadNotIncluded?: type: PayloadNotIncluded description: | diff --git a/api-specs/api/types/subscription/SnsDestination.raml b/api-specs/api/types/subscription/SnsDestination.raml index ccffd8317c..38ab0e5fb9 100644 --- a/api-specs/api/types/subscription/SnsDestination.raml +++ b/api-specs/api/types/subscription/SnsDestination.raml @@ -7,7 +7,7 @@ example: !include ../../examples/Subscription/SubscriptionSnsDestination.json description: | [AWS SNS](https://aws.amazon.com/sns/) can be used to push messages to AWS Lambda, HTTP endpoints (webhooks), or fan-out messages to SQS queues. The SQS queue must be a [Standard](https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/standard-queues.html) queue type. - We recommend setting `authenticationMode` to `IAM`, to avoid unnecessary key management. For IAM authentication and before creating the Subscription, give permissions to the following user account: `arn:aws-cn:iam::417094354346:user/subscriptions` if the Project is hosted in the China (AWS, Ningxia) Region; `arn:aws:iam::362576667341:user/subscriptions` for all other [Regions](/../api/general-concepts#regions). Otherwise, a test message will not be sent. + We recommend setting `authenticationMode` to `IAM`, to avoid unnecessary key management. For IAM authentication and before creating the Subscription, give permissions to the following user account: `arn:aws-cn:iam::417094354346:user/subscriptions` if the Project is hosted in the China (AWS, Ningxia) Region; `arn:aws:iam::362576667341:user/subscriptions` for all other [Regions](/../api/general-concepts#regions). Otherwise, a test notification will not be sent. If you prefer to use `Credentials` for authentication, we recommend [creating an IAM user](https://docs.aws.amazon.com/sns/latest/dg/sns-setting-up.html#create-iam-user) with an `accessKey` and `accessSecret` pair specifically for each Subscription. diff --git a/api-specs/api/types/subscription/Subscription.raml b/api-specs/api/types/subscription/Subscription.raml index 4874763e9d..00a2e2a902 100644 --- a/api-specs/api/types/subscription/Subscription.raml +++ b/api-specs/api/types/subscription/Subscription.raml @@ -36,11 +36,11 @@ properties: changes: type: ChangeSubscription[] description: | - Change notifications subscribed to. + Changes subscribed to. destination: type: Destination description: | - Messaging service to which the messages are to be sent. + Messaging service to which the notifications are sent. key?: type: string description: | diff --git a/api-specs/api/types/subscription/SubscriptionDraft.raml b/api-specs/api/types/subscription/SubscriptionDraft.raml index 6e71106941..1e519813c4 100644 --- a/api-specs/api/types/subscription/SubscriptionDraft.raml +++ b/api-specs/api/types/subscription/SubscriptionDraft.raml @@ -9,11 +9,11 @@ properties: changes?: type: ChangeSubscription[] description: | - Change notifications to be subscribed to. + Changes to be subscribed to. destination: type: Destination description: | - Messaging service to which the messages are sent. + Messaging service to which the notifications are sent. key?: type: string description: | diff --git a/api-specs/api/types/subscription/SubscriptionHealthStatus.raml b/api-specs/api/types/subscription/SubscriptionHealthStatus.raml index eb2ca0462c..7687c9887e 100644 --- a/api-specs/api/types/subscription/SubscriptionHealthStatus.raml +++ b/api-specs/api/types/subscription/SubscriptionHealthStatus.raml @@ -2,14 +2,14 @@ (package): Subscription displayName: SubscriptionHealthStatus description: | - The health status of the Subscription that indicates whether messages are being delivered. + The health status of the Subscription that indicates whether notifications are being delivered. type: string (enumDescriptions): - Healthy: Delivers messages as expected. - ConfigurationError: Messages cannot be delivered with the current configuration. Common causes are deleting the Destination queue, deleting access credentials, or removing the necessary permissions. The configuration can be fixed by re-creating the configuration on the Destination side, or by setting a new configuration with the [Change Destination](/../api/projects/subscriptions#change-destination) update action. If the configuration is fixed, undelivered messages will be delivered and the `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus). `ConfigurationError` is automatically turned into `ConfigurationErrorDeliveryStopped` after some time. For more information, see [Delivery Guarantees](#delivery-guarantees). - ConfigurationErrorDeliveryStopped: Does not deliver messages with the current configuration and the delivery of the messages is no longer attempted. If the configuration is fixed, undelivered messages are not retained and will not be delivered. The `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus) as soon as new messages can be delivered. - TemporaryError: Does not deliver messages temporarily due to reasons other than a configuration error. For example, the Destination has a temporary outage. - ManuallySuspended: Does not deliver messages with the current configuration and the delivery of the messages is no longer attempted. Undelivered messages are not retained and will not be delivered. The `status` will not automatically change to [Healthy](ctp:api:type:SubscriptionHealthStatus). To return your subscriptions to a [Healthy](ctp:api:type:SubscriptionHealthStatus) status, contact the [Composable Commerce support team](https://support.commercetools.com/). + Healthy: Delivers notifications as expected. + ConfigurationError: Notifications cannot be delivered with the current configuration. Common causes are deleting the Destination queue, deleting access credentials, or removing necessary permissions. You can fix the configuration by re-creating the configuration on the Destination side, or by setting a new configuration with the [Change Destination](/../api/projects/subscriptions#change-destination) update action. After the configuration is fixed, undelivered notifications will be delivered and the `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus). `ConfigurationError` is automatically turned into `ConfigurationErrorDeliveryStopped` after some time. For more information, see [Delivery Guarantees](#delivery-guarantees). + ConfigurationErrorDeliveryStopped: Does not deliver notifications with the current configuration and the delivery of the notifications is no longer attempted. After the configuration is fixed, undelivered notifications are not retained and will not be delivered. The `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus) as soon as new notifications can be delivered. + TemporaryError: Does not deliver notifications temporarily due to reasons other than a configuration error. For example, the Destination has a temporary outage. + ManuallySuspended: Does not deliver notifications with the current configuration and the delivery of the notifications is no longer attempted. Undelivered notifications are not retained and will not be delivered. The `status` will not automatically change to [Healthy](ctp:api:type:SubscriptionHealthStatus). To return your subscriptions to a [Healthy](ctp:api:type:SubscriptionHealthStatus) status, contact the [Composable Commerce support team](https://support.commercetools.com/). enum: - Healthy diff --git a/api-specs/api/types/subscription/updates/SubscriptionChangeDestinationAction.raml b/api-specs/api/types/subscription/updates/SubscriptionChangeDestinationAction.raml index 106ef987ed..9298c2521b 100644 --- a/api-specs/api/types/subscription/updates/SubscriptionChangeDestinationAction.raml +++ b/api-specs/api/types/subscription/updates/SubscriptionChangeDestinationAction.raml @@ -5,7 +5,7 @@ displayName: SubscriptionChangeDestinationAction discriminatorValue: changeDestination example: !include ../../../examples/Subscription/SubscriptionChangeDestinationAction.json description: | - A test message is sent to ensure the correct configuration of the Destination. If the message cannot be delivered, the update will fail. The payload of the test message is a notification of type [ResourceCreated](ctp:api:type:ResourceCreatedDeliveryPayload) for the `resourceTypeId` `subscription`. The `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus), if it isn't already. + A test notification is sent to ensure the correct configuration of the Destination. If the notification cannot be delivered, the update will fail. The payload of the test notification is of type [ResourceCreated](ctp:api:type:ResourceCreatedDeliveryPayload) for the `resourceTypeId` `subscription`. The `status` will change to [Healthy](ctp:api:type:SubscriptionHealthStatus), if it isn't already. properties: destination: type: Destination diff --git a/api-specs/api/types/type/CustomFieldReferenceValue.raml b/api-specs/api/types/type/CustomFieldReferenceValue.raml index e346763f5c..a4a9a77ecb 100644 --- a/api-specs/api/types/type/CustomFieldReferenceValue.raml +++ b/api-specs/api/types/type/CustomFieldReferenceValue.raml @@ -13,6 +13,7 @@ enum: - category - channel - customer + - customer-group - key-value-document - order - product @@ -38,6 +39,8 @@ enum: [Channel](ctp:api:type:Channel) customer: | [Customer](ctp:api:type:Customer) + customer-group: | + [CustomerGroup](ctp:api:type:CustomerGroup) key-value-document: | [CustomObject](ctp:api:type:CustomObject) order: | diff --git a/api-specs/api/types/types.raml b/api-specs/api/types/types.raml index e7116880e7..8785187cdf 100644 --- a/api-specs/api/types/types.raml +++ b/api-specs/api/types/types.raml @@ -917,6 +917,11 @@ CustomerPasswordUpdatedMessage: !include message/CustomerPasswordUpdatedMessage. CustomerTitleSetMessage: !include message/CustomerTitleSetMessage.raml DeliveryAddedMessage: !include message/DeliveryAddedMessage.raml DeliveryAddressSetMessage: !include message/DeliveryAddressSetMessage.raml +DeliveryCustomFieldAddedMessage: !include message/DeliveryCustomFieldAddedMessage.raml +DeliveryCustomFieldChangedMessage: !include message/DeliveryCustomFieldChangedMessage.raml +DeliveryCustomFieldRemovedMessage: !include message/DeliveryCustomFieldRemovedMessage.raml +DeliveryCustomTypeRemovedMessage: !include message/DeliveryCustomTypeRemovedMessage.raml +DeliveryCustomTypeSetMessage: !include message/DeliveryCustomTypeSetMessage.raml DeliveryItemsUpdatedMessage: !include message/DeliveryItemsUpdatedMessage.raml DeliveryRemovedMessage: !include message/DeliveryRemovedMessage.raml DiscountCodeCreatedMessage: !include message/DiscountCodeCreatedMessage.raml @@ -1182,6 +1187,11 @@ CustomerPasswordUpdatedMessagePayload: !include message/payload/CustomerPassword CustomerTitleSetMessagePayload: !include message/payload/CustomerTitleSetMessagePayload.raml DeliveryAddedMessagePayload: !include message/payload/DeliveryAddedMessagePayload.raml DeliveryAddressSetMessagePayload: !include message/payload/DeliveryAddressSetMessagePayload.raml +DeliveryCustomFieldAddedMessagePayload: !include message/payload/DeliveryCustomFieldAddedMessagePayload.raml +DeliveryCustomFieldChangedMessagePayload: !include message/payload/DeliveryCustomFieldChangedMessagePayload.raml +DeliveryCustomFieldRemovedMessagePayload: !include message/payload/DeliveryCustomFieldRemovedMessagePayload.raml +DeliveryCustomTypeRemovedMessagePayload: !include message/payload/DeliveryCustomTypeRemovedMessagePayload.raml +DeliveryCustomTypeSetMessagePayload: !include message/payload/DeliveryCustomTypeSetMessagePayload.raml DeliveryItemsUpdatedMessagePayload: !include message/payload/DeliveryItemsUpdatedMessagePayload.raml DeliveryRemovedMessagePayload: !include message/payload/DeliveryRemovedMessagePayload.raml DiscountCodeCreatedMessagePayload: !include message/payload/DiscountCodeCreatedMessagePayload.raml