chore(docs): Generated API Reference (#3211)
Co-authored-by: olivermrbl <olivermrbl@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9997485c55
commit
14b2de94e2
@@ -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.inventoryItems.list()
|
||||
.then(({ inventory_items }) => {
|
||||
console.log(inventory_items.length);
|
||||
});
|
||||
@@ -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.inventoryItems.delete(inventoryItemId)
|
||||
.then(({ id, object, deleted }) => {
|
||||
console.log(id)
|
||||
})
|
||||
@@ -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.inventoryItems.retrieve(inventoryItemId)
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
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.inventoryItems.update(inventoryItemId, {
|
||||
origin_country: "US",
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
@@ -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.inventoryItems.listLocationLevels(inventoryItemId)
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.location_levels);
|
||||
});
|
||||
@@ -0,0 +1,10 @@
|
||||
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.inventoryItems.createLocationLevel(inventoryItemId, {
|
||||
location_id: 'sloc',
|
||||
stocked_quantity: 10,
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
@@ -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.inventoryItems.deleteLocationLevel(inventoryItemId, locationId)
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
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.inventoryItems.updateLocationLevel(inventoryItemId, locationId, {
|
||||
stocked_quantity: 15,
|
||||
})
|
||||
.then(({ inventory_item }) => {
|
||||
console.log(inventory_item.id);
|
||||
});
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user