Skip to content

Commit d6f5235

Browse files
authored
Merge pull request magento#7035 from magento/db_restAPI
Added new note about API usage
2 parents de3d4d4 + 2b0b244 commit d6f5235

File tree

2 files changed

+141
-2
lines changed

2 files changed

+141
-2
lines changed

src/_data/toc/rest-api.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ pages:
7070
- label: Search for the status of a bulk operation
7171
url: /rest/operation-status-search.html
7272

73-
- label: Parameters in URLs
73+
- label: API usage notes
7474
url: /rest/notes.html
7575

7676
- label: Tutorials

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

Lines changed: 140 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ functional_areas:
55
- Integration
66
---
77

8-
You might encounter the following issue when using REST endpoints
8+
You might encounter the following issues when using REST endpoints.
99

1010
## Duplicate parameters in an REST call
1111

@@ -18,6 +18,145 @@ 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+
## Create a bundle product
22+
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.
24+
25+
```json
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+
}
158+
```
159+
21160
{:.ref-header}
22161
Related topics
23162

0 commit comments

Comments
 (0)