You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: static/rest/data-ingestion-schema-v1.yaml
+55-64Lines changed: 55 additions & 64 deletions
Original file line number
Diff line number
Diff line change
@@ -1079,7 +1079,16 @@ paths:
1079
1079
description: |
1080
1080
Update products with specified `sku` and `source` values to replace existing field data with the data supplied in the request.
1081
1081
When the update is processed, the merge strategy is used to apply changes to `scalar` and `object` type fields.
1082
-
The replace strategy is used to apply changes for fields in an `array`.
1082
+
1083
+
For `array` type fields, a new value can be appended to the existing list. For an object list, you can update a specific object by matching on a key field. The following fields are supported:
1084
+
* `attributes` - match on `code`
1085
+
* `images` - match on `url`
1086
+
* `routes` - match on `path`
1087
+
* `links` - match on `type` and `sku`
1088
+
* `bundles` match on `type` and `group`
1089
+
* `configurations` match on `type` and `attributeCode`
1090
+
* `externalIds` match on `type` and `origin`
1091
+
1083
1092
operationId: updateProducts
1084
1093
parameters:
1085
1094
- $ref: "#/components/parameters/Authorization"
@@ -1114,25 +1123,13 @@ paths:
1114
1123
In the example below, the following attributes are updated.
1115
1124
* `name` - Change the product name.
1116
1125
* `metaTags.title` - Change the title of the product detail page.
1117
-
* `attributes` - Add a new state, `NM` to the `states` attribute.
1118
1126
value:
1119
1127
[
1120
1128
{
1121
1129
"sku": "red-pants",
1122
1130
"source": { "locale": "en-US" },
1123
1131
"name": "Red pants - discounts!",
1124
-
"metaTags": { "title": "Updated - Red" },
1125
-
"attributes":
1126
-
[
1127
-
{
1128
-
"code": "cost",
1129
-
"values": ["10.5"]
1130
-
},
1131
-
{
1132
-
"code": "states",
1133
-
"values": ["TX", "CA", "NM"]
1134
-
}
1135
-
]
1132
+
"metaTags": { "title": "Updated - Red" }
1136
1133
}
1137
1134
]
1138
1135
UnassignProductVariant:
@@ -1166,6 +1163,7 @@ paths:
1166
1163
summary: Add a new item `gloves` to the accessories group of the bundle product `bundle-outfit`
1167
1164
description: |
1168
1165
To add a new item `gloves` to the accessories group of the bundle product `bundle-outfit`, include the new item in the `items` array of the `accessories` group.
1166
+
The previously created items `socks` and `headband` should be retained in the updated bundle.
1169
1167
Note that simple product `gloves` must be created separately using the create product API.
1170
1168
value:
1171
1169
[
@@ -1174,44 +1172,6 @@ paths:
1174
1172
"source": { "locale": "en-US" },
1175
1173
"bundles":
1176
1174
[
1177
-
{
1178
-
"group": "tops",
1179
-
"required": true,
1180
-
"multiSelect": false,
1181
-
"defaultItemSkus": ["top-red"],
1182
-
"items":
1183
-
[
1184
-
{
1185
-
"sku": "top-red",
1186
-
"qty": 1,
1187
-
"userDefinedQty": false
1188
-
},
1189
-
{
1190
-
"sku": "top-blue",
1191
-
"qty": 1,
1192
-
"userDefinedQty": false
1193
-
}
1194
-
]
1195
-
},
1196
-
{
1197
-
"group": "bottoms",
1198
-
"required": true,
1199
-
"multiSelect": false,
1200
-
"defaultItemSkus": ["bottom-black"],
1201
-
"items":
1202
-
[
1203
-
{
1204
-
"sku": "bottom-black",
1205
-
"qty": 1,
1206
-
"userDefinedQty": false
1207
-
},
1208
-
{
1209
-
"sku": "bottom-white",
1210
-
"qty": 1,
1211
-
"userDefinedQty": false
1212
-
}
1213
-
]
1214
-
},
1215
1175
{
1216
1176
"group": "accessories",
1217
1177
"required": false,
@@ -1238,6 +1198,35 @@ paths:
1238
1198
]
1239
1199
}
1240
1200
]
1201
+
AddNewAttributeAndReplaceExisting:
1202
+
summary: Add a new attribute and replace existing one
1203
+
description: |
1204
+
Add a new attribute `warehouse`, and update the value of the existing `cost` attribute for the simple product `red-pants`
1205
+
1206
+
In the example below:
1207
+
* A new attribute with the code `warehouse` is added to the attributes list
1208
+
* The value of the existing `cost` attribute is replaced with new value
1209
+
1210
+
The previously created `states` attribute is preserved.
1211
+
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.
1212
+
value:
1213
+
[
1214
+
{
1215
+
"sku": "red-pants",
1216
+
"source": { "locale": "en-US" },
1217
+
"attributes":
1218
+
[
1219
+
{
1220
+
"code": "warehouse",
1221
+
"values": [ "Austin" ]
1222
+
},
1223
+
{
1224
+
"code": "cost",
1225
+
"values": ["12"]
1226
+
}
1227
+
]
1228
+
}
1229
+
]
1241
1230
/v1/catalog/products/delete:
1242
1231
post:
1243
1232
tags:
@@ -1820,13 +1809,17 @@ paths:
1820
1809
description: |
1821
1810
Change existing product prices, discounts, and tiered pricing.
1822
1811
1823
-
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`.
1812
+
When the update is processed, the merge strategy is used to apply changes to `scalar` and `object` type fields.
1813
+
1814
+
For `array` type fields, a new value can be appended to the existing list. For an object list, you can update a specific object by matching on a key field. The following fields are supported:
1815
+
* `discounts` - match on `code`
1816
+
* `tierPrices` - match on `qty`
1824
1817
1825
1818
<h3>Update strategies</h3>
1826
1819
1827
1820
* **Regular Price** - Updated using merge strategy
1828
-
* **Discounts Array** - Updated using replace strategy (entire array is replaced)
1829
-
* **Tiered Pricing Array** - Updated using replace strategy (entire array is replaced)
1821
+
* **Discounts Array** - Updated using the append or merge strategy
1822
+
* **Tiered Pricing Array** - Updated using the append or merge strategy
1830
1823
1831
1824
<h3>Discount and tier pricing updates</h3>
1832
1825
@@ -1872,19 +1865,21 @@ paths:
1872
1865
summary: Update product prices with enhanced discounts and tiered pricing
1873
1866
description: |
1874
1867
Update existing product prices for the given SKU ("red-pants") and price book id ("dealer-north").
1875
-
This example shows how to update both discounts and tiered pricing simultaneously.
1868
+
This example shows how to update both discounts and tiered pricing simultaneously:
1869
+
* **discounts**: Update the existing `seasonal_sale` discount and add a new `holiday_sale` discount
1870
+
* **tierPrices**: Update the existing percentage discount for quantity 5 and add a new discount for quantity 20
0 commit comments