chore(docs): Generated API Reference (#3718)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
51d0b88404
commit
70435d5631
@@ -0,0 +1,7 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.shippingOptions.list()
|
||||
.then(({ shipping_options, count }) => {
|
||||
console.log(shipping_options.length);
|
||||
});
|
||||
@@ -0,0 +1,14 @@
|
||||
import Medusa from "@medusajs/medusa-js"
|
||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||
// must be previously logged in or use api token
|
||||
medusa.admin.shippingOptions.create({
|
||||
name: 'PostFake',
|
||||
region_id: "saasf",
|
||||
provider_id: "manual",
|
||||
data: {
|
||||
},
|
||||
price_type: 'flat_rate'
|
||||
})
|
||||
.then(({ shipping_option }) => {
|
||||
console.log(shipping_option.id);
|
||||
});
|
||||
Reference in New Issue
Block a user