chore(docs): Generated API Reference (#4857)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
co-authored by
shahednasser
parent
d04b9635f9
commit
7aaa332a32
+3
-3
@@ -1,7 +1,7 @@
|
|||||||
import Medusa from "@medusajs/medusa-js"
|
import Medusa from "@medusajs/medusa-js"
|
||||||
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
const medusa = new Medusa({ baseUrl: MEDUSA_BACKEND_URL, maxRetries: 3 })
|
||||||
// must be previously logged in or use api token
|
// must be previously logged in or use api token
|
||||||
medusa.admin.variants.list()
|
medusa.admin.variants.getInventory(variantId)
|
||||||
.then(({ variants, limit, offset, count }) => {
|
.then(({ variant }) => {
|
||||||
console.log(variants.length)
|
console.log(variant.inventory, variant.sales_channel_availability)
|
||||||
})
|
})
|
||||||
|
|||||||
+1
-1
@@ -1,2 +1,2 @@
|
|||||||
curl '{backend_url}/admin/variants' \
|
curl '{backend_url}/admin/variants/{id}/inventory' \
|
||||||
-H 'Authorization: Bearer {api_token}'
|
-H 'Authorization: Bearer {api_token}'
|
||||||
|
|||||||
@@ -32,11 +32,7 @@ get:
|
|||||||
content:
|
content:
|
||||||
application/json:
|
application/json:
|
||||||
schema:
|
schema:
|
||||||
type: object
|
$ref: ../components/schemas/AdminGetVariantsVariantInventoryRes.yaml
|
||||||
properties:
|
|
||||||
variant:
|
|
||||||
type: object
|
|
||||||
$ref: ../components/schemas/AdminGetVariantsVariantInventoryRes.yaml
|
|
||||||
'400':
|
'400':
|
||||||
$ref: ../components/responses/400_error.yaml
|
$ref: ../components/responses/400_error.yaml
|
||||||
'401':
|
'401':
|
||||||
|
|||||||
Reference in New Issue
Block a user