chore(docs): Generated API Reference (#5319)
Co-authored-by: shahednasser <shahednasser@users.noreply.github.com>
This commit is contained in:
1 parent
4ada22d656
commit
c135730838
5 files changed
+80
No files matched your search
+12
@@ -0,0 +1,12 @@
|
|||||||
|
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.priceLists.deleteProductsPrices(priceListId, {
|
||||||
|
product_ids: [
|
||||||
|
productId1,
|
||||||
|
productId2,
|
||||||
|
]
|
||||||
|
})
|
||||||
|
.then(({ ids, object, deleted }) => {
|
||||||
|
console.log(ids.length);
|
||||||
|
});
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
curl -X DELETE '{backend_url}/admin/price-lists/{id}/products/prices/batch' \
|
||||||
|
-H 'x-medusa-access-token: {api_token}' \
|
||||||
|
-H 'Content-Type: application/json' \
|
||||||
|
--data-raw '{
|
||||||
|
"product_ids": [
|
||||||
|
"prod_1",
|
||||||
|
"prod_2"
|
||||||
|
]
|
||||||
|
}'
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
product_ids:
|
||||||
|
description: The IDs of the products to delete their associated prices.
|
||||||
|
type: array
|
||||||
|
items:
|
||||||
|
type: string
|
||||||
@@ -527,6 +527,8 @@ paths:
|
|||||||
$ref: paths/admin_price-lists_{id}_prices_batch.yaml
|
$ref: paths/admin_price-lists_{id}_prices_batch.yaml
|
||||||
/admin/price-lists/{id}/products:
|
/admin/price-lists/{id}/products:
|
||||||
$ref: paths/admin_price-lists_{id}_products.yaml
|
$ref: paths/admin_price-lists_{id}_products.yaml
|
||||||
|
/admin/price-lists/{id}/products/prices/batch:
|
||||||
|
$ref: paths/admin_price-lists_{id}_products_prices_batch.yaml
|
||||||
/admin/price-lists/{id}/products/{product_id}/prices:
|
/admin/price-lists/{id}/products/{product_id}/prices:
|
||||||
$ref: paths/admin_price-lists_{id}_products_{product_id}_prices.yaml
|
$ref: paths/admin_price-lists_{id}_products_{product_id}_prices.yaml
|
||||||
/admin/price-lists/{id}/variants/{variant_id}/prices:
|
/admin/price-lists/{id}/variants/{variant_id}/prices:
|
||||||
|
|||||||
+50
@@ -0,0 +1,50 @@
|
|||||||
|
delete:
|
||||||
|
operationId: DeletePriceListsPriceListProductsPricesBatch
|
||||||
|
summary: Delete Product Prices
|
||||||
|
description: Delete all the prices associated with multiple products in a price list.
|
||||||
|
x-authenticated: true
|
||||||
|
parameters:
|
||||||
|
- in: path
|
||||||
|
name: id
|
||||||
|
required: true
|
||||||
|
description: The ID of the Price List
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
x-codegen:
|
||||||
|
method: deleteProductsPrices
|
||||||
|
x-codeSamples:
|
||||||
|
- lang: JavaScript
|
||||||
|
label: JS Client
|
||||||
|
source:
|
||||||
|
$ref: >-
|
||||||
|
../code_samples/JavaScript/admin_price-lists_{id}_products_prices_batch/delete.js
|
||||||
|
- lang: Shell
|
||||||
|
label: cURL
|
||||||
|
source:
|
||||||
|
$ref: >-
|
||||||
|
../code_samples/Shell/admin_price-lists_{id}_products_prices_batch/delete.sh
|
||||||
|
security:
|
||||||
|
- api_token: []
|
||||||
|
- cookie_auth: []
|
||||||
|
- jwt_token: []
|
||||||
|
tags:
|
||||||
|
- Price Lists
|
||||||
|
responses:
|
||||||
|
'200':
|
||||||
|
description: OK
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
$ref: ../components/schemas/AdminPriceListDeleteProductPricesRes.yaml
|
||||||
|
'400':
|
||||||
|
$ref: ../components/responses/400_error.yaml
|
||||||
|
'401':
|
||||||
|
$ref: ../components/responses/unauthorized.yaml
|
||||||
|
'404':
|
||||||
|
$ref: ../components/responses/not_found_error.yaml
|
||||||
|
'409':
|
||||||
|
$ref: ../components/responses/invalid_state_error.yaml
|
||||||
|
'422':
|
||||||
|
$ref: ../components/responses/invalid_request_error.yaml
|
||||||
|
'500':
|
||||||
|
$ref: ../components/responses/500_error.yaml
|
||||||
Reference in new issue
Block a user