import { Request, Response } from "express"; /** * @oas [delete] /admin/collections/{id}/products/batch * operationId: "DeleteProductsFromCollection" * summary: "Remove Products from Collection" * description: "Remove a list of products from a collection. This would not delete the product, only the association between the product and the collection." * x-authenticated: true * parameters: * - (path) id=* {string} The ID of the Product Collection. * requestBody: * content: * application/json: * schema: * $ref: "#/components/schemas/AdminDeleteProductsFromCollectionReq" * x-codegen: * method: removeProducts * x-codeSamples: * - lang: JavaScript * label: JS Client * source: | * 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.collections.removeProducts(collectionId, { * product_ids: [ * productId1, * productId2 * ] * }) * .then(({ id, object, removed_products }) => { * console.log(removed_products) * }) * - lang: Shell * label: cURL * source: | * curl -X DELETE '{backend_url}/admin/collections/{id}/products/batch' \ * -H 'Authorization: Bearer {api_token}' \ * -H 'Content-Type: application/json' \ * --data-raw '{ * "product_ids": [ * "prod_01G1G5V2MBA328390B5AXJ610F" * ] * }' * security: * - api_token: [] * - cookie_auth: [] * tags: * - Product Collections * responses: * "200": * description: OK * content: * application/json: * schema: * $ref: "#/components/schemas/AdminDeleteProductsFromCollectionRes" * "400": * $ref: "#/components/responses/400_error" * "401": * $ref: "#/components/responses/unauthorized" * "404": * $ref: "#/components/responses/not_found_error" * "409": * $ref: "#/components/responses/invalid_state_error" * "422": * $ref: "#/components/responses/invalid_request_error" * "500": * $ref: "#/components/responses/500_error" */ declare const _default: (req: Request, res: Response) => Promise; export default _default; /** * @schema AdminDeleteProductsFromCollectionReq * type: object * required: * - product_ids * properties: * product_ids: * description: "An array of Product IDs to remove from the Product Collection." * type: array * items: * description: "The ID of a Product to add to the Product Collection." * type: string */ export declare class AdminDeleteProductsFromCollectionReq { product_ids: string[]; }