Skip to content

Commit b864cb4

Browse files
authored
docs: add missing shipping_profile_id in create product snippets (medusajs#11443)
* initial * add link
1 parent 4e6372b commit b864cb4

File tree

5 files changed

+12
-2
lines changed
  • www/apps
    • book/app/learn
      • customization/extend-features/extend-create-product
      • fundamentals
    • resources/app/commerce-modules

5 files changed

+12
-2
lines changed

www/apps/book/app/learn/customization/extend-features/extend-create-product/page.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ curl -X POST 'http://localhost:9000/admin/products' \
237237
}'
238238
```
239239

240-
Make sure to replace `{token}` with the token you received from the previous request, `shipping_profile_id` with the ID of a shipping profile in your application, and `{brand_id}` with the ID of a brand in your application.
240+
Make sure to replace `{token}` with the token you received from the previous request, `shipping_profile_id` with the ID of a shipping profile in your application, and `{brand_id}` with the ID of a brand in your application. You can retrieve the ID of a shipping profile either from the Medusa Admin, or the [List Shipping Profiles API route](!api!/admin#shipping-profiles_getshippingprofiles).
241241

242242
The request creates a product and returns it.
243243

www/apps/book/app/learn/fundamentals/api-routes/additional-data/page.mdx

+2-1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ curl -X POST 'http://localhost:9000/admin/products' \
117117
"values": ["Default option value"]
118118
}
119119
],
120+
"shipping_profile_id": "{shipping_profile_id}",
120121
"additional_data": {
121122
"brand": "Acme"
122123
}
@@ -125,7 +126,7 @@ curl -X POST 'http://localhost:9000/admin/products' \
125126

126127
<Note title="Tip">
127128

128-
Make sure to replace the `{token}` in the authorization header with an admin user's authentication token.
129+
Make sure to replace the `{token}` in the authorization header with an admin user's authentication token, and `{shipping_profile_id}` with an existing shipping profile's ID.
129130

130131
</Note>
131132

www/apps/book/app/learn/fundamentals/custom-cli-scripts/seed-data/page.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ const productsData = new Array(productsNum).fill(0).map((_, index) => {
124124
Size: sizeOptions[Math.floor(Math.random() * 3)],
125125
},
126126
})),
127+
shipping_profile_id: "sp_123",
127128
sales_channels: [
128129
{
129130
id: defaultSalesChannel[0].id,

www/apps/resources/app/commerce-modules/inventory/inventory-kit/page.mdx

+5
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ export const createMultiPartProductsWorkflow = createWorkflow(
176176
values: ["Default Variant"],
177177
},
178178
],
179+
shipping_profile_id: "sp_123",
179180
},
180181
],
181182
},
@@ -229,6 +230,7 @@ export const createBundledProducts = createWorkflow(
229230
products: [
230231
{
231232
title: "Shirt",
233+
shipping_profile_id: "sp_123",
232234
variants: [
233235
{
234236
title: "Shirt",
@@ -253,6 +255,7 @@ export const createBundledProducts = createWorkflow(
253255
},
254256
{
255257
title: "Pants",
258+
shipping_profile_id: "sp_123",
256259
variants: [
257260
{
258261
title: "Pants",
@@ -277,6 +280,7 @@ export const createBundledProducts = createWorkflow(
277280
},
278281
{
279282
title: "Shoes",
283+
shipping_profile_id: "sp_123",
280284
variants: [
281285
{
282286
title: "Shoes",
@@ -381,6 +385,7 @@ export const createBundledProducts = createWorkflow(
381385
products: [
382386
{
383387
title: "Bundled Clothes",
388+
shipping_profile_id: "sp_123",
384389
variants: [
385390
{
386391
title: "Bundle",

www/apps/resources/app/commerce-modules/product/extend/page.mdx

+3
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ curl -X POST 'localhost:9000/admin/products' \
319319
"values": ["Default option value"]
320320
}
321321
],
322+
"shipping_profile_id": "{shipping_profile_id}",
322323
"additional_data": {
323324
"custom_name": "test"
324325
}
@@ -327,6 +328,8 @@ curl -X POST 'localhost:9000/admin/products' \
327328

328329
Make sure to replace `{token}` with an admin user's JWT token. Learn how to retrieve it in the [API reference](!api!/admin#1-bearer-authorization-with-jwt-tokens).
329330

331+
Also, make sure to replace `{shipping_profile_id}` with an existing shipping profile's ID. You can retrieve one either from the Medusa Admin dashboard or using the [List Shipping Profiles API Route](!api!/admin#shipping-profiles_getshippingprofiles).
332+
330333
The request will return the product's details. You'll learn how to retreive the `custom_name` property with the product's details in the next section.
331334

332335
---

0 commit comments

Comments
 (0)