chore(docs): Generated API Reference (#4857)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d04b9635f9
commit
7aaa332a32
@@ -1,7 +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.variants.list()
|
||||
.then(({ variants, limit, offset, count }) => {
|
||||
console.log(variants.length)
|
||||
medusa.admin.variants.getInventory(variantId)
|
||||
.then(({ variant }) => {
|
||||
console.log(variant.inventory, variant.sales_channel_availability)
|
||||
})
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
curl '{backend_url}/admin/variants' \
|
||||
curl '{backend_url}/admin/variants/{id}/inventory' \
|
||||
-H 'Authorization: Bearer {api_token}'
|
||||
|
||||
@@ -32,11 +32,7 @@ get:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
variant:
|
||||
type: object
|
||||
$ref: ../components/schemas/AdminGetVariantsVariantInventoryRes.yaml
|
||||
$ref: ../components/schemas/AdminGetVariantsVariantInventoryRes.yaml
|
||||
'400':
|
||||
$ref: ../components/responses/400_error.yaml
|
||||
'401':
|
||||
|
||||
Reference in New Issue
Block a user