Skip to content

Commit 50b8863

Browse files
committed
docs: generate API reference for 2.10.0
1 parent f239f38 commit 50b8863

57 files changed

Lines changed: 3775 additions & 119 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

www/apps/api-reference/generated/generated-admin-sidebar.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,13 @@ const generatedgeneratedAdminSidebarSidebar = {
222222
"loaded": false,
223223
"showLoadingIfEmpty": true
224224
},
225+
{
226+
"type": "category",
227+
"title": "Feature Flags",
228+
"children": [],
229+
"loaded": false,
230+
"showLoadingIfEmpty": true
231+
},
225232
{
226233
"type": "category",
227234
"title": "Fulfillment Providers",
@@ -679,6 +686,24 @@ const generatedgeneratedAdminSidebarSidebar = {
679686
"loaded": false,
680687
"showLoadingIfEmpty": true
681688
},
689+
{
690+
"type": "category",
691+
"title": "Shipping Option Types",
692+
"children": [
693+
{
694+
"type": "link",
695+
"path": "shipping-option-types_shippingoptiontype_schema",
696+
"title": "ShippingOptionType Object",
697+
"loaded": true,
698+
"badge": {
699+
"variant": "neutral",
700+
"text": "Schema"
701+
}
702+
}
703+
],
704+
"loaded": false,
705+
"showLoadingIfEmpty": true
706+
},
682707
{
683708
"type": "category",
684709
"title": "Shipping Options",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.order.listShippingOptions("order_123")
12+
.then(({ shipping_options }) => {
13+
console.log(shipping_options)
14+
})

www/apps/api-reference/specs/admin/code_samples/JavaScript/admin_promotions/post.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ export const sdk = new Medusa({
88
},
99
})
1010

11-
sdk.admin.promotion.create({
11+
sdk.admin.promotion.create({
1212
name: "My Promotion",
1313
description: "This is a test promotion",
1414
code: "PROMO123",
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.shippingOptionType.list()
12+
.then(({ shipping_option_types, count, limit, offset }) => {
13+
console.log(shipping_option_types)
14+
})
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.shippingOptionType.create({
12+
label: "Standard",
13+
code: "standard",
14+
description: "Ship in 2-3 days."
15+
})
16+
.then(({ shipping_option_type }) => {
17+
console.log(shipping_option_type)
18+
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.shippingOptionType.delete("sotype_123")
12+
.then(({ deleted }) => {
13+
console.log(deleted)
14+
})
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.shippingOptionType.retrieve("sotype_123")
12+
.then(({ shipping_option_type }) => {
13+
console.log(shipping_option_type)
14+
})
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Medusa from "@medusajs/js-sdk"
2+
3+
export const sdk = new Medusa({
4+
baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
5+
debug: import.meta.env.DEV,
6+
auth: {
7+
type: "session",
8+
},
9+
})
10+
11+
sdk.admin.shippingOptionType.update("sotype_123", {
12+
code: "express"
13+
})
14+
.then(({ shipping_option_type }) => {
15+
console.log(shipping_option_type)
16+
})
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
curl '{backend_url}/admin/feature-flags'
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
curl '{backend_url}/admin/orders/{id}/shipping-options' \
2+
-H 'Authorization: Bearer {access_token}'

0 commit comments

Comments
 (0)