Skip to content

Commit a460ead

Browse files
authored
Update notes.md
1 parent edb5163 commit a460ead

File tree

1 file changed

+134
-8
lines changed

1 file changed

+134
-8
lines changed

src/guides/v2.3/rest/notes.md

Lines changed: 134 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,143 @@ The REST URL to update a customer is `PUT /V1/customers/:id`. If you specify an
1818

1919
This applies to all REST APIs where a parameter is passed in the URL. Any value specified in the URL with the same parameter name as in the request body is ignored.
2020

21-
## Set a fixed price for bundled products
21+
## Create a bundle product
2222

23-
When adding bundled products, the `price_type` attribute should be set under `custom_attributes`.
23+
The following sample code creates a bundle product. The `price_type` attribute code defined in the `custom_attributes` object is set to `1` to allow the product to have a fixed price.
2424

2525
```json
26-
"custom_attributes": [
27-
{
28-
"attribute_code": "price_type",
29-
"value": "1"
30-
}
31-
]
26+
{
27+
"product":{
28+
"sku":"box-of-watches",
29+
"name":"Box of Watches",
30+
"attribute_set_id":11,
31+
"price":100,
32+
"status":1,
33+
"visibility":4,
34+
"type_id":"bundle",
35+
"extension_attributes":{
36+
"website_ids":[
37+
1,
38+
2
39+
],
40+
"category_links":[
41+
{
42+
"position":0,
43+
"category_id":"3"
44+
},
45+
{
46+
"position":0,
47+
"category_id":"6"
48+
}
49+
],
50+
"bundle_product_options":[
51+
{
52+
"title":"Men's Watches",
53+
"required":true,
54+
"type":"radio",
55+
"position":1,
56+
"sku":"box-of-watches",
57+
"product_links":[
58+
{
59+
"sku":"24-MG04",
60+
"qty":50,
61+
"position":2,
62+
"is_default":false,
63+
"price":0,
64+
"price_type":0,
65+
"can_change_quantity":0
66+
},
67+
{
68+
"sku":"24-MG05",
69+
"qty":50,
70+
"position":4,
71+
"is_default":false,
72+
"price":0,
73+
"price_type":0,
74+
"can_change_quantity":0
75+
}
76+
]
77+
},
78+
{
79+
"title":"Women's Watches",
80+
"required":true,
81+
"type":"radio",
82+
"position":2,
83+
"sku":"box-of-watches",
84+
"product_links":[
85+
{
86+
"sku":"24-WG01",
87+
"qty":50,
88+
"position":1,
89+
"is_default":false,
90+
"price":0,
91+
"price_type":0,
92+
"can_change_quantity":0
93+
},
94+
{
95+
"sku":"24-WG09",
96+
"qty":50,
97+
"position":2,
98+
"is_default":false,
99+
"price":0,
100+
"price_type":0,
101+
"can_change_quantity":0
102+
}
103+
]
104+
}
105+
]
106+
},
107+
"custom_attributes":[
108+
{
109+
"attribute_code":"price_type",
110+
"value":"1"
111+
},
112+
{
113+
"attribute_code":"price_view",
114+
"value":"0"
115+
},
116+
{
117+
"attribute_code":"required_options",
118+
"value":"1"
119+
},
120+
{
121+
"attribute_code":"has_options",
122+
"value":"1"
123+
},
124+
{
125+
"attribute_code":"meta_title",
126+
"value":"watch-test"
127+
},
128+
{
129+
"attribute_code":"sku_type",
130+
"value":"1"
131+
},
132+
{
133+
"attribute_code":"meta_description",
134+
"value":"watch-test This is a box of watches!"
135+
},
136+
{
137+
"attribute_code":"weight_type",
138+
"value":"0"
139+
},
140+
{
141+
"attribute_code":"category_ids",
142+
"value":[
143+
"3",
144+
"6"
145+
]
146+
},
147+
{
148+
"attribute_code":"description",
149+
"value":"<p>This is a box of watches!</p>"
150+
},
151+
{
152+
"attribute_code":"short_description",
153+
"value":"<p>A box of watches</p>"
154+
}
155+
]
156+
}
157+
}
32158
```
33159

34160
{:.ref-header}

0 commit comments

Comments
 (0)