Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 19 additions & 15 deletions generator/catalog-ingestion-openapi-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,8 @@ paths:
Update existing product attribute metadata with new values.
When the update is processed, the merge strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy is used to apply changes for fields in an `array`.

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
> **Note:** Before submitting an update request, verify that the target entity exists using the
[attributeMetadata](https://developer.adobe.com/commerce/services/graphql-api/merchandising-api/index.html#query-attributeMetadata) GraphQL query. Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are accepted, but the update has no effect.
operationId: updateProductMetadata
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -478,7 +479,7 @@ paths:
{
"url": "https://example.com/images/men-category.png",
"label": "Men's Category",
"roles": ["SMALL"],
"roles": ["BASE"],
"customRoles": []
}
]
Expand All @@ -505,7 +506,7 @@ paths:
Update existing product categories with new values.
When the update is processed, the merge strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy is used to apply changes for fields in an `array`.

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
> **Note:** Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are accepted, but the update has no effect.
operationId: updateCategories
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -557,7 +558,7 @@ paths:
{
"url": "https://example.com/images/mens-apparel.png",
"label": "Men's Apparel",
"roles": ["SMALL"],
"roles": ["BASE"],
"customRoles": []
}
]
Expand Down Expand Up @@ -641,7 +642,6 @@ paths:
- You can create multiple products in a single request, and also create product variants for configurable products in the same request.
- Use the `routes` field to set category paths. The `path` value must match an existing category slug, for example `men/clothing`.
- Create a route for each category path. For example to include a product in each of the following categories `men`, `men/clothing`, and `men/clothing/pants`, specify three `path` values, one for each category.


<h3 id="simpleProducts">Simple products</h3>
Create products or replace existing products with specified `sku` and `source` values.
Expand Down Expand Up @@ -791,7 +791,7 @@ paths:
{
"url": "https://example.com/images/pants.jpg",
"label": "photo of my pants!",
"roles": ["BASE", "SMALL"],
"roles": ["BASE", "THUMBNAIL"],
"customRoles": ["widget"]
}
],
Expand Down Expand Up @@ -1141,7 +1141,7 @@ paths:
* `configurations` match on `type` and `attributeCode`
* `externalIds` match on `type` and `origin`

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
> **Note:** Before submitting an update request, verify that the target entity exists using the [products](https://developer.adobe.com/commerce/services/graphql-api/merchandising-api/index.html#query-products) GraphQL query. Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are accepted, but the update has no effect.
operationId: updateProducts
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -1259,7 +1259,7 @@ paths:
In the example below:
* A new attribute with the code `warehouse` is added to the attributes list
* The value of the existing `cost` attribute is replaced with new value

The previously created `states` attribute is preserved.
Note: Don't forget to create the product attribute metadata (<a href="#operation/createProductMetadata">link</a> for the `warehouse` attribute if it doesn't exist yet.
value:
Expand Down Expand Up @@ -1329,13 +1329,17 @@ paths:
summary: Create or replace product layers
description: |
Create product layers to customize and override base product data for specific contexts, locales, or business requirements.

Product layers enable you to:
- Override product attributes for specific markets or channels
- Provide locale-specific content while maintaining a global base product
- Create seasonal or promotional variations without duplicating entire product records
- Implement A/B testing scenarios with different product presentations

For details on how to use layers with Adobe Commerce Optimizer, see
[Catalog Layers](https://experienceleague.adobe.com/en/docs/commerce/optimizer/setup/catalog-layer) in the
Adobe Commerce Optimizer documentation.

## Layer behavior and requirements

**Required fields:**
Expand Down Expand Up @@ -1427,19 +1431,19 @@ paths:
- Product Layers
summary: Delete product layers
description: |
Remove specific product layers by SKU and source identifiers. This operation permanently deletes
Remove specific product layers by SKU and source identifiers. This operation permanently deletes
the layer data while preserving the base product.

**Use Cases:**
- Remove expired seasonal or promotional layers
- Clean up test layers after A/B testing completion
- Delete locale-specific layers when discontinuing market support
- Remove outdated customizations

**Important Notes:**
- Only the specified layer is deleted; base product and other layers remain intact
- Both `sku` and `source` (locale + layer) must match exactly for successful deletion

operationId: deleteProductLayers
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down Expand Up @@ -1633,7 +1637,7 @@ paths:
* **Child Price Books**: Include correct `parentId` in request (will be ignored if different)
* **Hierarchy Restructuring**: Delete child price book and recreate with new parent reference

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
> **Note:** Before submitting an update request, verify that the target entity exists by checking the available price books in [Commerce Optimizer](https://experienceleague.adobe.com/en/docs/commerce/optimizer/setup/pricebooks#view-price-books-in-commerce-optimizer). Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are accepted, but the update has no effect.
operationId: updatePriceBooks
parameters:
- name: Content-Type
Expand Down Expand Up @@ -2049,7 +2053,7 @@ paths:
* Ensure tier quantities are in ascending order
* Test updates in a development environment first

> **Note:** Before submitting an update request, verify that the target entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but the update is silently ignored.
> **Note:** Before submitting an update request, verify that the target entity exists using the [products GraphQL query](https://developer.adobe.com/commerce/services/graphql-api/merchandising-api/index.html#query-products) to check the prices assigned to the product SKU. Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are accepted, but the update has no effect.
operationId: updatePrices
parameters:
- $ref: "#/components/parameters/Authorization"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@adobe-commerce/aco-ts-sdk",
"version": "1.2.3",
"version": "1.2.4",
"description": "TypeScript Client SDK for the Adobe Commerce Optimizer API",
"type": "module",
"license": "Apache-2.0",
Expand Down
55 changes: 32 additions & 23 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ export interface Client {
/**
* Update categories Update existing product categories with new values. When the update is processed, the merge
* strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy is used to apply
* changes for fields in an `array`. > **Note:** Before submitting an update request, verify that the target entity
* already exists. Update operations do not validate the existence of the entity — if it does not exist, the request
* is accepted, but the update is silently ignored.
* changes for fields in an `array`. > **Note:** Update operations do not verify that the entity exists. Requests
* targeting a nonexistent entity are accepted, but the update has no effect.
*
* @param data - FeedCategoryUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -116,8 +115,10 @@ export interface Client {
* Update product attribute metadata Update existing product attribute metadata with new values. When the update is
* processed, the merge strategy is used to apply changes to `scalar` and `object` type fields. The replace strategy
* is used to apply changes for fields in an `array`. > **Note:** Before submitting an update request, verify that the
* target entity already exists. Update operations do not validate the existence of the entity — if it does not exist,
* the request is accepted, but the update is silently ignored.
* target entity exists using the
* [attributeMetadata](https://developer.adobe.com/commerce/services/graphql-api/merchandising-api/index.html#query-attributeMetadata)
* GraphQL query. Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are
* accepted, but the update has no effect.
*
* @param data - FeedMetadataUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -176,9 +177,11 @@ export interface Client {
* validates that `parentId` references exist and hierarchy depth is maintained <h3>Update Strategies</h3> * **Base
* Price Books**: Update name and currency as needed * **Child Price Books**: Include correct `parentId` in request
* (will be ignored if different) * **Hierarchy Restructuring**: Delete child price book and recreate with new
* parent reference > **Note:** Before submitting an update request, verify that the target entity already exists.
* Update operations do not validate the existence of the entity — if it does not exist, the request is accepted,
* but the update is silently ignored.
* parent reference > **Note:** Before submitting an update request, verify that the target entity exists by
* checking the available price books in [Commerce
* Optimizer](https://experienceleague.adobe.com/en/docs/commerce/optimizer/setup/pricebooks#view-price-books-in-commerce-optimizer).
* Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are accepted, but
* the update has no effect.
*
* @param data - FeedPricebook[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -225,9 +228,11 @@ export interface Client {
* discounts/tiers, send an empty array * To add new discounts/tiers, include both existing and new items <h3>Best
* practices</h3> * Always include the complete array of discounts/tiers when updating * Use descriptive discount
* codes for easier management * Ensure tier quantities are in ascending order * Test updates in a development
* environment first > **Note:** Before submitting an update request, verify that the target entity already exists.
* Update operations do not validate the existence of the entity — if it does not exist, the request is accepted, but
* the update is silently ignored.
* environment first > **Note:** Before submitting an update request, verify that the target entity exists using the
* [products GraphQL
* query](https://developer.adobe.com/commerce/services/graphql-api/merchandising-api/index.html#query-products) to
* check the prices assigned to the product SKU. Update operations do not verify that the entity exists. Requests
* targeting a nonexistent entity are accepted, but the update has no effect.
*
* @param data - FeedPricesUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand All @@ -239,16 +244,18 @@ export interface Client {
* contexts, locales, or business requirements. Product layers enable you to: - Override product attributes for
* specific markets or channels - Provide locale-specific content while maintaining a global base product - Create
* seasonal or promotional variations without duplicating entire product records - Implement A/B testing scenarios
* with different product presentations ## Layer behavior and requirements **Required fields:** - `sku`: Must match an
* existing base product SKU - `source.layer`: Identifies the layer name for organization and retrieval **Optional
* Fields:** - `source.locale`: When specified, layer applies only to that locale. When omitted, layer applies
* globally across all locales - All product fields (name, description, images, and so on): Override corresponding
* base product values ## Merging logic Product layers use intelligent merging: - **Simple fields** (name,
* description, and so on): Complete replacement of base values - **Array fields** (attributes, images, etc.):
* First-level arrays are merged with base arrays - **Nested arrays** (attribute.values, etc.): Complete replacement
* of nested arrays **Example:** Adding a color variant while preserving existing attributes: `json { \"sku\":
* \"red-pants\", \"source\": { \"locale\": \"en-US\", \"layer\": \"seasonal-colors\" }, \"attributes\": [ { \"code\":
* \"color\", \"values\": [\"Crimson Red\", \"Deep Red\"], \"variantReferenceId\": \"pants-color-crimson\" } ] } `
* with different product presentations For details on how to use layers with Adobe Commerce Optimizer, see [Catalog
* Layers](https://experienceleague.adobe.com/en/docs/commerce/optimizer/setup/catalog-layer) in the Adobe Commerce
* Optimizer documentation. ## Layer behavior and requirements **Required fields:** - `sku`: Must match an existing
* base product SKU - `source.layer`: Identifies the layer name for organization and retrieval **Optional Fields:** -
* `source.locale`: When specified, layer applies only to that locale. When omitted, layer applies globally across all
* locales - All product fields (name, description, images, and so on): Override corresponding base product values ##
* Merging logic Product layers use intelligent merging: - **Simple fields** (name, description, and so on): Complete
* replacement of base values - **Array fields** (attributes, images, etc.): First-level arrays are merged with base
* arrays - **Nested arrays** (attribute.values, etc.): Complete replacement of nested arrays **Example:** Adding a
* color variant while preserving existing attributes: `json { \"sku\": \"red-pants\", \"source\": { \"locale\":
* \"en-US\", \"layer\": \"seasonal-colors\" }, \"attributes\": [ { \"code\": \"color\", \"values\": [\"Crimson Red\",
* \"Deep Red\"], \"variantReferenceId\": \"pants-color-crimson\" } ] } `
*
* @param data - FeedProductLayer[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down Expand Up @@ -345,8 +352,10 @@ export interface Client {
* `attributes` - match on `code` * `images` - match on `url` * `routes` - match on `path` * `links` - match on `type`
* and `sku` * `bundles` match on `type` and `group` * `configurations` match on `type` and `attributeCode` *
* `externalIds` match on `type` and `origin` > **Note:** Before submitting an update request, verify that the target
* entity already exists. Update operations do not validate the existence of the entity — if it does not exist, the
* request is accepted, but the update is silently ignored.
* entity exists using the
* [products](https://developer.adobe.com/commerce/services/graphql-api/merchandising-api/index.html#query-products)
* GraphQL query. Update operations do not verify that the entity exists. Requests targeting a nonexistent entity are
* accepted, but the update has no effect.
*
* @param data - FeedProductUpdate[] payload
* @returns {Promise<ApiResponse>} Feed response indicating the number of accepted items
Expand Down